Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get 3D coordinates from 2D image pixel if extrinsic and intrinsic parameters are known

I am doing camera calibration from tsai algo. I got intrensic and extrinsic matrix, but how can I reconstruct the 3D coordinates from that inormation?

enter image description here

1) I can use Gaussian Elimination for find X,Y,Z,W and then points will be X/W , Y/W , Z/W as homogeneous system.

2) I can use the OpenCV documentation approach:

enter image description here

as I know u, v, R , t , I can compute X,Y,Z.

However both methods end up in different results that are not correct.

What am I'm doing wrong?

like image 371
YAHOOOOO Avatar asked Oct 20 '11 12:10

YAHOOOOO


People also ask

What is the difference between intrinsic and extrinsic parameters?

Extrinsic Parameters: define the location and orientation of the camera with respect to the world frame. Intrinsic Parameters: allow a mapping between camera coordinates and pixel coordinates in the image frame. Camera model in general is a mapping from world to image coordinates.

What are intrinsic and extrinsic camera parameters in computer vision?

The extrinsic parameters represent the location of the camera in the 3-D scene. The intrinsic parameters represent the optical center and focal length of the camera. The world points are transformed to camera coordinates using the extrinsics parameters.

What are extrinsic parameters?

Extrinsic parameters include the relative rotation and translation between cameras, which are necessary in applications such as depth estimation and structure from motion.


1 Answers

If you got extrinsic parameters then you got everything. That means that you can have Homography from the extrinsics (also called CameraPose). Pose is a 3x4 matrix, homography is a 3x3 matrix, H defined as

                   H = K*[r1, r2, t],       //eqn 8.1, Hartley and Zisserman 

with K being the camera intrinsic matrix, r1 and r2 being the first two columns of the rotation matrix, R; t is the translation vector.

Then normalize dividing everything by t3.

What happens to column r3, don't we use it? No, because it is redundant as it is the cross-product of the 2 first columns of pose.

Now that you have homography, project the points. Your 2d points are x,y. Add them a z=1, so they are now 3d. Project them as follows:

        p          = [x y 1];         projection = H * p;                   //project         projnorm   = projection / p(z);      //normalize 

Hope this helps.

like image 194
Jav_Rock Avatar answered Sep 30 '22 03:09

Jav_Rock