[3D Reconstruction] Camera Geometry

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

P=\begin{bmatrix} x\\y\\z \end{bmatrix} \rightarrow {P}'=\begin{bmatrix} x'\\y' \end{bmatrix} \left\{\begin{matrix} x' = f\frac{​{x}}{z} \\ y'=f\frac{​{x}}{z} \\ \end{matrix}\right.

 Move the image plane origin coordinates to the lower left corner:

\left ( x,y,z \right ) \rightarrow \left ( f\frac{x}{z} +c_x{},f\frac{y}{z} +c_y{}\right )

Add the conversion from real-world units (m) to digital picture units (pixels):

\left ( x,y,z \right ) \rightarrow \left ( fk\frac{x}{z} +c_x{},fl\frac{y}{z} +c_y{}\right )

At this point, the mapping of camera coordinates to image plane coordinates is completed:

P=(x,y,z)\rightarrow P'=(\alpha \frac{x}{z}+c_{x},\beta \frac{y}{z}+c_{y})

Homogeneous coordinates

P=(x,y,z)\rightarrow P'=(\alpha \frac{x}{z}+c_{x},\beta \frac{y}{z}+c_{y})

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.

\left ( x,y \right )\rightarrow \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}             \left ( x,y,z \right )\rightarrow \begin{bmatrix} x\\ y\\z\\ 1 \end{bmatrix}            

Convert homogeneous coordinates to Euclidean coordinates:

\begin{bmatrix} x\\y\\w \end{bmatrix}\rightarrow (x/w,y/w)                \begin{bmatrix} x\\y\\z\\w \end{bmatrix}\rightarrow (x/w,y/w,z/w)

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 \thetafor 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:

Three-dimensional reconstruction of computer vision (an in-depth introduction to the core algorithms of SfM and SLAM) - 1. Camera geometry_bilibili_bilibili

Guess you like

Origin blog.csdn.net/holle_world_ldx/article/details/134329876
Recommended