Attention! This forum will be made read-only by Dec-20. Please migrate to https://forum.opencv.org. Most of existing active users should've received invitation by e-mail.

# Construction of Camera matrix

Dear All, Here is a simple problem

P=[-306.8843; -263.0437; 0] is a point in space and p = [ 447.3374 ; 487.9971] is a corresponding image observation in pixels.

If 149.2, -53.6, -56.2 are Euler angles about x, y and z axis respectively, T= [ -28.3; -10.4; 1794.3 ] is translation vector, f= 16.5621 is the focal length, c=[ 285.7615; 249.037 ] are coordinate of principal points and aspect ratio is 1

How to construct camera matrix, that give p=[C] * P

Your help will be greatly acknowledged

Thanks

edit retag close merge delete

You can construct the camera (projection) matrix using the rotation, translation, focal lengths and principle points. You do not need a 3d - 2d point correspondence in this case.

Sort by » oldest newest most voted

Your three euler angles and T are describing the rigid motion from the 3d point of your object coordinate system to a 3d point in the camera coordinate system (Pc):

Pc = [R,t] * P;

You have to use a camera model, for example Zhang. Then, Pc will be projected on the normalized image plane (division by the Z-Components) and corrected with the distortion parameters (radial and tangential).

pc = Pc/Z;

The final step is your point in the image coordinate system of your image plane:

p = K * pc;

K includes four parameters, fx fy and cx, cy (assuming you have square pixels on your sensor).

You should have a look in the book of Trucco & Verri or the doc:

http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html

more

I would note that assuming a general pinhole camera model (I am unaware of any Zhang camera model), there is no need to separate the extrinsic and intrinsic steps in the projection and you not need to normalize (unless performing distortion removal, which was not asked). In general you can formulate it as p = [K] [R | t] [P 1], where K is the calibration matrix, R = RxRyRz the composition of the eurler angle matrices, and t the translation.

Official site

GitHub

Wiki

Documentation