OpenCV: Camera Calibration and 3D Reconstruction

Illustrates the Pinhole Camera Model

OpenCV: Perspective-n-Point (PnP) pose computation

Describes SolvePnP functions

222b

image.png

The output of solvePnP is a transform that transforms points in the markers reference frame to the camera's reference frame

 cam_T_marker * obj_points
 4x4 *4x1(for each corner of the marker
 R, T [-L/2, L/2, 0, 1] # top left corner of the marker in the markers reference frame where the frame is at the center of the marker
 
solvePnP(
	 objPoints, img_point, camMatrix, distCoeffs,
	 rvecs.at(i), # Rodriguez coordinates.
	 tvecs.at(i) # (x, y, z)
);

 4x4
 [R, T]
 [0, 1]

Useful docs on cv::Mat and how it works

OpenCV: Mat - The Basic Image Container

OpenCV: How to scan images, lookup tables and time measurement with OpenCV