Kinect mapping color image to depth image in MATLAB

巧了我就是萌 提交于 2019-11-28 10:36:40

问题


I have collected data using Kinect v2 sensor and I have a depth map together with its corresponding RGB image. I also calibrated the sensor and obtained the rotation and translation matrix between the Depth camera and RGB camera.

So I was able to reproject the depth values on the RGB image and they match. However, since the RGB image and the depth image are of different resolutions, there are a lot of holes in the resulting image.

So I am trying to move the other way, i.e. mapping the color onto the depth instead of depth to color.

So the first problem I am having is that the RGB image has 3 layers and I have to convert the RGB image to grayscale to do it and I am not getting the correct results.

Can this be done?

Has anyone tried this before?


回答1:


Why can't you fit the Z-depth to the RGB?

To fit the low res image to the high- res should be easy, as long as both represent the same size of data (i.e. corners of both images are the same point)

It should be as easy as:

Z_interp=imresize(Zimg, [size(RGB,1) size(RGB,2)])

Now Z_interp should have the same amount of pixels as RGB


If you still want to do it the other way around, well, use the same approach:

RGB_interp=imresize(RGB, [size(Zimg,1) size(Zimg,2)])



回答2:


The Image Acquisition Toolbox now officially supports Kinect v2 for Windows. You can get a point cloud out from Kinect using pcfromkinect function in the Computer Vision System Toolbox.



来源:https://stackoverflow.com/questions/28329024/kinect-mapping-color-image-to-depth-image-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!