Machine Vision Model - Distortion Model

1 Overview

Due to the deviation of manufacturing precision and assembly process, the lens lens will introduce distortion, resulting in distortion of imaging, that is, image distortion.
In the previous article " Machine Vision Model - Projection Matrix ", the machine vision system imaging model is described. In this model, the camera internal parameters (related to pixel size, focal length, pixel center) and camera external parameters (related to the camera In relation to the pose of the world coordinate system), this model is an ideal model, or a linear model, which does not take into account the influence of the distortion caused by the lens lens.
Combined with the above imaging model, distortion can be understood as the light between the imaging point and the object point is curved, as shown in the figure below. The three points OO
insert image description here
that should have been collinear in the figureO P c r t P_{crt} Pcrt, Q, now they are not collinear due to some deviation of the lens, P crt P_{crt}Pcrtis imaged on the PPPoint P , obviously, the relationship at this time is no longer the matrix relationship discussed above, that is to say, under the condition of distortion, the result calculated by the matrix formula above is incorrect.
Therefore, before using this visual model matrix formula, we need to eliminate the generated distortion first. The same principle as above, if the lens distortion can be expressed by a mathematical model or mathematical formula, we can easily eliminate the distortion. We put This model is called the "distortion model".

2 Distortion of the lens

Lens distortion mainly includes: radial distortion, tangential distortion, thin lens distortion, etc., but the most notable ones are radial distortion and tangential distortion, so we only consider these two kinds of distortion in this model. At the same time, the distortion of the image is a combination of two kinds of distortion, so the whole distortion is decomposed into a radial distortion component and a tangential distortion component.

2.1 Radial Distortion

Radial distortion: It is the distortion distributed along the radius direction of the lens, such as the distortion produced by the well-known fisheye lens, pincushion distortion, barrel distortion, etc.
insert image description here
insert image description here
The figure below shows the distribution of radial distortion, generally the farther away from the center the more serious.
insert image description here
Since this distortion is distributed radially outward from the center, we use the first few terms of the Taylor series expansion at r=0 to approximate the radial distortion, and the coordinate relationship before and after the radial distortion is xdistorted = x
( 1 + k 1 r 2 + k 2 r 4 + k 3 r 6 ) ydistorted = y ( 1 + k 1 r 2 + k 2 r 4 + k 3 r 6 ) x_{distorted}=x(1+k_1r^2 +k_2r^4+k_3r^6)\\ y_{distorted}=y(1+k_1r^2+k_2r^4+k_3r^6)xdistorted=x(1+k1r2+k2r4+k3r6)ydistorted=y(1+k1r2+k2r4+k3r6)
式中:
x d i s t o r t e d , y d i s t o r t e d x_{distorted},y_{distorted} xdistorted,ydistorted——The coordinates of the original distorted image
x , yx,yx,y - correct coordinates (undistorted image coordinates, or corrected coordinates)
rrr——半径, r 2 = x 2 + y 2 r^2 =x^2 +y^2 r2=x2+y2
k 1 , k 2 , k 3 k_1,k_2,k_3 k1,k2,k3——Introduced radial distortion parameter

2.2 Tangential Distortion

Tangential distortion: It is caused by the fact that the lens itself is not parallel to the camera sensor plane (image plane) or the image plane. This situation is mostly caused by the installation deviation of the lens pasted on the lens module, as shown in the figure below.
insert image description here
insert image description here
With the great improvement of the camera manufacturing process, this kind of situation rarely occurs, so the tangential distortion can be ignored in many cases.
The figure below shows the distribution of tangential distortion.
insert image description here
Tangential distortion can be described by two additional parameters p1 and p2
xdistorted = x + 2 p 1 xy + p 2 ( r 2 + 2 x 2 ) ydistorted = y + 2 p 2 xy + p 1 ( r 2 + 2 y 2 ) x_{distorted}=x+2p_1xy+p_2(r^2+2x^2)\\ y_{distorted}=y+2p_2xy+p_1(r^2+2y^2 )xdistorted=x+2p1xy+p2(r2+2x _2)ydistorted=y+2p2xy+p1(r2+2 y2)
式中:
x d i s t o r t e d , y d i s t o r t e d x_{distorted},y_{distorted} xdistorted,ydistorted——The coordinates of the original distorted image
x , yx,yx,y - correct coordinates (undistorted image coordinates, or corrected coordinates)
rrr——半径, r 2 = x 2 + y 2 r^2 =x^2 +y^2 r2=x2+y2
p 1 , p 2 p_1,p_2 p1,p2——Introduced tangential distortion parameter

3 Machine Vision Distortion Model

In summary, the lens distortion model of the machine vision system can be obtained as follows
Distorted radial component:
xdistorted = x ( 1 + k 1 r 2 + k 2 r 4 + k 3 r 6 ) ydistorted = y ( 1 + k 1 r 2 + k 2 r 4 + k 3 r 6 ) x_{distorted}=x(1+k_1r^2+k_2r^4+k_3r^6)\\ y_{distorted}=y(1+k_1r^2+k_2r^4+k_3r ^6)\\xdistorted=x(1+k1r2+k2r4+k3r6)ydistorted=y(1+k1r2+k2r4+k3r6)
Formula:
xdistorted = x + 2 p 1 xy + p 2 ( r 2 + 2 x 2 ) ydistorted = y + 2 p 2 xy + p 1 ( r 2 + 2 y 2 ) x_{distorted}=x+ 2p_1xy+p_2(r^2+2x^2)\\ y_{distorted}=y+2p_2xy+p_1(r^2+2y^2)xdistorted=x+2p1xy+p2(r2+2x _2)ydistorted=y+2p2xy+p1(r2+2 y2 )
It contains 5 distortion parameters:k 1 , k 2 , k 3 , p 1 , p 2 k_1,k_2,k_3,p_1,p_2k1,k2,k3,p1,p2.
For a given lens imaging system, how are these 5 distortion parameters obtained? This involves "camera calibration", that is, it needs to be solved based on a series of known coordinate values ​​of the original imaging point and the distorted imaging point, which are brought into the above formula. For details, see "Machine Vision-Camera Calibration " .

Guess you like

Origin blog.csdn.net/hangl_ciom/article/details/106252235