3D rendering in OpenCV

后端 未结 3 2005
清歌不尽
清歌不尽 2021-02-06 16:26

I am doing a project on 3D rendering of a scene. I am using OpenCV. The steps I am doing are like this:

  1. Taking two images of a scene.
  2. Calculating object
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-06 16:54

    you can have Q matrix from stereo rectification via openCV method:

    cv::stereoRectify
    

    I think you want the Q matrix to reconstruct the 3D. However, you can reconstruct from intrinsic parameters via:

    X = (u-cu)*base/d
    Y = (v-cv)*base/d
    Z = f*base/d 
    

    where (u,v) is a 2D point in the image coordinate system, (cu,cv) is the principal point of the camera, f is the focal length, base is the baseline, d is the disparity and (X,Y,Z) is a 3D point in the camera coordinate system.

提交回复
热议问题