CN106780628A - High Precision Camera Calibration method based on mixing distortion model - Google Patents
High Precision Camera Calibration method based on mixing distortion model Download PDFInfo
- Publication number
- CN106780628A CN106780628A CN201611210098.9A CN201611210098A CN106780628A CN 106780628 A CN106780628 A CN 106780628A CN 201611210098 A CN201611210098 A CN 201611210098A CN 106780628 A CN106780628 A CN 106780628A
- Authority
- CN
- China
- Prior art keywords
- image
- camera
- distortion
- calibration
- points
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 131
- 238000000605 extraction Methods 0.000 claims abstract description 21
- 239000011159 matrix material Substances 0.000 claims description 42
- 238000003384 imaging method Methods 0.000 claims description 41
- 238000001914 filtration Methods 0.000 claims description 22
- 238000005457 optimization Methods 0.000 claims description 18
- 230000008569 process Effects 0.000 claims description 16
- 238000004422 calculation algorithm Methods 0.000 claims description 15
- 239000007787 solid Substances 0.000 claims description 12
- 230000003287 optical effect Effects 0.000 claims description 10
- 238000007476 Maximum Likelihood Methods 0.000 claims description 8
- 238000012545 processing Methods 0.000 claims description 7
- XAGFODPZIPBFFR-UHFFFAOYSA-N aluminium Chemical compound [Al] XAGFODPZIPBFFR-UHFFFAOYSA-N 0.000 claims description 6
- 229910052782 aluminium Inorganic materials 0.000 claims description 6
- 238000002474 experimental method Methods 0.000 claims description 6
- 230000014509 gene expression Effects 0.000 claims description 6
- 238000000354 decomposition reaction Methods 0.000 claims description 4
- 238000001514 detection method Methods 0.000 claims description 4
- 238000013519 translation Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 description 10
- 230000008859 change Effects 0.000 description 7
- 238000005259 measurement Methods 0.000 description 7
- 238000011160 research Methods 0.000 description 7
- 230000008901 benefit Effects 0.000 description 6
- 230000009466 transformation Effects 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000002945 steepest descent method Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000009826 distribution Methods 0.000 description 3
- 238000003708 edge detection Methods 0.000 description 3
- 239000003550 marker Substances 0.000 description 3
- 238000012897 Levenberg–Marquardt algorithm Methods 0.000 description 2
- 239000004411 aluminium Substances 0.000 description 2
- 238000013016 damping Methods 0.000 description 2
- 238000012634 optical imaging Methods 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 229910000679 solder Inorganic materials 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 108010047303 von Willebrand Factor Proteins 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30204—Marker
- G06T2207/30208—Marker matrix
Landscapes
- Image Analysis (AREA)
Abstract
Based on the High Precision Camera Calibration method of mixing distortion model, comprise the following steps:S1. distortion of camera model is set up;S2. pattern is demarcated to choose, demarcate feature extraction and characteristic point automatic numbering;S3. camera calibration.The present invention considers various distortion comprehensively, and pseudo-random numbers generation is filtered based on the criterion for proposing, then realizes being automatically positioned for index point based on the center of circle automatic numbering method for proposing.
Description
Technical Field
The invention belongs to the field of signal processing, and relates to a high-precision camera calibration method for a solder paste measurement system in the technical field of calibration.
Background
The structured light three-dimensional measurement system establishes the three-dimensional morphology of a corresponding object on the basis of two-dimensional information by acquiring the two-dimensional image information of the object, and the accuracy of the three-dimensional morphology is based on the standard and accurate two-dimensional image information. Therefore, the specification of computer vision system parameters is very important for the two-dimensional image acquisition in the early stage of structured light projection three-dimensional measurement and the reconstruction of the three-dimensional morphology in the later stage. In most cases, these parameters must be obtained through experimentation and calculation, a process known as camera calibration. The camera calibration is one of the main contents of machine vision, and is a precondition and a key step for realizing the machine vision. With the continuous popularization of machine vision technology, the camera calibration technology has important significance in deep research, and is highly valued and widely concerned by scholars at home and abroad. In the past twenty years, the calibration technology of the camera has been greatly developed, and many scholars propose different camera models and calibration methods according to actual application specific needs, and a series of achievements are obtained based on different starting points and ideas. At present, academic research ideas in the field of camera calibration are very active, and new technical and new methods are emerging.
There are many researches on calibration of cameras, which are mainly classified into three types, namely a traditional camera calibration method, a self-calibration method and a camera calibration method based on active vision. The most widely used camera calibration methods are the Tsai method and the zhangnyou method. The method of Tsai relies on accurate 3-D measurements of an external 3-D calibrant that determines a good reference coordinate system. All position and orientation measurements are relative to this reference frame. This approach has been widely used in multi-camera systems. The sheet method uses a planar calibration object. The advantage of this method is that planar calibrators are easier to construct than 3-D calibrators, and the extrinsic (camera-to-world or camera-to-camera geometry) and intrinsic (intrinsic) parameters of the camera can be calibrated in the same system. Similar methods are also proposed by Sturm and Maybank, and the singularity of the calibration result is discussed. Brown proposed an 8-parameter model to compensate for lens distortion, and later researchers developed 10-parameter models and multi-parameter models. The models used by Zhangyippe and Tsai are simpler parametric models. 2001. Luhmann and Hastedt et al proposed a finite element-based mixed distortion model in 2002. In 2004 von willebrand professor et al proposed a digital distortion model based on two-dimensional direct linear transformation.
The camera calibration technology is not only researched by foreign researchers, but also the researchers in China pay great attention to and pay extensive attention to the camera calibration technology. In recent years, masonde et al, the institute of automation of the academy of sciences in china, has marked insights into camera calibration technology, and represents the research level of the camera calibration technology in our country. Although the international application field has no influence, the method shows that the talents and technical conditions for developing the research of the camera calibration field are provided in China, and plays a model role in promoting the research and application of the camera calibration technology. In addition, many key laboratories in China also make extensive research on camera calibration, such as the intelligent technology and system state key laboratory of the Qinghua university, the pattern recognition state key laboratory of the Chinese academy of sciences, and the precision testing technology and instrument state key laboratory of the Tianjin university.
How to improve the precision and efficiency of system calibration has been a hot spot and a difficult point studied by many scholars. Although a number of researchers have proposed different camera calibration methods. However, most of the distortion models adopted by the existing camera calibration methods are relatively simple distortion models, and some scholars directly adopt linear models without considering distortion at all, and few people use relatively complex distortion models to calibrate the camera.
Disclosure of Invention
The invention aims to solve the problem of camera calibration of a high-precision solder paste measuring system close to physical reality conditions, and provides a high-precision camera calibration method based on a mixed distortion model, which adopts the following technical scheme:
a high-precision camera calibration method based on a mixed distortion model comprises the following steps:
s1, establishing a camera distortion model;
s2, selecting a calibration pattern, extracting calibration characteristics and automatically numbering characteristic points;
and S3, calibrating the camera.
Further, the establishing of the camera distortion model comprises
1) Pinhole imaging model: four are established in the modelA base coordinate system comprising: world coordinate system OwXwYwZwCamera coordinate system OcXcYcZcImage coordinate system xy, pixel coordinate system uv, camera coordinate system (X)c,Yc,Zc) With the optical center O of the camera lenscIs the origin of coordinates, Xc,YcThe axis being parallel to the image plane, ZcThe axis is perpendicular to the image plane, and the coordinate of the intersection point on the image plane on the image coordinate system is (u)0,v0) The distance between the optical center of the camera lens and the principal point of the camera is the focal length f;
based on the coordinate system, a point P (X) in space can be obtainedw,Yw,Zw) Can be expressed in the camera coordinate system as:
whereinIs a 3 × 3 orthogonal rotation matrix,is a 3 × 1 translation matrix;
obtaining camera coordinates (X) based on pinhole imaging modelc,Yc,Zc,1)TCan be expressed as:
wherein, (u, v,1)TAs image pixel coordinates, px,ρyThe number of pixels in the x, y directions in the image plane, respectively, (u)0,v0) Is the coordinate of the principal point of the camera, which is the pixel coordinate of the center of the image plane, α is the drawingA skew factor of the pixel coordinate axis vertical error;
obtaining a relational expression of the image coordinates and the world coordinates according to the two expressions:
wherein,as a camera intrinsic parameter matrix, E ═ R T]Is an external parameter matrix;
2) constructing a camera distortion model: a mixed distortion model based on a rectangular finite element method is used, and is described as follows:
wherein dx and dy are the deviation of the x coordinate and the y coordinate of the image point respectively;
wherein,xi,yirespectively, the ideal distortion-free image plane coordinate, K, conforming to the pinhole imagingc1,Kc2,Kc3Third order radial distortion coefficients;
wherein, Pc1,Pc2Is a second order tangential distortion coefficient;
wherein S isc1,Sc2Second order thin prism distortion coefficients;
wherein, x and y are the length ratio of the image point in the x and y directions of the rectangular grid respectively.
Further, in the step S2, the calibration pattern is selected, the calibration board is an aluminum calibration board, the camera is calibrated by using the aluminum calibration board, the calibration board has 9 × 11 circular calibration points, wherein the small circle has a diameter of 4mm, the large circle has a diameter of 8mm, and five large circles are used for identifying the direction of the calibration board in the calibration process.
Further, the calibration feature extraction comprises the following steps: image acquisition, image graying, image filtering, image binarization, contour extraction, pseudo point filtering, ellipse fitting and circle center extraction;
the method comprises the steps of directly reading a color image into a gray image by using a function in an OpenCV function library, filtering the obtained gray image, realizing image filtering by using a cvSmooth function, setting a threshold value as 100 through experiments in image binarization, and extracting a contour by using an iteration-based improved Harris corner detection method, wherein the method is described as follows: considering any point p in the neighborhood of the corner q, # i (p) represents the image gradient vector at point p, then the gradient property yields:
▽I(p)(q-p)=0
considering all the p points in the corner q neighborhood, an overdetermined equation set is formed, and therefore the Minimum Mean Square Error (MMSE) criterion is utilized for solving;
after extracting the contour, eliminating the pseudo feature points by using the following rule:
area criterion: and (3) determining the range of the area of the extracted feature object according to the system configuration:
Smin<S<Smax
roundness criterion: the proximity of the shape to the circle is measured by:
wherein T is the circumference of the circle,
error criteria: taking the algebraic distance from the edge contour points to the fitting ellipse as an error, and further filtering out circular feature points with larger errors by adopting the following criteria:
whereinThe average error of the contour points is represented,maxwhich is indicative of the maximum allowable error,meanindicating an allowable average error;
further, after eliminating the pseudo characteristic points, performing contour ellipse fitting by adopting a weighted least square method to extract circle center coordinates of sub-pixel level precision.
The feature points are automatically numbered in step S2: utilizing 5 solid circles on the calibration plate, wherein each solid circle corresponds to a determined invariable number, and carrying out the following steps:
(1) selecting four corner points corresponding to a certain rectangular area in space on an image by using a mouse, acquiring image coordinates of the four corner points and performing sub-pixel processing;
(2) and automatically counting the circles of the selected area, and generating a grid map according to the counting result.
The camera calibration method comprises the following steps:
1) homography matrix solving
Assuming that the template is located at the position of the world coordinate system Z being 0, obtaining the template through a pinhole model
sm=HM
Where s is a scale factor, M and M are points on the image plane and the corresponding template, respectively, and H is Kc[R T];
Based on the space coordinates of each corner point of the plane template, the estimated value of H is obtained by solving the following MMSE estimation,
wherein, is the ith row vector of the H matrix;
solving by adopting an improved Leverberg-Marquardt method, solving by using a nonlinear optimization method requires a proper initial value for iteration, and obtaining by solving the following equation:
given n > 6 points, forming an over-determined equation set, and solving through Singular Value Decomposition (SVD);
2) solution of internal and external parameters
Based on the property that the internal parameter matrix R is an orthogonal matrix, the internal and external parameters of the camera are obtained by solving the following over-determined equation set:
Vb=0
the equation set is the superposition of the following equations obtained by observing n is more than or equal to 3 times:
in the formula vij=[h1ih1j,h1ih2j+h2ih1j,h2ih2j,h3ih1j+h1ih3j,h3ih2j+h2ih3j,h3ih3j]T,b=[B11,B12,B22,B13,B23,B33]T,
Then, the solution is refined through maximum likelihood estimation to obtain a better optimized solution, and the likelihood estimation problem is expressed as follows:
in the formula, mijThe j image point on the ith image is taken;as a spatial point MjA projection point of the ith image;
3) solving distortion parameters;
4) solving distortion parameters of the finite element model;
5) the LM algorithm is improved.
Has the advantages that:
the invention provides a camera calibration method based on a mixed distortion model, aiming at the problem that the distortion model adopted by the existing calibration algorithm is simpler, so that high-precision calibration cannot be realized. The method comprises the steps of firstly establishing an imaging model based on pinhole imaging, and then establishing a mixed distortion model aiming at three kinds of distortion and plane unequal physical errors. In order to calibrate the internal and external parameters and distortion parameters of the camera, the invention determines a calibration template capable of realizing automatic positioning, and then realizes the sub-pixel positioning of the mark points based on the template. Under the condition of obtaining the accurate positioning of the mark points, the initial solution of the homography matrix is obtained by solving the over-determined equation set, and then the high-efficiency optimization is carried out by utilizing the improved LM method; based on the homography matrix, internal and external parameters of the camera can be obtained, and further optimization can be realized by utilizing maximum likelihood estimation; after the internal and external parameters are obtained, three distortion parameters and finite element distortion parameters of the camera can be respectively obtained by solving an over-determined equation and then further optimizing by using an improved LM method. Compared with the traditional calibration method, the method comprehensively considers various distortions, filters the pseudo characteristic points based on the proposed criterion, realizes the automatic positioning of the mark points based on the proposed automatic circle center numbering method, and optimizes based on the improved LM algorithm in the process of solving the calibration parameters, thereby obviously accelerating the convergence speed and improving the calibration precision. Based on the above discussion, the method provided by the invention can provide a solid theoretical and implementation basis for high-precision camera calibration in engineering applications such as machine vision, three-dimensional measurement and the like.
Drawings
FIG. 1 is a flow chart of an implementation of the present invention;
FIG. 2 is a schematic diagram of pinhole imaging;
FIG. 3 is a calibration pattern employed in the present invention;
FIG. 4 is a flow chart of feature point extraction;
FIG. 5 is a calibration image taken according to the present invention;
FIG. 6 is a flow chart of edge detection;
FIG. 7 is a plot of marker point numbers;
FIG. 8 is a result of automatic feature point numbering;
FIG. 9 is a graph of camera calibration error distribution.
Detailed Description
Example 1:
a high-precision camera calibration method based on a mixed distortion model comprises the steps of firstly solving an overdetermined equation set to obtain an initial solution of a homography matrix, and then carrying out efficient optimization by using the proposed improved LM method; based on the homography matrix, internal and external parameters of the camera can be obtained, and further optimization can be realized by utilizing maximum likelihood estimation; after the internal and external parameters are obtained, three distortion parameters and finite element distortion parameters of the camera can be respectively obtained by solving an over-determined equation and then further optimizing by using an improved LM method. Therefore, accurate estimation of the mixed distortion parameters of the camera is obtained, and high-precision calibration of the camera is further realized.
The basic idea for realizing the method is to establish an imaging model based on pinhole imaging, and then establish a mixed distortion model aiming at three kinds of distortion and plane unequal physical errors. In order to calibrate the internal and external parameters and distortion parameters of the camera, the invention determines a calibration template capable of realizing automatic positioning, and then realizes the sub-pixel positioning of the mark points based on the template. Under the condition of obtaining the accurate positioning of the mark points, the initial solution of the homography matrix is obtained by solving the over-determined equation set, and then the high-efficiency optimization is carried out by utilizing the improved LM method; based on the homography matrix, internal and external parameters of the camera can be obtained, and further optimization can be realized by utilizing maximum likelihood estimation; after the internal and external parameters are obtained, three distortion parameters and finite element distortion parameters of the camera can be respectively obtained by solving an over-determined equation and then further optimizing by using an improved LM method. Compared with the traditional calibration method, the method comprehensively considers various distortions, filters the pseudo characteristic points based on the proposed criterion, realizes the automatic positioning of the mark points based on the proposed automatic circle center numbering method, and optimizes based on the improved LM algorithm in the process of solving the calibration parameters, thereby obviously accelerating the convergence speed and improving the calibration precision. The method comprises the following specific steps:
1. establishing a camera distortion model
1) Constructing pinhole imaging models
The camera model is a simplification of the optical imaging geometry, and many camera imaging geometry models are obtained according to the pinhole imaging principle. The pinhole imaging model becomes the simplest camera model due to the simpler principle of pinhole imaging, and is the basic model of the camera calibration algorithm. If the distortion factor of the lens is properly considered, the precision required by many application occasions can be met. The pinhole model in the ideal situation shown in fig. 2 is adopted in the patent, and the imaging process can be reflected more accurately by considering the influence of lens distortion on the basis. World coordinate system (X)w,Yw,Zw) The reference coordinate system is selected in the environment and used for describing the position of the camera, and the reference coordinate system can be selected according to the principles of convenience in description and calculation and the like. Four basic coordinate systems are established in the model, including: world coordinate system OwXwYwZwCamera coordinate system OcXcYcZcImage coordinate system xy, pixel coordinate system uv. The imaging process from the three-dimensional coordinates of the object points in space to the image is the process of the step-by-step transformation of these several coordinate systems. Camera coordinate system (X)c,Yc,Zc) With the optical center O of the camera lenscIs the origin of coordinates, Xc,YcThe axis is parallel to the image plane,Zcthe axis is perpendicular to the image plane, and the coordinate of the intersection point on the image plane on the image coordinate system is (u)0,v0) I.e. the main point of the camera. It should be noted that this point is generally located at the center of the image plane, but sometimes deviates due to the manufacturing of the camera, so the camera principal point coordinates are also generally two parameters that need to be calibrated. The distance between the optical center of the camera lens and the principal point is the focal length f.
Based on the coordinate system, a point P (X) in space can be obtainedw,Yw,Zw) Can be expressed in the camera coordinate system as:
whereinIs a 3 × 3 orthogonal rotation matrix,is a 3 × 1 translation matrix.
Camera coordinates (X) can be obtained based on camera pinhole imaging modelc,Yc,Zc,1)TCan be expressed as:
wherein, (u, v,1)TAs image pixel coordinates, px,ρyThe number of pixels in the x, y directions in the image plane, respectively, (u)0,v0) For the camera principal point coordinates, i.e., the pixel coordinates of the center of the image plane, α is a skew factor that describes the vertical error of the pixel coordinate axes.
From the above two formulas, the relational expression of the image coordinate and the world coordinate can be obtained,
wherein,as a camera intrinsic parameter matrix, E ═ R T]Is an extrinsic parameter matrix.
2) Camera distortion model
The last part of camera models are linear models without considering lens distortion, but due to the influence of factors such as lens design, manufacture and assembly, an actual imaging system cannot strictly meet the pinhole imaging principle, and light rays are slightly deviated due to distortion. And a large number of experiments show that the camera pinhole model given in the previous section cannot accurately describe the imaging geometric relationship of the camera, and particularly, when a wide-angle lens is used, an image point far away from the center of the image in the image has great distortion. The nonlinear optical distortion of the camera lens mainly includes three types: radial Distortion, eccentric Distortion, and thin prism Distortion. Wherein the radial distortion causes the image point to move radially inward or outward along the principal point of the image, the tangential distortion causes the image point to move tangentially, and the eccentric distortion and the thin prism distortion cause distortion at both the radial position and the tangential position.
The parametric model has very accurate description on radial distortion, tangential distortion and thin prism distortion, has few unknown parameters, is relatively simple to solve, and cannot describe distortion caused by factors such as uneven image plane. Finite element models can describe various distortions, but the unknown parameters to be considered are many, and the solution is relatively difficult. The finite element model integrates the advantages of the two models, can accurately solve three large distortions which have large influence on the distortion, and can also compensate the distortions such as an image plane and the like. Thus, the present invention employs a hybrid distortion model based on a rectangular finite element method, which can be described as follows:
wherein dx and dy are the deviation of the x coordinate and the y coordinate of the image point respectively;
wherein,xi,yirespectively, the ideal distortion-free image plane coordinate, K, conforming to the pinhole imagingc1,Kc2,Kc3Third order radial distortion coefficients;
wherein, Pc1,Pc2Is a second order tangential distortion coefficient;
wherein S isc1,Sc2Second order thin prism distortion coefficients;
wherein, x and y are the length ratio of the image point in the x and y directions of the rectangular grid respectively.
2. Calibration pattern selection, calibration feature extraction and feature point automatic numbering
1) Calibration pattern selection
In general, the design of a two-dimensional planar calibration object should satisfy the following basic requirements: firstly, the image characteristics of the calibration object should be easy to identify, that is, the mark points on the image should have sharp differences between the color and the background and should be as clear and uniform as possible; secondly, the mark points on the calibration object need to be easy to extract when the image is processed, and a high-quality contour can be provided; thirdly, the calibration object should have high stability, i.e. its mark point should not generate large-scale distortion with the change of the camera position, and it should be easy to measure; fourthly, to realize automatic calibration, the designed mark points are easy to realize automatic coding.
Based on the above requirements, this patent adopts the aluminium system high accuracy calibration board that fig. 3 shows to carry out parameter calibration to the camera, has 9X 11 circular calibration points on the calibration board, and wherein the small circle diameter is 4mm, and the major circle diameter is 8mm, and five great circles are used for marking the calibration board direction in the calibration process to can realize demarcating the automation.
2) Calibration feature extraction
To accurately extract the coordinates of the center of circle in the calibration plate image, image processing techniques are indispensable. The structural block diagram of the circle center extraction process is shown in fig. 4. The method mainly comprises the following steps: the method comprises the steps of image acquisition, image graying, image filtering, image binarization, contour extraction, pseudo point filtering, ellipse fitting and circle center extraction.
This patent utilizes the camera to fix a plate at different positions and angle acquisition 12 images, as shown in fig. 5.
This patent utilizes the function in the OpenCV function library directly to become the grey image with the color image read-in, carries out the filtering to the grey image that obtains immediately, and function cvSmooth can effectual realization image filtering. In image binarization, the threshold value can be set to 100 through experiments.
The contour extraction can adopt an iteration-based improved Harris corner detection method proposed by the patent, and the method can be described as follows: considering any point p in the neighborhood of the corner q, # I (p) represents the gradient vector of the image at point p, the gradient property can be derived
▽I(p)(q-p)=0
Considering all p points in the neighborhood of the corner point q, an overdetermined system of equations can be formed, so that the solution can be performed by using Minimum Mean Square Error (MMSE) criterion.
Let q bek=[xk,yk]TFor the initial estimation of points for the corner points, then
Solving the optimization problem, the method can be obtained
qk+1=F-1W
Wherein, x, Y are first order gray gradients, wu,vAre gaussian filter coefficients.
By repeating the iteration, q can be updatedk+1Up to | qk+1-qkI is no longer reduced. The above-mentioned edge detection method is shown in the flowchart of fig. 6.
After extracting the contour, the pseudo feature points can be eliminated by the following rules:
1. criterion of area
Since the imaging size is only related to the resolution of the camera and the measured distance, the area from which the feature objects are extracted can also be range-determined according to the system configuration, i.e. the imaging size is determined by the system configuration
Smin<S<Smax
2. Criterion of roundness
The proximity of a shape to a circle can be measured by:
where T is the circumference and a larger C indicates a greater difference in shape from a circle. The roundness criterion of the patent is
3. Error criterion
The algebraic distance from the edge contour points to the fitting ellipse is used as an error, and the circular feature points with larger errors are further filtered by adopting the following criteria.
WhereinThe average error of the contour points is represented,maxwhich is indicative of the maximum allowable error,meanindicating the allowable average error. This patent sets up the error correlation value as follows:max=0.6pixel,mean=0.3pixel。
after the pseudo characteristic points are eliminated, the invention adopts a weighted least square method to carry out contour ellipse fitting, thereby extracting the circle center coordinates of sub-pixel level precision.
3) Automatic numbering of feature points
The operation of the front part has extracted the coordinates of the center of the ellipse of interest, but cannot correspond the coordinates of the center of the ellipse to the coordinates of the center of the circle of the circular mark point on the calibration plate. To realize camera calibration, it is necessary to correspond the corresponding ellipse center coordinates to the mark point circle center, and the automatic numbering of the circular mark points is the key point for realizing the automatic calibration of the camera.
In order to realize automatic numbering of the circular mark points, 5 large solid circles on the calibration plate can be utilized, the numbers of all solid circles in the calibration plate are shown in fig. 7, and each solid circle corresponds to a certain invariable number.
To realize correct automatic numbering of all circular mark points, the following steps are required:
(3) selecting four corner points corresponding to a certain rectangular area in space on an image by using a mouse, acquiring image coordinates of the four corner points and performing sub-pixel processing. To make more use of the image information, the area should be as large as possible to contain more control points. Assuming that the homogeneous coordinates of the points on the spatial plane template corresponding to the four points are (0,0,1), (1,0,1), (1,1,1), (0,1,1), this is actually a coordinate transformation of the points on the spatial plane template. This step simultaneously establishes the world coordinate system. The method for establishing the world coordinate system is that the selected first angular point is used as the origin of the world coordinate system, the Z axis is perpendicular to the plane of the square grids and points to the outside of the plane template, and after the Z axis is determined, the X axis and the Y axis are determined by taking the right-hand system as a standard.
(4) And automatically counting the circles of the selected area, and generating a grid map according to the counting result. The automatic counting method comprises the following steps: a) positioning a great circle: 1. extracting 5 great circles: firstly, screening outline information, only retaining ellipse information, then calculating the area and the perimeter of an ellipse according to ellipse parameters obtained by ellipse fitting, and selecting 5 with the largest areas. 2. The distance of the 5 great circles from each other is calculated. 3. Grouping the great circles: the nearest is group A26, 27, the farthest is group B46, 52, and the rest is group 71. 4. The great circle is numbered: the sum of the distances between the centers of two circles in the group B and the group A is calculated, wherein the larger is No. 52, the other is No. 46, and the larger is No. 27 and the other is No. 26 in the same way. b) Positioning the small circle: on the basis of the positioning of the big circle, the positioning of the small circle can be carried out. 1. Defining an area: the actual coordinates of the centers of the 27 # and 71 # and 46 # and 52 # great circles are obtained, so that the two straight-line tracks can be calculated and then expanded up and down along the tracks to form local images (the up and down expansion is 3 pixels larger than that of the great circles). 2. Calculating a gray curve: and calculating the sum of the gray levels of each pixel point in the area. 3. Noise filtering: filtering may be performed to prevent jitter at zero crossings of the curve. 3. According to the prior knowledge of the small circle radius, the system configuration and the like, the automatic numbering of the small circle can be realized by combining the gray curve. The numbering result is shown in fig. 8, in which the cross symbols indicate the coordinates of the center of the ellipse.
3. Camera calibration
Because what this patent adopted is mixed distortion model, therefore the distortion of camera mainly includes two parts: various distortions described by using parameters and unequal distortions of an image plane described by using a finite element model. As the parameter model can accurately describe radial distortion, tangential distortion and thin prism distortion, and the finite element model describes the distortion of each image point in the x and y directions caused by the factors of image plane inequality and the like, the calibration process can be divided into the general solution of the parameter model and the solution of the finite element model.
1) Homography matrix solving
Assuming that the template is located at the position where the world coordinate system Z is 0, the pinhole model can be used to obtain the template
sm=HM
Where s is a scale factor, M and M are points on the image plane and the corresponding template, respectively, and H is Kc[R T]。
Based on the spatial coordinates of each corner point of the plane template, the estimated value of H can be obtained by solving the following MMSE estimation, namely
Wherein, is the ith row vector of the H matrix.
The problem is a nonlinear least squares problem and can be solved by various nonlinear optimization methods such as a gradient method, a gauss-newton method or a Leverberg-Marquardt method. The improved Leverberg-Marquardt solution proposed by this patent (see details 5)) solution by non-linear optimization requires a suitable initial value for iteration, which can be obtained by solving the following equation:
given n > 6 pairs of points, an overdetermined system of equations may be formed, which may then be solved by Singular Value Decomposition (SVD).
2) Solution of internal and external parameters
Based on the property that the internal parameter matrix R is an orthogonal matrix, the internal and external parameters of the camera can be obtained by solving the following over-determined equation set:
Vb=0
the equation set is the superposition of the following equations obtained by observing n is more than or equal to 3 times:
in the formula vij=[h1ih1j,h1ih2j+h2ih1j,h2ih2j,h3ih1j+h1ih3j,h3ih2j+h2ih3j,h3ih3j]T,b=[B11,B12,B22,B13,B23,B33]T,
This solution can then be refined by maximum likelihood estimation to get a better optimized solution, and the likelihood estimation problem can be expressed as follows:
in the formula, mijThe j image point on the ith image is taken;as a spatial point MjAt the projection point of the ith image.
3) Solution of distortion parameters
From the above distortion model, we can obtain:
in the formula (x)r,yr) As actual image plane coordinates, (x)i,yi) Is ideal distortion-free image plane coordinates.
In addition, as is known in the art,
in the formula (u)r,vr) As actual image coordinates, (u)i,vi) Ideal undistorted image coordinates.
If each image has m marker points and n images are collected, based on the above two equations, the following overdetermined system of equations can be obtained:
GC=D
wherein,
the vector C can be found by means of the least squares method (LS):
C=(GTG)-1GTD
after the initial solution is obtained, the initial solution can be further optimized by a nonlinear method, so that an accurate solution of the distortion parameter can be obtained.
4) Finite element model distortion parameter solution
According to the finite element-based distortion model, an overdetermined equation set can be obtained by using the obtained data, so that an initial solution of the finite element model distortion parameters can be obtained by using an LS method, and then nonlinear optimization is performed by using an improved Levenberg-Marquardt algorithm.
5) Improved LM algorithm
There are three types of nonlinear least squares methods commonly used today: steepest descent method, gauss-newton method and LM method. In the LM method, an iteration increment formula is as follows:
Δθ=(JTJ+μI)-1JT i
where μ is the damping factor, J is the partial derivative matrix,ito estimate the error. Wherein, the value of mu greatly determines the convergence rate of the LM method and the accuracy of the solution. However, in practical applications, the optimal value of μ cannot be determined. To improveThe invention provides an improved factor which can change along with the change of iteration times, so that an initial value can be widened in the initial iteration period, the convergence speed can be increased in the later period, the LM algorithm has the steepest descent method in the initial iteration period and has the advantages of a Gaussian-Newton method near an optimal solution, and the descent factor is as follows:
1-(1-μ)i+1
the incremental iterative formula can thus be re-expressed as:
Δθ=(JTJ+(1-(1-μ)i+1)I)-1JT i
example 2:
a high-precision camera calibration method based on a mixed distortion model comprises the following steps: comprises that
1. Establishing a camera distortion model
1) Constructing pinhole imaging models
The camera model is a simplification of the optical imaging geometry, and many camera imaging geometry models are obtained according to the pinhole imaging principle. The pinhole imaging model becomes the simplest camera model due to the simpler principle of pinhole imaging, and is the basic model of the camera calibration algorithm. If the distortion factor of the lens is properly considered, the precision required by many application occasions can be met. The pinhole model in the ideal situation shown in fig. 2 is adopted in the patent, and the imaging process can be reflected more accurately by considering the influence of lens distortion on the basis. World coordinate system (X)w,Yw,Zw) The reference coordinate system is selected in the environment and used for describing the position of the camera, and the reference coordinate system can be selected according to the principles of convenience in description and calculation and the like. Four basic coordinate systems are established in the model, including: world coordinate system OwXwYwZwCamera coordinate system OcXcYcZcImage coordinate system xy, pixel coordinate system uv. The imaging process from the three-dimensional coordinates of the object points in space to the image is the process of the step-by-step transformation of these several coordinate systems. Camera coordinate system (X)c,Yc,Zc) With the optical center O of the camera lenscIs the origin of coordinates, Xc,YcThe axis being parallel to the image plane, ZcThe axis is perpendicular to the image plane, and the coordinate of the intersection point on the image plane on the image coordinate system is (u)0,v0) I.e. the main point of the camera. It should be noted that this point is generally located at the center of the image plane, but sometimes deviates due to the manufacturing of the camera, so the camera principal point coordinates are also generally two parameters that need to be calibrated. The distance between the optical center of the camera lens and the principal point is the focal length f.
Based on the coordinate system, a point P (X) in space can be obtainedw,Yw,Zw) Can be expressed in the camera coordinate system as:
whereinIs a 3 × 3 orthogonal rotation matrix,is a 3 × 1 translation matrix.
Camera coordinates (X) can be obtained based on camera pinhole imaging modelc,Yc,Zc,1)TCan be expressed as:
wherein, (u, v,1)TAs image pixel coordinates, px,ρyThe number of pixels in the x, y directions in the image plane, respectively, (u)0,v0) For the camera principal point coordinates, i.e., the pixel coordinates of the center of the image plane, α is a skew factor that describes the vertical error of the pixel coordinate axes.
From the above two formulas, the relational expression of the image coordinate and the world coordinate can be obtained,
wherein,as a camera intrinsic parameter matrix, E ═ R T]Is an extrinsic parameter matrix.
2) Camera distortion model
The last part of camera models are linear models without considering lens distortion, but due to the influence of factors such as lens design, manufacture and assembly, an actual imaging system cannot strictly meet the pinhole imaging principle, and light rays are slightly deviated due to distortion. And a large number of experiments show that the camera pinhole model given in the previous section cannot accurately describe the imaging geometric relationship of the camera, and particularly, when a wide-angle lens is used, an image point far away from the center of the image in the image has great distortion. The nonlinear optical distortion of the camera lens mainly includes three types: radial Distortion (Radial Distortion), eccentric Distortion (Decentering Distortion), and thin Prism Distortion (Prism Distortion). Wherein the radial distortion causes the image point to move radially inward or outward along the principal point of the image, the tangential distortion causes the image point to move tangentially, and the eccentric distortion and the thin prism distortion cause distortion at both the radial position and the tangential position.
The parametric model has very accurate description on radial distortion, tangential distortion and thin prism distortion, has few unknown parameters, is relatively simple to solve, and cannot describe distortion caused by factors such as uneven image plane. Finite element models can describe various distortions, but the unknown parameters to be considered are many, and the solution is relatively difficult. The finite element model integrates the advantages of the two models, can accurately solve three large distortions which have large influence on the distortion, and can also compensate the distortions such as an image plane and the like. Thus, the present invention employs a hybrid distortion model based on a rectangular finite element method, which can be described as follows:
wherein dx and dy are the deviation of the x coordinate and the y coordinate of the image point respectively;
wherein,xi,yirespectively, the ideal distortion-free image plane coordinate, K, conforming to the pinhole imagingc1,Kc2,Kc3Third order radial distortion coefficients;
wherein, Pc1,Pc2Is a second order tangential distortion coefficient;
wherein S isc1,Sc2Second order thin prism distortion coefficients;
wherein, x and y are the length ratio of the image point in the x and y directions of the rectangular grid respectively.
2. Calibration pattern selection, calibration feature extraction and feature point automatic numbering
1) Calibration pattern selection
In general, the design of a two-dimensional planar calibration object should satisfy the following basic requirements: firstly, the image characteristics of the calibration object should be easy to identify, that is, the mark points on the image should have sharp differences between the color and the background and should be as clear and uniform as possible; secondly, the mark points on the calibration object need to be easy to extract when the image is processed, and a high-quality contour can be provided; thirdly, the calibration object should have high stability, i.e. its mark point should not generate large-scale distortion with the change of the camera position, and it should be easy to measure; fourthly, to realize automatic calibration, the designed mark points are easy to realize automatic coding.
Based on the above requirements, this patent adopts the aluminium system high accuracy calibration board that fig. 3 shows to carry out parameter calibration to the camera, has 9X 11 circular calibration points on the calibration board, and wherein the small circle diameter is 4mm, and the major circle diameter is 8mm, and five great circles are used for marking the calibration board direction in the calibration process to can realize demarcating the automation.
2) Calibration feature extraction
To accurately extract the coordinates of the center of circle in the calibration plate image, image processing techniques are indispensable. The structural block diagram of the circle center extraction process is shown in fig. 4. The method mainly comprises the following steps: the method comprises the steps of image acquisition, image graying, image filtering, image binarization, contour extraction, pseudo point filtering, ellipse fitting and circle center extraction.
This patent utilizes the camera to fix a plate at different positions and angle acquisition 12 images, as shown in fig. 5.
This patent utilizes the function in the OpenCV function library directly to become the grey image with the color image read-in, carries out the filtering to the grey image that obtains immediately, and function cvSmooth can effectual realization image filtering. In image binarization, the threshold value can be set to 100 through experiments.
The contour extraction can adopt an iteration-based improved Harris corner detection method proposed by the patent, and the method can be described as follows: considering any point p in the neighborhood of the corner q, # I (p) represents the gradient vector of the image at point p, the gradient property can be derived
▽I(p)(q-p)=0
Considering all p points in the neighborhood of the corner point q, an overdetermined system of equations can be formed, so that the solution can be performed by using Minimum Mean Square Error (MMSE) criterion.
Let q bek=[xk,yk]TFor the initial estimation of points for the corner points, then
Solving the optimization problem, the method can be obtained
qk+1=F-1W
Wherein, x, Y are first order gray gradients, wu,vAre gaussian filter coefficients.
By repeating the iteration, q can be updatedk+1Up to | qk+1-qkI is no longer reduced. The above-mentioned edge detection method is shown in the flowchart of fig. 6.
After extracting the contour, the pseudo feature points can be eliminated by the following rules:
4. criterion of area
Since the imaging size is only related to the resolution of the camera and the measured distance, the area from which the feature objects are extracted can also be range-determined according to the system configuration, i.e. the imaging size is determined by the system configuration
Smin<S<Smax
5. Criterion of roundness
The proximity of a shape to a circle can be measured by:
where T is the circumference and a larger C indicates a greater difference in shape from a circle. The roundness criterion of the patent is
6. Error criterion
The algebraic distance from the edge contour points to the fitting ellipse is used as an error, and the circular feature points with larger errors are further filtered by adopting the following criteria.
WhereinThe average error of the contour points is represented,maxwhich is indicative of the maximum allowable error,meanindicating the allowable average error. This patent sets up the error correlation value as follows:max=0.6pixel,mean=0.3pixel。
after the pseudo characteristic points are eliminated, the invention adopts a weighted least square method to carry out contour ellipse fitting, thereby extracting the circle center coordinates of sub-pixel level precision.
3) Automatic numbering of feature points
The operation of the front part has extracted the coordinates of the center of the ellipse of interest, but cannot correspond the coordinates of the center of the ellipse to the coordinates of the center of the circle of the circular mark point on the calibration plate. To realize camera calibration, it is necessary to correspond the corresponding ellipse center coordinates to the mark point circle center, and the automatic numbering of the circular mark points is the key point for realizing the automatic calibration of the camera.
In order to realize automatic numbering of the circular mark points, 5 large solid circles on the calibration plate can be utilized, the numbers of all solid circles in the calibration plate are shown in fig. 7, and each solid circle corresponds to a certain invariable number.
To realize correct automatic numbering of all circular mark points, the following steps are required:
(5) selecting four corner points corresponding to a certain rectangular area in space on an image by using a mouse, acquiring image coordinates of the four corner points and performing sub-pixel processing. To make more use of the image information, the area should be as large as possible to contain more control points. Assuming that the homogeneous coordinates of the points on the spatial plane template corresponding to the four points are (0,0,1), (1,0,1), (1,1,1), (0,1,1), this is actually a coordinate transformation of the points on the spatial plane template. This step simultaneously establishes the world coordinate system. The method for establishing the world coordinate system is that the selected first angular point is used as the origin of the world coordinate system, the Z axis is perpendicular to the plane of the square grids and points to the outside of the plane template, and after the Z axis is determined, the X axis and the Y axis are determined by taking the right-hand system as a standard.
(6) And automatically counting the circles of the selected area, and generating a grid map according to the counting result. The automatic counting method comprises the following steps: a) positioning a great circle: 1. extracting 5 great circles: firstly, screening outline information, only retaining ellipse information, then calculating the area and the perimeter of an ellipse according to ellipse parameters obtained by ellipse fitting, and selecting 5 with the largest areas. 2. The distance of the 5 great circles from each other is calculated. 3. Grouping the great circles: the nearest is group A26, 27, the farthest is group B46, 52, and the rest is group 71. 4. The great circle is numbered: the sum of the distances between the centers of two circles in the group B and the group A is calculated, wherein the larger is No. 52, the other is No. 46, and the larger is No. 27 and the other is No. 26 in the same way. b) Positioning the small circle: on the basis of the positioning of the big circle, the positioning of the small circle can be carried out. 1. Defining an area: the actual coordinates of the centers of the 27 # and 71 # and 46 # and 52 # great circles are obtained, so that the two straight-line tracks can be calculated and then expanded up and down along the tracks to form local images (the up and down expansion is 3 pixels larger than that of the great circles). 2. Calculating a gray curve: and calculating the sum of the gray levels of each pixel point in the area. 3. Noise filtering: filtering may be performed to prevent jitter at zero crossings of the curve. 3. According to the prior knowledge of the small circle radius, the system configuration and the like, the automatic numbering of the small circle can be realized by combining the gray curve. The numbering result is shown in fig. 8, in which the cross symbols indicate the coordinates of the center of the ellipse.
3. Camera calibration
Because what this patent adopted is mixed distortion model, therefore the distortion of camera mainly includes two parts: various distortions described by using parameters and unequal distortions of an image plane described by using a finite element model. As the parameter model can accurately describe radial distortion, tangential distortion and thin prism distortion, and the finite element model describes the distortion of each image point in the x and y directions caused by the factors of image plane inequality and the like, the calibration process can be divided into the general solution of the parameter model and the solution of the finite element model.
1) Homography matrix solving
Assuming that the template is located at the position where the world coordinate system Z is 0, the pinhole model can be used to obtain the template
sm=HM
Where s is a scale factor, M and M are points on the image plane and the corresponding template, respectively, and H is Kc[R T]。
Based on the spatial coordinates of each corner point of the plane template, the estimated value of H can be obtained by solving the following MMSE estimation, namely
Wherein, is the ith row vector of the H matrix.
The problem is a nonlinear least squares problem and can be solved by various nonlinear optimization methods such as a gradient method, a gauss-newton method or a Leverberg-Marquardt method. The improved Leverberg-Marquardt solution proposed by this patent (see details 5)) solution by non-linear optimization requires a suitable initial value for iteration, which can be obtained by solving the following equation:
given n > 6 pairs of points, an overdetermined system of equations may be formed, which may then be solved by Singular Value Decomposition (SVD).
2) Solution of internal and external parameters
Based on the property that the internal parameter matrix R is an orthogonal matrix, the internal and external parameters of the camera can be obtained by solving the following over-determined equation set:
Vb=0
the equation set is the superposition of the following equations obtained by observing n is more than or equal to 3 times:
in the formula vij=[h1ih1j,h1ih2j+h2ih1j,h2ih2j,h3ih1j+h1ih3j,h3ih2j+h2ih3j,h3ih3j]T,b=[B11,B12,B22,B13,B23,B33]T,
This solution can then be refined by maximum likelihood estimation to get a better optimized solution, and the likelihood estimation problem can be expressed as follows:
in the formula, mijThe j image point on the ith image is taken;as a spatial point MjAt the projection point of the ith image.
3) Solution of distortion parameters
From the above distortion model, we can obtain:
in the formula (x)r,yr) As actual image plane coordinates, (x)i,yi) Is ideal distortion-free image plane coordinates.
In addition, as is known in the art,
in the formula (u)r,vr) As actual image coordinates, (u)i,vi) Ideal undistorted image coordinates.
If each image has m marker points and n images are collected, based on the above two equations, the following overdetermined system of equations can be obtained:
GC=D
wherein,
C=[Kc1,Kc2,Kc3,Pc1,Pc2,Sc1,Sc2]T,D=[d1d2…dmn]T。
the vector C can be found by means of the least squares method (LS):
C=(GTG)-1GTD
after the initial solution is obtained, the initial solution can be further optimized by a nonlinear method, so that an accurate solution of the distortion parameter can be obtained.
4) Finite element model distortion parameter solution
According to the finite element-based distortion model, an overdetermined equation set can be obtained by using the obtained data, so that an initial solution of the finite element model distortion parameters can be obtained by using an LS method, and then nonlinear optimization is performed by using an improved Levenberg-Marquardt algorithm.
5) Improved LM algorithm
There are three types of nonlinear least squares methods commonly used today: steepest descent method, gauss-newton method and LM method. In the LM method, an iteration increment formula is as follows:
Δθ=(JTJ+μI)-1JT i
where μ is the damping factor, J is the partial derivative matrix,ito estimate the error. Wherein, the value of mu greatly determines the convergence rate of the LM method and the accuracy of the solution. However, in practical applications, the optimal value of μ cannot be determined. In order to improve the convergence rate and the solving accuracy of the LM algorithm, the invention provides an improvement factor which can change along with the change of iteration times, so that the initial value can be relaxed at the initial stage of the iteration, the convergence rate can be increased at the later stage, and the LM algorithm has the steepest descent method at the initial stage of the iteration and has the advantages of the Gaussian-Newton method near the optimal solution, wherein the descent factor is as follows:
1-(1-μ)i+1
the incremental iterative formula can thus be re-expressed as:
Δθ=(JTJ+(1-(1-μ)i+1)I)-1JT i
the effects of the present invention can be further illustrated by the following simulations:
simulation conditions are as follows:
based on the calibration algorithm, the camera is calibrated by utilizing the acquired images and the extraction and automatic numbering results of the calibration patterns. The resulting calibration results have standard deviations of [0.04356,0.06792] in pixels. The error distribution of the calibration result is shown in fig. 9, and it can be known from the graph that the calibration result is stable and reliable, and the error distribution is uniform.
In summary, the invention provides a camera calibration method based on a mixed distortion model, aiming at the problem that the distortion model adopted by the existing calibration algorithm is simple, so that high-precision calibration cannot be realized. The method comprises the steps of firstly establishing an imaging model based on pinhole imaging, and then establishing a mixed distortion model aiming at three kinds of distortion and plane unequal physical errors. In order to calibrate the internal and external parameters and distortion parameters of the camera, the invention determines a calibration template capable of realizing automatic positioning, and then realizes the sub-pixel positioning of the mark points based on the template. Under the condition of obtaining the accurate positioning of the mark points, the initial solution of the homography matrix is obtained by solving the over-determined equation set, and then the high-efficiency optimization is carried out by utilizing the improved LM method; based on the homography matrix, internal and external parameters of the camera can be obtained, and further optimization can be realized by utilizing maximum likelihood estimation; after the internal and external parameters are obtained, three distortion parameters and finite element distortion parameters of the camera can be respectively obtained by solving an over-determined equation and then further optimizing by using an improved LM method. Compared with the traditional calibration method, the method comprehensively considers various distortions, filters the pseudo characteristic points based on the proposed criterion, realizes the automatic positioning of the mark points based on the proposed automatic circle center numbering method, and optimizes based on the improved LM algorithm in the process of solving the calibration parameters, thereby obviously accelerating the convergence speed and improving the calibration precision. Based on the above discussion, the method provided by the invention can provide a solid theoretical and implementation basis for high-precision camera calibration in engineering applications such as machine vision, three-dimensional measurement and the like.
The above description is only for the purpose of creating a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can substitute or change the technical solution and the inventive concept of the present invention within the technical scope of the present invention.
Claims (6)
1. A high-precision camera calibration method based on a mixed distortion model comprises the following steps:
s1, establishing a camera distortion model;
s2, selecting a calibration pattern, extracting calibration characteristics and automatically numbering characteristic points;
and S3, calibrating the camera.
2. The method for calibrating a high-precision camera based on a hybrid distortion model as claimed in claim 1, wherein said establishing the distortion model of the camera comprises
1) Pinhole imaging model: four basic coordinate systems are established in the model, including: world coordinate system OwXwYwZwCamera coordinate system OcXcYcZcImage coordinate system xy, pixel coordinate system uv, camera coordinate system (X)c,Yc,Zc) With the optical center O of the camera lenscIs the origin of coordinates, Xc,YcThe axis being parallel to the image plane, ZcThe axis is perpendicular to the image plane, and the coordinate of the intersection point on the image plane on the image coordinate system is (u)0,v0) The distance between the optical center of the camera lens and the principal point of the camera is the focal length f;
based on the coordinate system, a point P (X) in space can be obtainedw,Yw,Zw) Can be expressed in the camera coordinate system as:
whereinIs a 3 × 3 orthogonal rotation matrix,is a 3 × 1 translation matrix;
obtaining camera coordinates (X) based on pinhole imaging modelc,Yc,Zc,1)TCan be expressed as:
wherein, (u, v,1)TAs image pixel coordinates, px,ρyThe number of pixels in the x, y directions in the image plane, respectively, (u)0,v0) Is the camera principal point coordinate, which is the pixel coordinate of the center of the image plane, α is the skew factor describing the vertical error of the pixel coordinate axis;
obtaining a relational expression of the image coordinates and the world coordinates according to the two expressions:
wherein,as a camera intrinsic parameter matrix, E ═ R T]Is an external parameter matrix;
2) constructing a camera distortion model: a mixed distortion model based on a rectangular finite element method is used, and is described as follows:
wherein dx and dy are the deviation of the x coordinate and the y coordinate of the image point respectively;
wherein,xi,yirespectively, the ideal distortion-free image plane coordinate, K, conforming to the pinhole imagingc1,Kc2,Kc3Third order radial distortion coefficients;
wherein, Pc1,Pc2Is a second order tangential distortion coefficient;
wherein S isc1,Sc2Second order thin prism distortion coefficients;
wherein, x and y are the length ratio of the image point in the x and y directions of the rectangular grid respectively.
3. The method for calibrating a high-precision camera based on a hybrid distortion model of claim 1, wherein the calibration pattern in step S2 is selected by using an aluminum calibration plate, and using the aluminum calibration plate to perform parameter calibration on the camera, wherein the calibration plate has 9 × 11 circular calibration points, wherein the small circle has a diameter of 4mm, the large circle has a diameter of 8mm, and five large circles are used to identify the orientation of the calibration plate during the calibration process.
4. The method for calibrating a high-precision camera based on a mixed distortion model as claimed in claim 1, wherein the calibration feature extraction comprises the following steps: image acquisition, image graying, image filtering, image binarization, contour extraction, pseudo point filtering, ellipse fitting and circle center extraction;
the method comprises the steps of directly reading a color image into a gray image by using a function in an OpenCV function library, filtering the obtained gray image, realizing image filtering by using a cvSmooth function, setting a threshold value as 100 through experiments in image binarization, and extracting a contour by using an iteration-based improved Harris corner detection method, wherein the method is described as follows: considering any point p in the neighborhood of the corner q, # i (p) represents the image gradient vector at point p, then the gradient property yields:
▽I(p)(q-p)=0
considering all the p points in the corner q neighborhood, an overdetermined equation set is formed, and therefore the Minimum Mean Square Error (MMSE) criterion is utilized for solving;
after extracting the contour, eliminating the pseudo feature points by using the following rule:
area criterion: and (3) determining the range of the area of the extracted feature object according to the system configuration:
Smin<S<Smax
roundness criterion: the proximity of the shape to the circle is measured by:
wherein T is the circumference of the circle,
error criteria: taking the algebraic distance from the edge contour points to the fitting ellipse as an error, and further filtering out circular feature points with larger errors by adopting the following criteria:
whereinThe average error of the contour points is represented,maxwhich is indicative of the maximum allowable error,meanindicating an allowable average error;
after eliminating the pseudo characteristic points, carrying out contour ellipse fitting by adopting a weighted least square method to extract circle center coordinates with sub-pixel level precision.
5. The method for calibrating a high-precision camera based on a mixed distortion model according to claim 1, wherein the feature points in step S2 are automatically numbered: utilizing 5 solid circles on the calibration plate, wherein each solid circle corresponds to a determined invariable number, and carrying out the following steps:
(1) selecting four corner points corresponding to a certain rectangular area in space on an image by using a mouse, acquiring image coordinates of the four corner points and performing sub-pixel processing;
(2) and automatically counting the circles of the selected area, and generating a grid map according to the counting result.
6. The method for calibrating a high-precision camera based on a mixed distortion model according to claim 2, wherein the method for calibrating the camera is as follows:
1) homography matrix solving
Assuming that the template is located at the position of the world coordinate system Z being 0, obtaining the template through a pinhole model
sm=HM
Where s is a scale factor, M and M are points on the image plane and the corresponding template, respectively, and H is Kc[R T];
Based on the space coordinates of each corner point of the plane template, the estimated value of H is obtained by solving the following MMSE estimation,
wherein, is the ith row vector of the H matrix;
solving by adopting an improved Leverberg-Marquardt method, solving by using a nonlinear optimization method requires a proper initial value for iteration, and obtaining by solving the following equation:
given n > 6 points, forming an over-determined equation set, and solving through Singular Value Decomposition (SVD);
2) solution of internal and external parameters
Based on the property that the internal parameter matrix R is an orthogonal matrix, the internal and external parameters of the camera are obtained by solving the following over-determined equation set:
Vb=0
the equation set is the superposition of the following equations obtained by observing n is more than or equal to 3 times:
in the formula vij=[h1ih1j,h1ih2j+h2ih1j,h2ih2j,h3ih1j+h1ih3j,h3ih2j+h2ih3j,h3ih3j]T,b=[B11,B12,B22,B13,B23,B33]T,
Then, the solution is refined through maximum likelihood estimation to obtain a better optimized solution, and the likelihood estimation problem is expressed as follows:
in the formula, mijThe j image point on the ith image is taken;as a spatial point MjA projection point of the ith image;
3) solving distortion parameters;
4) solving distortion parameters of the finite element model;
5) the LM algorithm is improved.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611210098.9A CN106780628A (en) | 2016-12-24 | 2016-12-24 | High Precision Camera Calibration method based on mixing distortion model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611210098.9A CN106780628A (en) | 2016-12-24 | 2016-12-24 | High Precision Camera Calibration method based on mixing distortion model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106780628A true CN106780628A (en) | 2017-05-31 |
Family
ID=58920462
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611210098.9A Pending CN106780628A (en) | 2016-12-24 | 2016-12-24 | High Precision Camera Calibration method based on mixing distortion model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106780628A (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107133989A (en) * | 2017-06-12 | 2017-09-05 | 中国科学院长春光学精密机械与物理研究所 | A kind of 3 D scanning system parameter calibration method |
CN107204017A (en) * | 2017-06-08 | 2017-09-26 | 爱佩仪中测(成都)精密仪器有限公司 | A kind of single camera scaling method in three-dimensional measurement |
CN107481283A (en) * | 2017-08-01 | 2017-12-15 | 深圳市神州云海智能科技有限公司 | A kind of robot localization method, apparatus and robot based on CCTV camera |
CN108269289A (en) * | 2018-01-16 | 2018-07-10 | 上海汇像信息技术有限公司 | A kind of two step optimization methods of camera parameter calibration |
CN109407547A (en) * | 2018-09-28 | 2019-03-01 | 合肥学院 | Multi-camera in-loop simulation test method and system for panoramic visual perception |
CN110449749A (en) * | 2019-07-19 | 2019-11-15 | 东莞理工学院 | A kind of laser cutting scanning system |
CN110599548A (en) * | 2019-09-02 | 2019-12-20 | Oppo广东移动通信有限公司 | Camera calibration method and device, camera and computer readable storage medium |
CN110751692A (en) * | 2019-09-06 | 2020-02-04 | 深圳为工智能科技有限公司 | Camera imaging error calibration method and correction method |
CN111080711A (en) * | 2019-12-05 | 2020-04-28 | 东南大学 | Method for calibrating microscopic imaging system in approximately parallel state based on magnification |
CN111798521A (en) * | 2019-04-09 | 2020-10-20 | Oppo广东移动通信有限公司 | Calibration method, calibration device, storage medium and electronic equipment |
CN111913572A (en) * | 2020-07-03 | 2020-11-10 | 山东大学 | Man-machine interaction system and method for labor transformation of prisoners |
CN112258583A (en) * | 2020-10-16 | 2021-01-22 | 中国石油大学(华东) | Distortion calibration method for close-range image based on equal distortion partition |
CN112348756A (en) * | 2020-11-04 | 2021-02-09 | 深圳市杰恩世智能科技有限公司 | Image distortion correction method |
CN113084827A (en) * | 2021-04-01 | 2021-07-09 | 北京飞影科技有限公司 | Method and device for calibrating optical center position of camera device |
CN113112550A (en) * | 2020-12-23 | 2021-07-13 | 合肥工业大学 | Coding plane target for calibrating internal and external parameters of camera and coding method thereof |
CN113284189A (en) * | 2021-05-12 | 2021-08-20 | 深圳市格灵精睿视觉有限公司 | Distortion parameter calibration method, device, equipment and storage medium |
CN113436268A (en) * | 2021-06-03 | 2021-09-24 | 山东大学 | Camera calibration method and system based on principal axis parallel quadratic curve characteristics |
CN116277979A (en) * | 2023-05-24 | 2023-06-23 | 南京铖联激光科技有限公司 | Optical machine distortion correction method for DLP printer |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105957116A (en) * | 2016-05-03 | 2016-09-21 | 大连理工大学 | Dynamic coding point designing and decoding method based on frequency |
-
2016
- 2016-12-24 CN CN201611210098.9A patent/CN106780628A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105957116A (en) * | 2016-05-03 | 2016-09-21 | 大连理工大学 | Dynamic coding point designing and decoding method based on frequency |
Non-Patent Citations (3)
Title |
---|
刘海军: "结构光三维形貌与变形测量系统标定研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
王子豪 等: "基于改进LM算法的摄像机标定研究", 《工业控制计算机》 * |
舒娜: "摄像机标定方法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107204017A (en) * | 2017-06-08 | 2017-09-26 | 爱佩仪中测(成都)精密仪器有限公司 | A kind of single camera scaling method in three-dimensional measurement |
CN107133989A (en) * | 2017-06-12 | 2017-09-05 | 中国科学院长春光学精密机械与物理研究所 | A kind of 3 D scanning system parameter calibration method |
CN107481283A (en) * | 2017-08-01 | 2017-12-15 | 深圳市神州云海智能科技有限公司 | A kind of robot localization method, apparatus and robot based on CCTV camera |
CN108269289B (en) * | 2018-01-16 | 2021-08-10 | 上海汇像信息技术有限公司 | Two-step optimization method for calibrating camera parameters |
CN108269289A (en) * | 2018-01-16 | 2018-07-10 | 上海汇像信息技术有限公司 | A kind of two step optimization methods of camera parameter calibration |
CN109407547A (en) * | 2018-09-28 | 2019-03-01 | 合肥学院 | Multi-camera in-loop simulation test method and system for panoramic visual perception |
CN111798521B (en) * | 2019-04-09 | 2023-10-31 | Oppo广东移动通信有限公司 | Calibration method and device, storage medium and electronic equipment |
CN111798521A (en) * | 2019-04-09 | 2020-10-20 | Oppo广东移动通信有限公司 | Calibration method, calibration device, storage medium and electronic equipment |
CN110449749A (en) * | 2019-07-19 | 2019-11-15 | 东莞理工学院 | A kind of laser cutting scanning system |
CN110599548A (en) * | 2019-09-02 | 2019-12-20 | Oppo广东移动通信有限公司 | Camera calibration method and device, camera and computer readable storage medium |
CN110751692B (en) * | 2019-09-06 | 2022-02-18 | 深圳为工智能科技有限公司 | Camera imaging error calibration method and correction method |
CN110751692A (en) * | 2019-09-06 | 2020-02-04 | 深圳为工智能科技有限公司 | Camera imaging error calibration method and correction method |
CN111080711A (en) * | 2019-12-05 | 2020-04-28 | 东南大学 | Method for calibrating microscopic imaging system in approximately parallel state based on magnification |
CN111913572A (en) * | 2020-07-03 | 2020-11-10 | 山东大学 | Man-machine interaction system and method for labor transformation of prisoners |
CN112258583B (en) * | 2020-10-16 | 2022-08-30 | 中国石油大学(华东) | Distortion calibration method for close-range image based on equal distortion partition |
CN112258583A (en) * | 2020-10-16 | 2021-01-22 | 中国石油大学(华东) | Distortion calibration method for close-range image based on equal distortion partition |
CN112348756A (en) * | 2020-11-04 | 2021-02-09 | 深圳市杰恩世智能科技有限公司 | Image distortion correction method |
CN113112550B (en) * | 2020-12-23 | 2022-08-02 | 合肥工业大学 | Coding plane target for calibrating internal and external parameters of camera and coding method thereof |
CN113112550A (en) * | 2020-12-23 | 2021-07-13 | 合肥工业大学 | Coding plane target for calibrating internal and external parameters of camera and coding method thereof |
CN113084827B (en) * | 2021-04-01 | 2022-06-14 | 北京飞影科技有限公司 | Method and device for calibrating optical center position of camera device |
CN113084827A (en) * | 2021-04-01 | 2021-07-09 | 北京飞影科技有限公司 | Method and device for calibrating optical center position of camera device |
CN113284189A (en) * | 2021-05-12 | 2021-08-20 | 深圳市格灵精睿视觉有限公司 | Distortion parameter calibration method, device, equipment and storage medium |
CN113436268A (en) * | 2021-06-03 | 2021-09-24 | 山东大学 | Camera calibration method and system based on principal axis parallel quadratic curve characteristics |
CN116277979A (en) * | 2023-05-24 | 2023-06-23 | 南京铖联激光科技有限公司 | Optical machine distortion correction method for DLP printer |
CN116277979B (en) * | 2023-05-24 | 2023-09-08 | 南京铖联激光科技有限公司 | Optical machine distortion correction method for DLP printer |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106780628A (en) | High Precision Camera Calibration method based on mixing distortion model | |
CN106846411A (en) | High Precision Camera Calibration device based on mixing distortion model | |
CN109598762B (en) | High-precision binocular camera calibration method | |
CN102376089B (en) | Target correction method and system | |
CN101303768B (en) | Method for correcting circle center error of circular index point when translating camera perspective projection | |
CN106599897B (en) | Readings of pointer type meters recognition methods and device based on machine vision | |
CN101311963B (en) | Round mark point center picture projection point position acquiring method for positioning video camera | |
CN110443879B (en) | Perspective error compensation method based on neural network | |
CN105716542B (en) | A kind of three-dimensional data joining method based on flexible characteristic point | |
CN107886547B (en) | Fisheye camera calibration method and system | |
CN108007388A (en) | A kind of turntable angle high precision online measuring method based on machine vision | |
CN109443209A (en) | A kind of line-structured light system calibrating method based on homography matrix | |
CN103353388B (en) | A kind of binocular body formula micro imaging system scaling method of tool camera function and device | |
CN109961485A (en) | A method of target positioning is carried out based on monocular vision | |
CN111707187B (en) | Measuring method and system for large part | |
CN113920205B (en) | Calibration method of non-coaxial camera | |
CN109448043A (en) | Standing tree height extracting method under plane restriction | |
CN100376883C (en) | Pixel frequency based star sensor high accuracy calibration method | |
CN112161586A (en) | Line structured light vision sensor calibration method based on coding checkerboard | |
CN106323286B (en) | A kind of robot coordinate system and the transform method of three-dimensional measurement coordinate system | |
CN112050752B (en) | Projector calibration method based on secondary projection | |
CN109870106A (en) | A kind of building volume measurement method based on unmanned plane picture | |
CN106097319A (en) | A kind of black and white gridiron pattern Angular Point Extracting Method for camera calibration | |
CN115201883A (en) | Moving target video positioning and speed measuring system and method | |
CN116205993A (en) | Double-telecentric lens high-precision calibration method for 3D AOI |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170531 |
|
RJ01 | Rejection of invention patent application after publication |