Ujjwal
Ujjwal

Reputation: 436

OpenCV Camera calibration use of rotation matrix

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

I used cv::calibrateCamera method with 9*6 chessboard pattern. Now I am getting rvecs and tvecs corresponding to each pattern, Can somebody explain the format of rvecs and tvecs? As far as I have figured out it is each one is 3*1 matrix. and OpenCV documentation suggests to see Rodrigues function.

http://en.wikipedia.org/wiki/Rodrigues'_rotation_formula

As far rodrigues is concerned it is way to rotate a vector around a given axis with angle theta. but for this we need four values unit Vector(ux,uy,uz) and the angle. but openCV seem to use only 3 values.

OpenCV rodrigues documentation refer the below link http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#void Rodrigues(InputArray src, OutputArray dst, OutputArray jacobian)

says that it will convert 3*1 matrix to 3*3 rotation matrix. Is this matrix same as which we use 3D graphics. can I convert it to 4*4 matrix and use it for transformations like below

M4X4 [

x x x 0

x x x 0

x x x 0

0 0 0 1

]

x : are the values from output 3by3 matrix of rodrigues function. Is the relationship valid:

Vout = M4X4 * Vin; using the matrix above.

Upvotes: 2

Views: 4149

Answers (1)

Max Allan
Max Allan

Reputation: 2395

The 3x1 rotation vector can express a rotation matrix by defining an axis of rotation via the direction that the vector points and an angle via the magnitude of the vector. Using the opencv function Rodrigues(InputArray src, OutputArray dst) you can obtain a rotation matrix which fits the function you describe.

Upvotes: 1

Related Questions