3. Lens Distortion

1. Lens distortion

The error between the actual imaging and the ideal imaging after lens imaging is the lens distortion, mainly including radial distortion and tangential distortion

 

1.1 Radial Distortion

Radial distortion is distributed along the radial direction of the lens, which is divided into barrel distortion and pincushion distortion. The place far away from the center of the lens is more curved than the place close to the center, and the distortion at the optical center is 0. The farther away from the optical center, the greater the distortion. The mathematical polynomial of radial distortion can be expressed as:

\left\{\begin{matrix} x_{distorted} = x(1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6}))\\ y_{distorted} = y(1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6})) \end{matrix}\right.

In the formula, (x, y) is the undistorted pixel point, ( x_{distorted},y_{distorted}) is the distorted pixel point, and k_{1},k_{2},k_{3}is the radial distortion coefficient. The internal parameters of the camera generally use the first two items, and the fisheye camera uses the third item.

1.2 Tangential Distortion

Tangential distortion is caused by the fact that the optical axis of the lens is not parallel to the imaging surface of the sensor. The mathematical expression of the distortion is:

\left\{\begin{matrix} x_{distorted} = x + \begin{bmatrix}2p_{1}xy+p_{2}(r^{2}+2x^{2}) \end{bmatrix} \\ y_{distorted} = y + \begin{bmatrix}2p_{2}xy+p_{1}(r^{2}+2y^{2}) \end{bmatrix} \end{matrix}\right.

After radial distortion and tangential distortion are combined:

\left\{\begin{matrix} x_{distorted} = x(1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6}))+x + \begin{bmatrix}2p_{1}xy+p_{2}(r^{2}+2x^{2}) \end{bmatrix} \\y_{distorted}=y(1+k_{1}r^{2}+k_{2}r^{4}+k_{3}r^{6}+ y + \begin{bmatrix}2p_{2}xy+p_{1}(r^{2}+2y^{2}) \end{bmatrix} \end{matrix}\right.

In summary, radial distortion and tangential distortion contain 5 coefficients in total, and these 5 coefficients are defined as a 5x1 matrix { } in opencv. k_{1},k_{2},p_{1},p_{2},k_{3}

Guess you like

Origin blog.csdn.net/csucmee502/article/details/129878812