Using OpenCV to generate 3d points (assuming frontal parallel configuration)

五迷三道 提交于 2019-11-30 09:51:07

Under fronto-parrallel assumption, the relation between disparity and 3D depth is: d = f*T/Z, where d is the disparity, f is the focal length, T is the baseline and Z is the 3D depth. If you treat the image center as the principal point, the 3D coordinate system is settled. Then for a pixel (px,py), its 3D coordinate (X, Y, Z) is:

X = (px-cx)*Z/f, Y = (py- cy)*Z/f, Z = f*T/d,

where cx, cy are the pixel coordinate of image center.

Your disparity image seems pretty good and it can generate reasonable 3D point clouds.

A simple disparity browser on github.

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