Kinect将彩色图像映射到MATLAB中的深度图像 [英] Kinect mapping color image to depth image in MATLAB
问题描述
我使用Kinect v2传感器收集数据,并且我有一个深度图以及相应的RGB图像。我还校准了传感器并获得了深度相机和RGB相机之间的旋转和平移矩阵。
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.
所以我能够重新投影RGB图像上的深度值,他们比赛。但是,由于RGB图像和深度图像的分辨率不同,因此在生成的图像中会出现很多洞。
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.
所以我遇到的第一个问题是RGB图像有3层,我必须转换RGB图像到灰度来做,我得不到正确的结果。
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.
可以这样做吗?
之前有没有人试过这个?
Has anyone tried this before?
推荐答案
为什么你不能将Z深度适合RGB?
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)
应该如此简单:
Z_interp=imresize(Zimg, [size(RGB,1) size(RGB,2)])
现在 Z_interp
应该具有相同的数量像素为RGB
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)])
这篇关于Kinect将彩色图像映射到MATLAB中的深度图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!