3d to 2d Projection Matrix

后端 未结 4 1633
小鲜肉
小鲜肉 2020-12-14 03:07

I have 3 points in a 3D space of which I know the exact locations. Suppose they are: (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2).

Al

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 03:54

    What you are looking for is called a Pose Estimation algorithm. Have a look at the POSIT implementation in OpenCV: http://opencv.willowgarage.com/documentation/c/calib3d_camera_calibration_and_3d_reconstruction.html#posit

    You will need four or more points, and they may not lie in the same plane.

    A tutorial for this implementation is here: http://opencv.willowgarage.com/wiki/Posit

    Do take care though: in the tutorial a square viewport is used, so all view-coordinates are in the -1,-1 to 1,1 range. This leads one to assume that these should be in the camera coordinate system (before aspect-ratio correction). This is not the case, so if you use a viewport with e.g. a 4:3 aspect ratio then your input coordinates should be in the -1.3333,-1 to 1.3333,1 range.

    By the way, if your points must lie in the same plane, then you can also look at the CameraCalibration algorithm from OpenCV, but this is more involved to set up and requires more points as input. However it will also yield you the distortion information and intrinsic parameters of your camera.

提交回复
热议问题