CN114782553B - Iterative camera calibration method and device based on elliptic dual conic - Google Patents
Iterative camera calibration method and device based on elliptic dual conic Download PDFInfo
- Publication number
- CN114782553B CN114782553B CN202210509591.XA CN202210509591A CN114782553B CN 114782553 B CN114782553 B CN 114782553B CN 202210509591 A CN202210509591 A CN 202210509591A CN 114782553 B CN114782553 B CN 114782553B
- Authority
- CN
- China
- Prior art keywords
- camera
- elliptic
- coordinates
- calibration plate
- conic
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention relates to an iterative camera calibration method based on an elliptic dual conic, which comprises the steps of extracting the center coordinates of an ellipse on a calibration plate image; calibrating a camera according to two-dimensional pixel coordinates and three-dimensional space coordinates corresponding to the circle center coordinates of the ellipse, and solving to obtain camera parameters and a first re-projection error; correcting perspective projection and lens distortion in the calibration plate image, and converting the calibration plate image into a forward view; extracting the center coordinates of the perfect circle on the corrected calibration plate image; re-projecting the circle center coordinates of the perfect circle back to a camera coordinate system, calibrating the camera again according to the coordinates of the circle center coordinates of the perfect circle under the camera coordinate system, and solving to obtain a second re-projection error; and carrying out convergence judgment according to the first re-projection error and the second re-projection error. The invention provides an iterative camera calibration method based on an elliptic dual conic, which can reduce the reprojection error by 92.4%, and greatly improve the calibration precision of a camera.
Description
Technical Field
The invention relates to the technical field of machine vision, in particular to an iterative camera calibration method and device based on an elliptic dual conic.
Background
In the image measurement process and the machine vision application, in order to determine the interrelation between the three-dimensional geometric position of a certain point on the surface of a space object and the corresponding point in the image, a geometric model of camera imaging must be established, the geometric model parameters are camera parameters, the parameters must be obtained through experiments and calculation under most conditions, the process of solving the parameters is called camera calibration, therefore, in the machine vision application, the calibration of the camera parameters is a very critical link, however, in the machine vision, because the checkerboard angular points are relatively sensitive to noise and image quality, the angular point coordinate detection precision is lower, the suppression of the circular characteristics to noise is stronger, and the detection precision is high, so that the circular mode plane calibration plate is widely applied to high-precision camera calibration.
However, when the plane calibration plate in the circular mode is used for camera calibration, the plane calibration plate mainly depends on a group of contour points extracted in advance, and because the plane calibration plate cannot be used for multi-group calibration, the plane calibration plate is very sensitive to nonuniform illumination such as light sources, reflection and the like, the circle center of a projected ellipse is not necessarily the projection of the circle center of a perfect circle, and meanwhile, the circular ring is also influenced by distortion, so that eccentric errors are generated, and the camera calibration precision is influenced.
Disclosure of Invention
Therefore, the technical problem to be solved by the invention is to overcome the problems existing in the prior art, and an iterative camera calibration method and device based on an elliptic dual conic are provided, which can reduce the reprojection error by 92.4%, and greatly improve the calibration precision of the camera.
In order to solve the technical problems, the invention provides an iterative camera calibration method based on an elliptic dual conic, which comprises the following steps:
s1: shooting a calibration plate for multiple times by using a camera to obtain a calibration plate image, and preprocessing the calibration plate image;
s2: extracting the center coordinates of the ellipse on the calibration plate image by utilizing the dual elliptic conic;
s3: calibrating the camera according to the two-dimensional pixel coordinates and the three-dimensional space coordinates corresponding to the circle center coordinates of the ellipse, and solving to obtain an initial value of the camera parameter and a first re-projection error;
s4: correcting perspective projection and lens distortion in the calibration plate image according to the initial value of the camera parameter, converting the calibration plate image into a forward view, and correcting the projected ellipse into an approximate perfect circle to obtain a corrected calibration plate image;
s5: extracting the center coordinates of the perfect circle on the corrected calibration plate image by using the elliptic dual quadratic curve;
s6: re-projecting the circle center coordinates of the perfect circle back to the original camera coordinate system according to the initial values of the camera parameters, calibrating the camera again according to the coordinates of the circle center coordinates of the perfect circle under the camera coordinate system, and solving to obtain a second re-projection error;
s7: and (3) carrying out convergence judgment according to the first re-projection error and the second re-projection error, repeating the operations from S4 to S7 if the second re-projection error is smaller than the first re-projection error, and ending the operation if the second re-projection error is larger than or equal to the first re-projection error.
In one embodiment of the present invention, in S2, the method for preprocessing the calibration plate image includes:
s2.1: defining a Gaussian function, and calculating the area containing the ellipse in the calibration plate image by using a Gaussian filterAn image gradient defining a normal direction through the pixel center, wherein the Gaussian function is defined asWherein sigma is the standard deviation and u is the mean;
s2.2: converting Gaussian function into 5×5 filtering template, setting the convolution kernel proportionality coefficient as 1, calculating the horizontal and longitudinal gradients of each pixel in the calibration plate image as G (x) and G (y), and defining the gradient direction as normal direction
S2.3: defining the weight of each tangent perpendicular to the normal direction, and obtaining a tangent set, wherein a weight formula is defined as
S2.4: and obtaining an elliptic dual conic parameter by utilizing the tangent set, and solving according to the elliptic dual conic parameter to obtain an elliptic circle center coordinate standard.
In S2.4, the method for obtaining the elliptic dual conic parameter by using the tangent set and solving the elliptic dual conic parameter to obtain the elliptic center coordinates according to the elliptic dual conic parameter according to the embodiment of the invention comprises the following steps:
s2.41: the perspective projection of the space circle onto the imaging plane is a quadratic curve, and the equation with the center of the quadratic curve at the origin is set as Ax 2 +Bxy+Cy 2 +dx+ey+f=0 (4), where a, B, C, D, E, F are coefficients of a conic, the tangent of the tangent set being called a dual conic, the parameter Q * Is defined asWherein A ', B', C ', D', E ', F' are coefficients of dual conic:
s2.42: given a set of tangents l i Dual conic Q * Is set to be ψ= { a ', B', C ', D', E ', F' }, Q * By linear minimizationThe square estimation minimizes the approximate fitting function phi (phi) to obtain the parameters of the dual quadratic curve, whereinWherein, I i Is a tangential set, l i T Is the transposition of the tangent set matrix, ω is the weight of each tangent, ψ is the dual conic Q * Is a parameter vector of (a);
s2.43: inverting the dual conic coefficient matrix to obtain an elliptic conic coefficient matrix, and obtaining the center coordinates of the ellipse by the formulas (7) and (8)And->Wherein x is 0 ,y 0 The coordinates of the center of the ellipse on the x and y axes are A, B, C, D, E and F, respectively, and are coefficients of quadratic curves.
In one embodiment of the present invention, in S3, a method for solving for camera parameters and a first re-projection error includes:
s3.1: calculating an initial value of a camera parameter under the ideal distortion-free condition, and simultaneously taking lens distortion into consideration, and calculating a nonlinear distortion parameter by using a least square method;
s3.2: calculating a first reprojection error according to the internal and external parameters of the camera and the nonlinear distortion parametersWherein n is the number of ellipse center points in the calibration plate image, m j For the true coordinates of the j-th ellipse center point in the calibration plate image, < + >>The coordinate of reprojection of the jth ellipse center point in the calibration plate image is (u) 0 ,v 0 ) For the translated origin coordinates, f x And f y Ruler for respectively representing horizontal direction and vertical direction of imageThe degree factor, k 1 ,k 2 ,k 3 ,k 4 For the radial distortion coefficient of the camera, p 1 ,p 2 The tangential distortion coefficient of the camera, RMS, is the first re-projection error.
In one embodiment of the present invention, in step S3.1, under ideal distortion-free conditions, the camera model is a small-hole imaging model, and the spatial coordinates of the circle center of the ring are set to be P (X W ,Y W ,Z W ) The process between the projection of this point to a point p (u, v) on the two-dimensional pixel coordinate system is as follows:
in the formula (u) 0 ,v 0 ) For the origin coordinates, f x 、f y The focal lengths of the cameras in the x and y directions are respectively shown, A is an internal reference matrix, and (R T) is an external reference matrix.
In one embodiment of the invention, in step S3.1, the nonlinear camera model involves radial distortion of the camera as follows:
in (x) u ,y u ) For the distorted image coordinates, (x, y) is the ideal undistorted image coordinates, k 1 、k 2 、k 3 、k 4 、p 1 And p 2 Are all the distortion coefficients of the two-dimensional optical fiber,in the event of a radial distortion,is tangential distortion.
In one embodiment of the present invention, in S4, a method of converting a calibration plate image to a forward view includes:
the calibration plate image is changed from a calibration plate image with an inclined angle through reverse perspectiveThe viewing plane is converted to the forward viewing plane, so that the matrix H is taken as the product of the inner parameter matrix and the outer parameter matrix in the formula (10), and the matrix H isThe matrix H is a perspective transformation matrixBringing formula (12) into formula (10)Eliminating scale factor Z by using (14) c Obtaining a conversion relation between the perspective projected coordinate point and the two-position pixel coordinate point>And->Inverting matrix H>Thus, the coordinates (u ', v') of each point in the forward view are obtained, namelyAnd->
In one embodiment of the present invention, in S6, a method of re-projecting the perfect circle center coordinates back to the original camera coordinate system includes:
the center coordinates of the perfect circle are re-projected back to the camera coordinate system by the following conversion formula:
wherein, (u ', v') is the undistorted coordinate of each pixel point in the two-dimensional pixel coordinate system under the forward view, H 11 ’,H 12 ’,H 13 ’,H 21 ’,H 22 ’,H 23 ’,H 31 ’,H 32 ’,H 33 ' is the parameters of the back perspective projection matrix.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method when executing the program.
Also, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method described above.
Compared with the prior art, the technical scheme of the invention has the following advantages:
according to the iterative camera calibration method based on the elliptic dual conic, the parameters obtained by the traditional calibration method are used as initialization parameters, the calibration image is re-projected to the forward view for correction, then the calibration point coordinates of the approximate calibration circle on the forward view are obtained, the calibration point coordinates of the perfect circle are used for re-calibration, the eccentric error is reduced through repeated iteration, the calibration point with higher precision is obtained, the re-projection error can be reduced by 92.4%, and the calibration precision of the camera is greatly improved.
Drawings
In order that the invention may be more readily understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof that are illustrated in the appended drawings.
FIG. 1 is a flow chart of a camera calibration method of the present invention;
FIG. 2 is a circular calibration plate for image acquisition in the present invention;
FIG. 3 is a graph showing the result of the present invention after circle center extraction based on dual conic;
FIG. 4 shows a calibration plate after pretreatment and reverse perspective transformation in the present invention;
FIG. 5 is a reprojection error distribution diagram of a conventional calibration method;
FIG. 6 is a reprojection error distribution diagram of the calibration method according to the present invention;
FIG. 7 is a reprojection error iteration diagram of the calibration method according to the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and specific examples, which are not intended to be limiting, so that those skilled in the art will better understand the invention and practice it.
Referring to fig. 1 to 4, an embodiment of the present invention provides an iterative camera calibration method based on an elliptic dual conic, including the following steps:
s1: shooting a calibration plate for multiple times by using a camera to obtain a calibration plate image, and preprocessing the calibration plate image;
s2: extracting the center coordinates of the ellipse on the calibration plate image by utilizing the dual elliptic conic;
s3: calibrating the camera according to the two-dimensional pixel coordinates and the three-dimensional space coordinates corresponding to the circle center coordinates of the ellipse, and solving to obtain an initial value of the camera parameter and a first re-projection error;
s4: correcting perspective projection and lens distortion in the calibration plate image according to the initial value of the camera parameter, converting the calibration plate image into a forward view, and correcting the projected ellipse into an approximate perfect circle to obtain a corrected calibration plate image;
s5: extracting the center coordinates of the perfect circle on the corrected calibration plate image by using the elliptic dual quadratic curve;
s6: re-projecting the circle center coordinates of the perfect circle back to the original camera coordinate system according to the initial values of the camera parameters, calibrating the camera again according to the coordinates of the circle center coordinates of the perfect circle under the camera coordinate system, and solving to obtain a second re-projection error;
s7: and (3) carrying out convergence judgment according to the first re-projection error and the second re-projection error, repeating the operations from S4 to S7 if the second re-projection error is smaller than the first re-projection error, and ending the operation if the second re-projection error is larger than or equal to the first re-projection error.
As a specific embodiment of the present application, the specific operation of preprocessing the calibration plate image in step S2 includes the following steps:
s2.1: defining a gaussian function, and calculating an image gradient of a region containing an ellipse in the calibration plate image by using the gaussian filter, wherein the image gradient defines a normal direction passing through a pixel center, and the gaussian function is defined as:
in the formula, sigma is a standard deviation, u is a mean value, and the mean value of the Gaussian function is set to be 0;
s2.2: converting the Gaussian function into a 5X 5 filtering template, setting the proportion coefficient of the convolution kernel as 1, and calculating the transverse gradient and the longitudinal gradient of each pixel in the calibration plate image to be G (x) and G (y), wherein the gradient direction, namely the direction of the normal line, can be defined as;
s2.3: defining the weight of each tangent perpendicular to the normal direction, focusing on the active region of the gradient, and giving higher attention to the place with stronger gradient, thereby obtaining a tangent set, wherein the weight formula is defined as follows:
s2.4: and obtaining an elliptic dual conic parameter by utilizing the tangent set, and solving according to the elliptic dual conic parameter to obtain the elliptic center coordinate.
In the step S2.4, the perspective projection of the spatial circle onto the imaging plane is a conic, and the equation assuming that the center of the conic is at the origin is:
Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0 (4)
wherein A, B, C, D, E, F are coefficients of a conic. The relationship between plane and conic is expressed by using a series of straight lines tangent to conic, which are called dual conic, whose parameters are Q * The definition is as follows:
given a set of tangents l i Dual conic Q * Is set to be ψ= { a ', B', C ', D', E ', F' }, Q * The approximate fitting function phi (phi) can be enabled to reach the minimum value through linear least square estimation, and then each parameter of the dual quadratic curve can be obtained;
wherein, I i Is a tangential set, l i T Is the transposition of the tangent set matrix, ω is the weight of each tangent, ψ is the dual conic Q * Is a parameter vector of (a);
inverting the dual conic coefficient matrix to obtain an elliptic conic coefficient matrix, and obtaining the center coordinates of the ellipse by the following steps:
wherein x is 0 ,y 0 The coordinates of the center of the ellipse on the x and y axes are A, B, C, D, E and F, respectively, and are coefficients of quadratic curves.
As a specific embodiment of the present application, before step S2.1, the calibration plate image is first converted into a grayscale image; then carrying out binarization processing on the gray level image by using a maximum inter-class difference method; and finally, removing irrelevant information in the gray level image by using expansion corrosion, and only retaining the most essential elliptic information.
As a specific embodiment of the present application, the specific operation of step S3 includes the steps of:
s3.1: calculating an initial value of a camera parameter under the ideal distortion-free condition, and simultaneously taking lens distortion into consideration, and calculating a nonlinear distortion parameter by using a least square method;
s3.2: the first reprojection error is calculated according to the internal and external parameters of the camera and the nonlinear distortion parameters as follows:
wherein n is the number of ellipse center points in the calibration plate image, m j The true coordinates of the center point of the j-th ellipse in the calibration plate image,the coordinate of reprojection of the jth ellipse center point in the calibration plate image is (u) 0 ,v 0 ) For the translated origin coordinates, f x And f y Scale factors k representing the horizontal and vertical directions of the image, respectively 1 ,k 2 ,k 3 ,k 4 For the radial distortion coefficient of the camera, p 1 ,p 2 As a tangential distortion coefficient of the camera, RMS is a first reprojection error, which is an index for evaluating the calibration accuracy of the camera;
s3.3: and (3) taking the re-projection error obtained in the step (S3.2) as an objective function, and optimizing the initial value of the camera parameter by using a maximum likelihood estimation method.
As a specific embodiment of the present application, in step S3.1, under the ideal distortion-free condition, the camera model is a small-hole imaging model, and the spatial coordinate of the center of the circle is set to be P (X W ,Y W ,Z W ) The point is projected to a two-dimensional imageThe procedure between points p (u, v) on the plain coordinate system is as follows:
in the formula (u) 0 ,v 0 ) Is an origin coordinate; f (f) x 、f y The focal lengths of the cameras in the x and y directions are respectively shown in pixel units; a is an internal reference matrix; (R T) is an extrinsic matrix.
As a specific embodiment of the present application, in step S3.1, the nonlinear camera model involves radial distortion of the camera as follows:
in (x) u ,y u ) For the distorted image coordinates, (x, y) is the ideal undistorted image coordinates, k 1 ,k 2 ,k 3 ,k 4 ,p 1 And p 2 Are all the distortion coefficients of the two-dimensional optical fiber,in the event of a radial distortion,is tangential distortion.
As a specific embodiment of the present application, in step S4, the essence of converting the original calibration plate image into a forward view is to convert the image from a view plane with an oblique angle to a forward view plane by reverse perspective conversion. To simplify the calculation, the world coordinate system is fixed on the target plane, then the physical coordinate Z of any point on the target plane w =0, the three-dimensional world coordinates and the two-dimensional pixel coordinates of each image are normalized, specifically as follows:
let the matrix H be the product of the inner and outer parameter matrices in equation (10):
the matrix H is a homography matrix, i.e., a perspective transformation matrix:
bringing formula (12) into formula (10) yields:
eliminating scale factor Z by using (14) c The method can obtain:
the conversion relation between the coordinate point of the perspective projection and the two-position pixel coordinate point is obtained, and the matrix H is inverted to obtain:
the coordinates (u) of each point in the forward view can be obtained ’ ,v’);
As a specific embodiment of the present application, in step S6, since the perspective projection matrix of the known camera, that is, equation (13), (u ', v'), is the coordinates of each point in the forward view, and (x ', y') is the coordinates of each point in the original camera coordinate system, the right circular center coordinates can be re-projected back to the camera coordinate system by the following conversion equation.
As a specific embodiment of the present application, in step S7, whether the iteration number exceeds 10 times or whether the reprojection error in the formula (9) is reduced generation by generation is used as a convergence criterion.
According to the iterative camera calibration method based on the elliptic dual conic, the parameters obtained by the traditional calibration method are used as initialization parameters, the calibration image is re-projected to the forward view for correction, then the calibration point coordinates of the approximate calibration circle on the forward view are obtained, the calibration point coordinates of the perfect circle are used for re-calibration, the eccentric error is reduced through repeated iteration, the calibration point with higher precision is obtained, the re-projection error can be reduced by 92.4%, and the calibration precision of the camera is greatly improved.
In order to verify the performance of the present invention, the camera was calibrated using the method of the present invention and the conventional method as a comparison. Specifically, the camera was calibrated by the method of the present invention and the conventional method for 13 photographed images, respectively, and the obtained results are shown in table 1 below.
Table 1 comparison of camera calibration results
In the research of camera calibration, a re-projection error is generally adopted to judge the camera calibration precision. The re-projection error is to re-project the three-dimensional point of the space by using the internal and external parameters and the distortion parameters of the camera obtained by calibration, so as to obtain the deviation between the new projection point coordinates and the original imaging point coordinates of the three-dimensional point of the space on the image. In general, the smaller the re-projection error, the higher the accuracy of the camera calibration. The projection errors for all images of the inventive and conventional methods are shown in table 2 below. As can be seen from Table 2, the overall average error of the method of the present invention is 0.0671, which is 92.4% lower than that of the conventional method. The re-projection error distribution of the conventional method for all the feature points in each image is shown in fig. 5, and the error points are seriously spread. The re-projection error distribution of the method of the invention for all the characteristic points in each image is shown in fig. 6, and the error points are basically concentrated within 0.2. By integrating table 2, fig. 5 and fig. 6, it is illustrated that the method greatly improves the camera calibration accuracy, and also verifies the feasibility and effectiveness of the method of the present invention. It is worth mentioning that the method of the present invention has a fast convergence speed, and can reach the convergence target after about 3 iterations, as shown in fig. 7.
Table 2 overall average re-projection error contrast unit for camera calibration: pixel arrangement
Corresponding to the above method embodiments, the embodiments of the present invention further provide a computer apparatus, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the iterative camera calibration method based on the elliptic dual conic when executing the computer program.
In an embodiment of the present invention, the processor may be a central processing unit (Central Processing Unit, CPU), an asic, a dsp, a field programmable gate array, or other programmable logic device, etc.
The processor may call a program stored in the memory, and in particular, the processor may perform operations in an embodiment of a method of rapidly calculating three-dimensional polarization dimensions.
The memory is used to store one or more programs, which may include program code including computer operating instructions.
In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid state storage device.
Corresponding to the above method embodiment, the embodiment of the invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the iterative camera calibration method based on elliptic dual conic sections.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations and modifications of the present invention will be apparent to those of ordinary skill in the art in light of the foregoing description. It is not necessary here nor is it exhaustive of all embodiments. And obvious variations or modifications thereof are contemplated as falling within the scope of the present invention.
Claims (10)
1. An iterative camera calibration method based on an elliptic dual conic is characterized by comprising the following steps:
s1: shooting a calibration plate for multiple times by using a camera to obtain a calibration plate image, and preprocessing the calibration plate image;
s2: extracting the center coordinates of the ellipse on the calibration plate image by utilizing the dual elliptic conic;
s3: calibrating the camera according to the two-dimensional pixel coordinates and the three-dimensional space coordinates corresponding to the circle center coordinates of the ellipse, and solving to obtain an initial value of the camera parameter and a first re-projection error;
s4: correcting perspective projection and lens distortion in the calibration plate image according to the initial value of the camera parameter, converting the calibration plate image into a forward view, and correcting the projected ellipse into an approximate perfect circle to obtain a corrected calibration plate image;
s5: extracting the center coordinates of the perfect circle on the corrected calibration plate image by using the elliptic dual quadratic curve;
s6: re-projecting the circle center coordinates of the perfect circle back to the original camera coordinate system according to the initial values of the camera parameters, calibrating the camera again according to the coordinates of the circle center coordinates of the perfect circle under the camera coordinate system, and solving to obtain a second re-projection error;
s7: and (3) carrying out convergence judgment according to the first re-projection error and the second re-projection error, repeating the operations from S4 to S7 if the second re-projection error is smaller than the first re-projection error, and ending the operation if the second re-projection error is larger than or equal to the first re-projection error.
2. The iterative camera calibration method based on elliptic dual conic between claim 1, wherein in S1, the method for preprocessing the calibration plate image comprises:
s1.1: defining a gaussian function, calculating an image gradient using a gaussian filter for a region containing an ellipse in the calibration plate image, the image gradient defining a normal direction through the center of the pixel, wherein the gaussian function is defined asWherein sigma is the standard deviation and u is the mean;
s1.2: converting Gaussian function into 5×5 filtering template, setting the convolution kernel proportionality coefficient as 1, calculating the horizontal and longitudinal gradients of each pixel in the calibration plate image as G (x) and G (y), and defining the gradient direction as normal direction
S1.3: defining the weight of each tangent perpendicular to the normal direction, and obtaining a tangent set, wherein a weight formula is defined as
S1.4: and obtaining an elliptic dual conic parameter by utilizing the tangent set, and solving according to the elliptic dual conic parameter to obtain the elliptic center coordinate.
3. The iterative camera calibration method based on elliptic dual conic section of claim 2, wherein in S1.4, the method for obtaining elliptic dual conic section parameters by using tangent sets and solving to obtain elliptic center coordinates according to elliptic dual conic section parameters comprises:
s1.41: the perspective projection of the space circle onto the imaging plane is a quadratic curve, and the equation with the center of the quadratic curve at the origin is set as Ax 2 +Bxy+Cy 2 +dx+ey+f=0 (4), where a, B, C, D, E, F are coefficients of a conic, the tangent of the tangent set being called a dual conic, the matrix Q * Is defined asWherein A ', B', C ', D', E ', F' are coefficients of dual conic:
s1.42: given a set of tangents l i ,Q * Is set to be ψ= { a ', B', C ', D', E ', F' }, Q * Obtaining parameters of the dual conic by minimizing the approximate fitting function phi (phi) by linear least squares estimation, whereinWherein, I i Is a tangential set, l i T Is the transposition of the tangent set matrix, ω is the weight of each tangent, ψ is Q * Is a parameter vector of (a);
s1.43: inverting the dual conic coefficient matrix to obtain an elliptic conic coefficient matrix, and obtaining the center coordinates of the ellipse by the formulas (7) and (8)And->Wherein x is 0 ,y 0 The coordinates of the center of the ellipse on the x and y axes are A, B, C, D, E and F, respectively, and are coefficients of quadratic curves.
4. The iterative camera calibration method based on elliptic dual conic of claim 1, wherein in S3, the method for solving to obtain the initial value of the camera parameter and the first re-projection error comprises:
s3.1: calculating an initial value of a camera parameter under the ideal distortion-free condition, and simultaneously taking lens distortion into consideration, and calculating a nonlinear distortion parameter by using a least square method;
s3.2: calculating a first reprojection error according to the internal and external parameters of the camera and the nonlinear distortion parametersWherein n is the number of ellipse center points in the calibration plate image, m j For the true coordinates of the j-th ellipse center point in the calibration plate image, < + >>The coordinate of reprojection of the jth ellipse center point in the calibration plate image is (u) 0 ,v 0 ) For the translated origin coordinates, f x 、f y Respectively the focal length, k of the camera in the x and y directions 1 ,k 2 ,k 3 ,k 4 For the radial distortion coefficient of the camera, p 1 ,p 2 The tangential distortion coefficient of the camera, RMS, is the first re-projection error.
5. The iterative camera calibration method based on elliptic dual conic of claim 4, wherein in step S3.1, under ideal distortion-free condition, the camera model is a pinhole imaging model, and the spatial coordinate of the center of the circle is P (X W ,Y W ,Z W ) The process of projecting the center of the circular ring to a point p (u, v) on a two-dimensional pixel coordinate system is as follows:
in the formula (u) 0 ,v 0 ) Is thatOrigin coordinates after translation, f x 、f y Respectively the focal length of the camera in the x and y directions, A is an internal reference matrix, (R T) is an external reference matrix, Z c Is a scale factor.
6. The iterative camera calibration method based on elliptic dual conic sections of claim 4, wherein: in step S3.1, the nonlinear camera model involves the radial distortion of the camera as follows:
in (x) u ,y u ) For the distorted image coordinates, (x, y) is the ideal undistorted image coordinates, k 1 、k 2 、k 3 、k 4 、p 1 And p 2 Are all the distortion coefficients of the two-dimensional optical fiber,for radial distortion +.>Is tangential distortion.
7. The iterative camera calibration method based on elliptic dual conic of claim 5, wherein in S4, the method of converting the calibration plate image to the forward view comprises:
converting the calibration plate image from the view plane with an inclined angle to the forward view plane through reverse perspective conversion, so that a matrix H is used as the product of the internal and external parameter matrices in the (10), wherein the matrix H isThe matrix H is a perspective projection matrixBringing formula (12) into formula (10)Eliminating scale factor Z by using (14) c Obtaining a conversion relation between the perspective projected coordinate point and the two-position pixel coordinate point>And->Inverting matrix H>Thus, the coordinates (u ', v') of each point in the forward view are obtained, namelyAnd->
8. The iterative camera calibration method based on elliptic dual conic of claim 7, wherein in S6, the method of re-projecting the perfect circle center coordinates back to the original camera coordinate system comprises:
the center coordinates of the perfect circle are re-projected back to the camera coordinate system by the following conversion formula:
wherein, (u ', v') is the undistorted coordinate of each pixel point in the two-dimensional pixel coordinate system under the forward view, H 11 ’,H 12 ’,H 13 ’,H 21 ’,H 22 ’,H 23 ’,H 31 ’,H 32 ’,H 33 ' is the parameters of the back perspective projection matrix.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 8 when the program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210509591.XA CN114782553B (en) | 2022-05-11 | 2022-05-11 | Iterative camera calibration method and device based on elliptic dual conic |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210509591.XA CN114782553B (en) | 2022-05-11 | 2022-05-11 | Iterative camera calibration method and device based on elliptic dual conic |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114782553A CN114782553A (en) | 2022-07-22 |
CN114782553B true CN114782553B (en) | 2023-07-28 |
Family
ID=82437196
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210509591.XA Active CN114782553B (en) | 2022-05-11 | 2022-05-11 | Iterative camera calibration method and device based on elliptic dual conic |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114782553B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116563388B (en) * | 2023-04-28 | 2024-05-07 | 神力视界(深圳)文化科技有限公司 | Calibration data acquisition method and device, electronic equipment and storage medium |
CN117911542B (en) * | 2024-03-19 | 2024-06-11 | 杭州灵西机器人智能科技有限公司 | Calibration plate, calibration plate identification method, system, equipment and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101329764A (en) * | 2008-07-31 | 2008-12-24 | 上海交通大学 | Method for positioning video camera using two arbitrary coplane circles |
CN102999895A (en) * | 2011-09-16 | 2013-03-27 | 云南大学 | Method for linearly solving intrinsic parameters of camera by aid of two concentric circles |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9767728B2 (en) * | 2015-10-30 | 2017-09-19 | Essential Products, Inc. | Light sensor beneath a dual-mode display |
CN109003309B (en) * | 2018-07-05 | 2021-05-07 | 烟台大学 | High-precision camera calibration and target attitude estimation method |
CN112163309B (en) * | 2020-07-27 | 2023-06-02 | 扬州市职业大学(扬州市广播电视大学) | Method for rapidly extracting space circle center of single plane circle image |
CN112489140B (en) * | 2020-12-15 | 2024-04-05 | 北京航天测控技术有限公司 | Attitude measurement method |
CN113012234B (en) * | 2021-03-16 | 2022-09-02 | 中国人民解放军火箭军工程大学 | High-precision camera calibration method based on plane transformation |
CN113160315B (en) * | 2021-04-16 | 2023-01-20 | 广东工业大学 | Semantic environment map representation method based on dual quadric surface mathematical model |
-
2022
- 2022-05-11 CN CN202210509591.XA patent/CN114782553B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101329764A (en) * | 2008-07-31 | 2008-12-24 | 上海交通大学 | Method for positioning video camera using two arbitrary coplane circles |
CN102999895A (en) * | 2011-09-16 | 2013-03-27 | 云南大学 | Method for linearly solving intrinsic parameters of camera by aid of two concentric circles |
Also Published As
Publication number | Publication date |
---|---|
CN114782553A (en) | 2022-07-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114782553B (en) | Iterative camera calibration method and device based on elliptic dual conic | |
CN110969668B (en) | Stereo calibration algorithm of long-focus binocular camera | |
CN107633536B (en) | Camera calibration method and system based on two-dimensional plane template | |
US20150093042A1 (en) | Parameter calibration method and apparatus | |
CN110099267B (en) | Trapezoidal correction system, method and projector | |
Douxchamps et al. | High-accuracy and robust localization of large control markers for geometric camera calibration | |
CN111899290B (en) | Three-dimensional reconstruction method combining polarization and binocular vision | |
CN111145271B (en) | Method and device for determining accuracy of camera parameters, storage medium and terminal | |
CN107633533B (en) | High-precision circular mark point center positioning method and device under large-distortion lens | |
Dufour et al. | Integrated digital image correlation for the evaluation and correction of optical distortions | |
CN109859137A (en) | A kind of irregular distortion universe bearing calibration of wide angle camera | |
CN111462245A (en) | Zoom camera attitude calibration method and system based on rectangular structure | |
CN114241018A (en) | Tooth point cloud registration method and system and readable storage medium | |
CN115409898A (en) | High-precision camera calibration method and device based on special annular calibration plate | |
CN111784643B (en) | Cross line structured light-based tire tangent plane acquisition method and system | |
CN117030620A (en) | Method and device for adjusting regional network based on multisource optical remote sensing satellite image | |
CN113240752B (en) | Internal reference and external reference collaborative calibration method and device | |
CN114897990A (en) | Camera distortion calibration method and system based on neural network and storage medium | |
CN115661258A (en) | Calibration method and device, distortion correction method and device, storage medium and terminal | |
CN112378348B (en) | Iterative phase correction method for low-quality fringe image | |
CN113935912A (en) | Method and device for correcting distortion-removed circle center of camera, terminal equipment and medium | |
CN113920196A (en) | Visual positioning method and device and computer equipment | |
CN114972013B (en) | Fisheye image rapid orthorectification method based on spherical geometry single transformation | |
CN117495737A (en) | Image processing method, system, equipment and storage medium based on camera disturbance | |
CN118297942B (en) | Part shape and position error detection method and system based on image processing |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |