フィルターのクリア

Mapping RGB and depth (Kinect v2)

27 ビュー (過去 30 日間)
alheka
alheka 2016 年 2 月 15 日
編集済み: Walter Roberson 2019 年 6 月 11 日
Hi everyone, for my project, I'm working with the Kinect v2 and I have to map the depth information onto the RGB images to process them: in particular, I need to know which pixels in the RGB images are in a certain range of distance (depth) along the Z axis; I'm acquiring all the data with a C# program and saving them as images.
I had a look on the internet and I found some equations to map depth and RGB info here. I am actually able to get the intrinsic parameters for the single camera calibration using a checkerboard recorded from both the RGB camera (1920x1080) and the IR sensor (512x424) and processing them with MatLab Camera Calibrator app, but I'm stuck doing the stereo calibration (to find the rotation and translation matrices), because MatLab Stereo Camera Calibrator doesn't accept pair of images with different resolution.
I've also tried some other method with no results; It would be great if anyone could help me figuring out what I have to do in order to solve my problem. Thanks very much!
  9 件のコメント
Walter Roberson
Walter Roberson 2018 年 11 月 6 日
Following some links I see that someone has created a small toolbox at https://sourceforge.net/projects/kinectcalib/
Muhammad Hammad Malik
Muhammad Hammad Malik 2018 年 11 月 15 日
thanks for this, i used this but it is always saying that device is not detected but when i run in some other code then device is working

サインインしてコメントする。

採用された回答

Shida
Shida 2016 年 2 月 16 日
Hi alheka, I used to have the same problem. It's a pity that Matlab still hasn't solved this issue. But there's a solution to that. It took me quite a while to figure it out. Here you have the steps you need:
1. Stereo Calibration:
a) Find checkerboard points:
[pointsRGB, boardSizeRGB, imagesRGBused] =detectCheckerboardPoints(imagesRGB);
[pointsIR, boardSizeIR, imagesIRused] = detectCheckerboardPoints(imagesIR);
b) Remove the pairs where in one of the sets the points were not detected. Matlab does that automatically for the stereo calibration. But you need to write your code. I did make such code, but it's too unreadable to share here !
c) Now you need to manually combine the two sets.
imagePoints = cat(4, poitnsRGB, pointsIR);
d) Now the word points: where squaresize is the width of each of the squares in your calibration target (unit is mm).
worldPoints = generateCheckerboardPoints(boardSizeRGB, squaresize);
e) Calibration:
[stereoParams,pairsUsed,estimationErrors] = estimateCameraParameters(imagePoints,...
worldPoints,'EstimateSkew', false, 'EstimateTangentialDistortion', false, ...
'NumRadialDistortionCoefficients', 2, 'WorldUnits', 'mm');
figure; showReprojectionErrors(stereoParams);
figure; showExtrinsics(stereoParams);
f) If needed, remove pairs of images with high error and re-calibrate until you're satisfied with the error.
2) Map the images: Actually the link you have is correct for this part. Just follow those instructions.
3) Remember that some artifacts (repeated pixels) can be caused in the mapped image due to parallax and the fact that some pixels are visible in one camera and not in the other. There are ways to fix that.
I hope it works for you.
Good luck.
  8 件のコメント
Dominik Melcher
Dominik Melcher 2016 年 12 月 6 日
Hi Shida,
I am trying to map the Color Pixel to Cameracoordinates. I followed your step you gave above, but I stuck at step 2, where I have to use the functions of the link. For some reason the depth Pixel doesnt match to the calculated colorpixel and I dont know why. Could you send me you matlab code of this matching pls?
Thanks, Dominik
Franz-Josef Siegemund
Franz-Josef Siegemund 2018 年 10 月 26 日
編集済み: Franz-Josef Siegemund 2018 年 10 月 29 日
Hi there,
i know this is a really old entry, but i would like to know if anybody did map from rgb->depth? I did get the transformation from depth->rgb working. But i am having trouble understanding the whole extrinsic/instrinsic camera parameters and how to transform with each. (A book or some reference would be enough).
In particular, i want to transform the position of 4 points from rgb image space -> depth.

サインインしてコメントする。

その他の回答 (1 件)

Muhammad Hammad Malik
Muhammad Hammad Malik 2018 年 10 月 29 日
hello all, i want to do depth-color image registration but do not know how to do it, kindly guide me for this. if anyone have working code or wahtever, kindly help me. thanks
  2 件のコメント
Ankit Jaiswal
Ankit Jaiswal 2019 年 2 月 22 日
Hi, Did you get success in this?
Muhammad Hammad Malik
Muhammad Hammad Malik 2019 年 6 月 10 日
編集済み: Walter Roberson 2019 年 6 月 11 日

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by