1

I have to produce RGB Depth alignment image from Kinect in Matlab. I followed this link of Matlab but it created an error by saying that
The resolutions of the depth image and the color image should be the same.

Resolution of RGB is 1920*1080 and Depth image is 512*424. I tried to change these properties in Kinect sensores but it says that these are just read only values, we can not change them.

Then I followed another link and tried to resize Depth Image to RGB, and again run alignment command of Matlab link, this time it says that:

Error using reshape To RESHAPE the number of elements must not change.
Error in imaq.internal.KinectDepth2ColorMap
Error in vision.internal.visionKinectDepthToColorMap
Error in alignColorToDepth

I also tried to resize RGB image to Depth and then tried to do alignment, results were not correct. More than 70 percent portion was full black and then in top right corner there was resized RGB image. These results are not acceptable.

I tried to find a better solution of doing alignment but till now I did not find anything helpful. If anybody can help me I will be thankful to you.

Community
  • 1
  • 1
Hammad Hassan
  • 1,192
  • 17
  • 29
  • Can you show the code you used to try to resize the Depth image? – Suever Mar 15 '16 at 20:09
  • From Depth to RGB conversion, I followed the code given at link which is mentioned in question. – Hammad Hassan Mar 15 '16 at 20:12
  • You can't change the properties because these are properties of your camera sensor. – Daniel Mar 15 '16 at 20:24
  • For the first error: "The resolutions of the depth image and the color image should be the same." which code line causes the problem, can you paste the full stack like you did for the other error? – Daniel Mar 15 '16 at 20:26
  • @Daniel Error using alignColorToDepth (line 91) The resolutions of the depth image and the color image should be the same. – Hammad Hassan Mar 15 '16 at 20:30
  • @HammadHassan then change resolution during scanning or resize one of the images if already scanned and working off-line – Spektre Mar 16 '16 at 08:01
  • @Spektre I have already mentioned my concerns about resizing. This is not working for me. – Hammad Hassan Mar 16 '16 at 17:58
  • @HammadHassan So in the first place you might want to read this in the reference: The alignColorToDepth will be removed in a future release. Use the pcfromkinect function with equivalent functionality instead. Good time to switch. Did you check if the parameters are correct? I assume the algorithm expects a Kinect V1, not a V2? Resizing to the expected sizes should work though. Given you are doing it right. – Piglet Mar 16 '16 at 18:35
  • Please give us the code - otherwise it is very difficult to say where you are going wrong. Please look through http://stackoverflow.com/questions/15113281/aligning-captured-depth-and-rgb-images?rq=1 and http://stackoverflow.com/questions/10391719/kinect-depth-and-image-frames-alignment?lq=1 – roni Mar 17 '16 at 08:33
  • @roni Code exist at this link. https://www.dropbox.com/s/fmmt9emfvjobohx/recordRgbDepthSimaltaneously.m?dl=0 – Hammad Hassan Mar 21 '16 at 17:44

0 Answers0