pinhole camera model
In order to facilitate our mathematical modeling of the pinhole camera model, we often study the virtual image plane, because the direction of the virtual image plane is consistent with the direction of our actual object.
The mapping from three-dimensional coordinates to two-dimensional coordinates can be obtained through the similar triangle method
Move the image plane origin coordinates to the lower left corner:
Add the conversion from real-world units (m) to digital picture units (pixels):
At this point, the mapping of camera coordinates to image plane coordinates is completed:
Homogeneous coordinates
In the above formula, z will change, so P to P' is not a linear transformation. We need to refer to homogeneous coordinates to make it a linear transformation.
To turn Euclidean coordinates into homogeneous coordinates is to add a dimension at the end and make its value 1.
Convert homogeneous coordinates to Euclidean coordinates:
The results of converting homogeneous coordinates to Euclidean coordinates are not one-to-one correspondence. For example, (1, 1, 1) and (2, 2, 2) are converted to Euclidean coordinates and both are (1, 1). There is a coefficient difference between them. .
The elements in the M matrix are fixed. After becoming homogeneous coordinates, P to P' is a linear transformation.
projection matrix
Due to the manufacturing process, the image plane may not be a rectangle, so it needs to be mapped for modeling.
I M is called the projection matrix, and K is called the intrinsic parameter matrix of the camera.
What we have completed so far is the mapping from the camera coordinate system to the pixel coordinate system. We also need an external parameter matrix to establish the mapping from the world coordinate system to the camera coordinate system.
Refer to Teacher Lu Peng’s 3D reconstruction class: