I have the 3D-world coordinates of an object and I want to get its coordinates in the camera-2D-plane.
I have already calibrated the camera using cv::calibrateCamera
, so that I have the camera matrix and distortionCoeffs.
For projecting the 3D-point to 2d-camera-coordinates, I use cv::projectPoints
. Documentation says:
void projectPoints(InputArray objectPoints, InputArray rvec, InputArray tvec, InputArray cameraMatrix, InputArray distCoeffs, OutputArray imagePoints, OutputArray jacobian=noArray(), double aspectRatio=0 )
How do I get rvec/ tvec and is my approach right?calibrateCamera
gives me rvecs
and tvecs
, but they are for each input chessboard-image and I guess, they are the rotation and translation of the chessboard and not of the camera.