[英]OpenCV stereo vision 3D coordinates to 2D camera-plane projection different than triangulating 2D points to 3D
[英]Extracting 3D coordinates given 2D image points, depth map and camera calibration matrices
我有一組從OpenCV FAST
角點檢測功能輸出的2D image
關鍵點。 使用Asus Xtion I
還有一個時間同步的深度圖,其中包含所有已知的相機校准參數。 使用這些信息,我想在OpenCV.
提取一組3D
坐標(點雲) OpenCV.
任何人都可以給我任何關於如何這樣做的指示嗎? 提前致謝!
Nicolas Burrus 為 Kinect 等深度傳感器創建了一個很棒的教程。
http://nicolas.burrus.name/index.php/Research/KinectCalibration
我將復制並粘貼最重要的部分:
用顏色像素映射深度像素
第一步是使用估計的失真系數對 rgb 和深度圖像進行失真處理。 然后,使用深度相機內在函數,可以使用以下公式將深度相機的每個像素 (x_d,y_d) 投影到度量 3D 空間:
P3D.x = (x_d - cx_d) * depth(x_d,y_d) / fx_d P3D.y = (y_d - cy_d) * depth(x_d,y_d) / fy_d P3D.z = depth(x_d,y_d)
fx_d、fy_d、cx_d 和 cy_d 是深度相機的內在函數。
如果您對立體映射(kinect 的值)更感興趣:
然后我們可以在彩色圖像上重新投影每個 3D 點並獲得它的顏色:
P3D' = R.P3D + T P2D_rgb.x = (P3D'.x * fx_rgb / P3D'.z) + cx_rgb P2D_rgb.y = (P3D'.y * fy_rgb / P3D'.z) + cy_rgb
R 和 T 是立體聲校准期間估計的旋轉和平移參數。
我可以為我的 Kinect 估計的參數是:
顏色
fx_rgb 5.2921508098293293e+02
fy_rgb 5.2556393630057437e+02
cx_rgb 3.2894272028759258e+02
cy_rgb 2.6748068171871557e+02
k1_rgb 2.6451622333009589e-01
k2_rgb -8.3990749424620825e-01
p1_rgb -1.9922302173693159e-03
p2_rgb 1.4371995932897616e-03
k3_rgb 9.1192465078713847e-01
深度
fx_d 5.9421434211923247e+02
fy_d 5.9104053696870778e+02
cx_d 3.3930780975300314e+02
cy_d 2.4273913761751615e+02
k1_d -2.6386489753128833e-01
k2_d 9.9966832163729757e-01
p1_d -7.6275862143610667e-04
p2_d 5.0350940090814270e-03
k3_d -1.3053628089976321e+00
傳感器之間的相對變換(以米為單位)
R [ 9.9984628826577793e-01, 1.2635359098409581e-03, -1.7487233004436643e-02,
-1.4779096108364480e-03, 9.9992385683542895e-01, -1.2251380107679535e-02,
1.7470421412464927e-02, 1.2275341476520762e-02, 9.9977202419716948e-01 ] T [ 1.9985242312092553e-02, -7.4423738761617583e-04, -1.0916736334336222e-02 ]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.