A camera calibration method and apparatus

By acquiring and processing the defocused image of the circular calibration plate, and utilizing subpixel edge detection and ellipse fitting techniques, the accuracy and precision of camera calibration in ultra-large results and long-distance computer vision measurements were improved, solving the robustness and error problems of feature point coordinate extraction.

CN116385556BActive Publication Date: 2026-04-07WUHAN UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2026-04-07

Smart Images

  • Figure CN116385556B_ABST
    Figure CN116385556B_ABST
Patent Text Reader

Abstract

The application provides a camera calibration method and device, which comprises the following steps: collecting defocus images of a ring calibration board at different angles, and performing sharpening processing on the defocus images at different angles to obtain sharpened defocus images; performing edge detection on the sharpened defocus images based on a sub-pixel edge detection algorithm to obtain an edge detection image; performing edge abnormal point elimination operation on the edge detection image to obtain a target defocus image, so that the ring edge data is more accurate; determining a point array corresponding to the projection center of a plurality of rings on the ring calibration board on the target defocus image; performing normalization processing on the point array to obtain a point matrix of a normal focus image corresponding to the target defocus image. Finally, the camera is calibrated based on the point matrix of the normal focus image, and the problem that the feature point coordinates cannot be accurately extracted and the error is large in the camera calibration process in the ultra-large result and long-distance computer vision measurement process of the existing calibration method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision measurement, and in particular to a camera calibration method and device. BACKGROUND

[0002] At present, with the continuous improvement of the measurement accuracy of visual results and the reduction of costs, the three-dimensional deformation measurement of visual results is rapidly developing towards large-scale result measurement. Camera calibration is a bridge between the coordinates of points in the real world and the pixel coordinates of points in the image. The calibration accuracy directly affects the measurement accuracy. In the camera calibration method of large-scale result visual measurement, the traditional calibration method is mainly used. The traditional calibration method needs to use a calibration object with known size or spatial points (feature points) (for example, using a total station to determine the coordinates of multiple points on the measured object, or making a three-dimensional model with known size, etc.). In 1999, Dr. Zhang Zhengyou proposed a method of camera calibration by accurately extracting the feature point coordinate array of a chessboard plate with known size. It is widely concerned because of its simple production, flexible use and high calibration accuracy.

[0003] However, in the Zhang calibration method, the plate target needs to occupy most of the image, and a clear image within the camera depth of field range needs to be obtained as much as possible. These requirements are difficult to meet in large-scale result visual measurement. First, it is difficult to make, transport and place a large calibration plate that matches the size of the measured result. Second, it is difficult for a small calibration plate to occupy most of the image within the camera depth of field range. Although moving the calibration plate towards the camera can occupy most of the image, it will also produce a blurred image due to defocus, making it difficult to accurately extract the feature point coordinates. At present, other methods, such as the three-phase shift improved method and the three-phase shift active circular grating (PCG) array as a calibration target, improve the robustness of feature point positioning under defocus image conditions. The geometric center of the projected ellipse of the circular pattern is used as the feature point, and the eccentric error of the circular target projection ellipse is not considered, but the error becomes more serious as the inclination angle of the calibration plate increases.

[0004] Therefore, it is necessary to provide a camera calibration method to solve the problem that the existing calibration method cannot accurately extract feature point coordinates or has a large error in extracting feature point coordinates in the process of computer vision measurement of super large results and long distances. SUMMARY

[0005] Therefore, the present application provides a camera calibration method to solve the problem that the prior art cannot accurately extract feature point coordinates or has a large error in extracting feature point coordinates in the process of computer vision measurement of super large results and long distances.

[0006] To solve the above problems, the present application provides a camera calibration method, which comprises:

[0007] Collect out-of-focus images of the circular calibration plate at different angles, and sharpen the out-of-focus images at different angles to obtain sharpened out-of-focus images;

[0008] The sharpened out-of-focus image is subjected to edge detection based on a sub-pixel edge detection algorithm to obtain an edge-detected image.

[0009] The edge detection image is subjected to an edge anomaly removal operation to obtain the target out-of-focus image;

[0010] Determine the point array corresponding to the projection center of multiple rings on the circular calibration plate on the target defocused image;

[0011] The point array is normalized to obtain the point matrix of the in-focus image corresponding to the out-of-focus image of the target;

[0012] The camera is calibrated based on the point matrix of the positive focus image.

[0013] In one possible implementation, performing edge detection on the sharpened out-of-focus image based on a sub-pixel edge detection algorithm to obtain an edge-detected image includes:

[0014] Determine the edge lines and grayscale values ​​of the edge line pixels in the sharpened out-of-focus image;

[0015] The inner curve of the edge line pixel is determined based on the gray value of the edge line pixel.

[0016] Based on the inner curve, the position of the edge line within the edge pixel is determined;

[0017] The edge detection image is obtained by fitting the position of the edge line within the edge pixel.

[0018] In one possible implementation, the step of performing edge outlier removal on the edge detection image to obtain a target out-of-focus image includes:

[0019] The edge detection image is segmented and filled to obtain the target edge detection image, and the edge line pixels of the ring in the target edge detection image are extracted.

[0020] The angle between adjacent normals within the edge line pixels is calculated based on the edge line pixels, where the normals are the normals of the target edge detection image;

[0021] Based on the included angle between the adjacent normals, edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data;

[0022] The fitted ellipse is obtained by performing least squares fitting on the data of the first inner and outer circle edge points.

[0023] Based on the first inner and outer circle edge point data and the fitted ellipse, the distance from the inner edge point of the edge pixel to the fitted ellipse is determined;

[0024] Based on the distance from the edge point within the edge pixel to the fitted ellipse, abnormal points in the target edge detection image are removed to obtain the second inner and outer circle edge point data;

[0025] The target out-of-focus image is obtained by fitting the data of the second inner and outer circle edge points using the least squares method.

[0026] In one possible implementation, removing edge anomalies from the target edge detection image based on the included angle between adjacent normals to obtain first inner and outer circle edge point data includes:

[0027] Determine the mean and variance of the angle between adjacent normals within the edge pixel;

[0028] The threshold range of the distribution area is determined based on the mean and the variance.

[0029] The edge pixels corresponding to the angles between the adjacent normals that are outside the threshold range of the distribution area are identified as edge anomalies, and the edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data.

[0030] In one possible implementation, the step of removing outliers from the target edge detection image based on the distance from the edge point within the edge pixel to the fitted ellipse to obtain the second inner and outer circle edge point data includes:

[0031] Determine the mean and variance of the distances from the inner edge points of the edge pixels to the fitted ellipse;

[0032] The threshold range of the distribution area is determined based on the mean and the variance.

[0033] Edge points within the edge pixels whose distance to the fitted ellipse is outside the threshold range of the distribution area are defined as outliers. These outliers in the target edge detection image are then removed to obtain the second inner and outer circle edge point data.

[0034] In one possible implementation, determining the point array corresponding to the projection centers of the plurality of rings on the annular calibration plate onto the target defocused image includes:

[0035] Determine the center point of the ring in the out-of-focus image of the target;

[0036] The projection center point of the ring on the target defocused image is determined based on the center point of the ring.

[0037] The point array is obtained based on multiple projection center points.

[0038] In one possible implementation, normalizing the point array to obtain the point matrix of the target out-of-focus image corresponding to the in-focus image includes:

[0039] The point array is normalized to obtain a normalized point array;

[0040] The normalized point array is converted into a point matrix of the positive focus image.

[0041] In one possible implementation, the camera calibration based on the point matrix of the positive-focus image includes:

[0042] The point matrix of the orthogonal image is used as the pixel coordinate array of the camera for camera calibration.

[0043] In one possible implementation, calibrating the camera by using the point matrix of the orthogonal image as the pixel coordinate array of the camera includes:

[0044] The product of the camera intrinsic parameter matrix and the product of the extrinsic parameter matrix are determined based on the pixel coordinate array.

[0045] The intrinsic parameter matrix is ​​determined based on the product of the intrinsic parameter matrices;

[0046] The extrinsic parameter matrix is ​​determined based on the product of the extrinsic parameter matrices;

[0047] The distortion parameters of the camera are determined based on the pixel coordinate array;

[0048] Based on the intrinsic parameter matrix, the extrinsic parameter matrix, and the distortion parameters, the camera parameters are optimized using the LM algorithm to complete camera calibration.

[0049] On the other hand, the present invention also provides a camera calibration device, comprising:

[0050] The defocus image acquisition module is used to acquire defocus images of the circular calibration plate at different angles, and to sharpen the defocus images at different angles to obtain sharpened defocus images.

[0051] The edge detection module is used to perform edge detection on the sharpened out-of-focus image based on a sub-pixel edge detection algorithm to obtain an edge-detected image;

[0052] An anomaly removal module is used to perform an edge anomaly removal operation on the edge detection image to obtain a target out-of-focus image;

[0053] The projection center determination module is used to determine the point array corresponding to the projection center of multiple rings on the ring calibration plate on the target defocused image;

[0054] The focus image point matrix determination module normalizes the point array to obtain the point matrix of the focus image corresponding to the target out-of-focus image;

[0055] The camera calibration module calibrates the camera based on the point matrix of the positive focus image.

[0056] Compared with existing technologies, the beneficial effects of this invention include: This invention acquires defocused images from different angles of a circular calibration plate and sharpens these images to obtain sharpened defocused images; then, it performs edge detection on the sharpened defocused images based on a sub-pixel edge detection algorithm to obtain edge-detected images; next, it performs edge anomaly point elimination on the edge-detected images to obtain the target defocused image, making the circular edge data more accurate; then, it determines the point array corresponding to the projection centers of multiple circles on the circular calibration plate onto the target defocused image; it normalizes the point array to obtain the point matrix, i.e., feature points, of the corresponding positive focus image of the target defocused image. This method improves the robustness and accuracy of feature point coordinate extraction; finally, it calibrates the camera based on the point matrix of the positive focus image, greatly improving the accuracy of orthogonal image calibration and solving the problem of difficulty in accurately extracting feature point coordinates or large errors in feature point coordinate extraction during ultra-large results and long-distance computer vision measurements. Attached Figure Description

[0057] Figure 1 A flowchart illustrating an embodiment of a camera calibration method provided by the present invention;

[0058] Figure 2 This invention provides a sub-pixel edge detection principle. Figure 1 Schematic diagram of the embodiment;

[0059] Figure 3 This is a schematic diagram of an embodiment of a circular projection center provided by the present invention;

[0060] Figure 4 This invention provides a structural diagram of an embodiment of a camera calibration device. Detailed Implementation

[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0062] It should be understood that the illustrative drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the invention. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0063] Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.

[0064] In this document, the term "embodiment" means that a particular feature, result, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. Those skilled in the art will understand, explicitly and implicitly, that the embodiments described herein can be combined with other embodiments.

[0065] The present invention provides a camera calibration method, which will be described below.

[0066] Figure 1 A flowchart of an embodiment of a camera calibration method provided by the present invention includes the following steps:

[0067] S101. Acquire defocus images of the circular calibration plate at different angles, and sharpen the defocus images at different angles to obtain sharpened defocus images.

[0068] S102. Perform edge detection on the sharpened out-of-focus image based on the sub-pixel edge detection algorithm to obtain an edge-detected image;

[0069] S103. Perform edge anomaly point elimination operation on the edge detection image to obtain the target out-of-focus image;

[0070] S104. Determine the point array corresponding to the projection center of the multiple rings on the ring calibration plate on the target defocused image;

[0071] S105. Normalize the point array to obtain the point matrix of the target out-of-focus image corresponding to the in-focus image;

[0072] S106. Calibrate the camera based on the point matrix of the positive focus image.

[0073] Compared with existing technologies, this invention acquires defocused images from different angles of a circular calibration plate and sharpens these images to obtain sharpened defocused images. Then, it performs edge detection on the sharpened defocused images using a sub-pixel edge detection algorithm to obtain edge-detected images. Next, it performs edge anomaly removal on the edge-detected images to obtain the target defocused image, making the circular edge data more accurate. Then, it determines the point array corresponding to the projection centers of multiple circles on the circular calibration plate onto the target defocused image. It normalizes the point array to obtain the point matrix of the corresponding in-focus image, i.e., the feature point coordinates. Finally, it calibrates the camera based on the point matrix of the in-focus image. Existing calibration methods struggle to accurately extract feature point coordinates and suffer from large errors during ultra-large results and long-distance computer vision measurements.

[0074] In a specific embodiment, the out-of-focus image is sharpened to improve the contrast of the grayscale of the pixels at the edge of the ring in the out-of-focus image, thereby obtaining a sharpened out-of-focus image.

[0075] It should be noted that acquiring defocused images of the circular calibration plate at different angles means acquiring defocused images of the circular calibration plate at different angles within the defocus range.

[0076] Furthermore, it should be noted that the image of the circular calibration plate is required to occupy more than 2 / 3 of the area of ​​the defocused image.

[0077] In a preferred embodiment of the present invention, the step of performing edge detection on the sharpened out-of-focus image based on a sub-pixel edge detection algorithm to obtain an edge-detected image includes:

[0078] Determine the edge lines and grayscale values ​​of the edge line pixels in the sharpened out-of-focus image;

[0079] The inner curve of the edge line pixel is determined based on the gray value of the edge line pixel.

[0080] Based on the inner curve, the position of the edge line within the edge pixel is determined;

[0081] The edge detection image is obtained by fitting the position of the edge line within the edge pixel.

[0082] In a specific embodiment, it is assumed that the expression for the straight line at the edge of the curve is: y = cx 2 +bx+a selects the image of the edge of the ellipse.

[0083] The pixel to be detected is p(i,j). A 5×3 pixel region (ROI) is selected centered on pixel p(i,j). Please refer to [link to relevant documentation]. Figure 2 This invention provides a sub-pixel edge detection principle. Figure 1 The schematic diagram of the embodiment establishes, as follows: Figure 2 The coordinate system. Select a coordinate system in the image as follows. Figure 2 The ROI shown is divided into two parts by a quadratic curve, with grayscale values ​​C and O respectively, as shown. Figure 2 As shown. Assume F1, F2, and F3 are the sums of the grayscale values ​​of each column of pixels within the ROI, satisfying the equation:

[0084]

[0085]

[0086]

[0087] Where S1, S2, and S3 represent the area of ​​the lower part of the straight edge of each column of pixels in the three columns of pixels within the ROI, then:

[0088]

[0089]

[0090]

[0091] The expressions for coefficients a and b can be calculated from the above formula:

[0092]

[0093]

[0094]

[0095] C and O are unknown. Due to the optical effects on the edges, the pixels at the edge of the structure are not two clearly defined parts, and the pixel values ​​undergo a change. Therefore, the values ​​of C and O are obtained from the three pixels at the diagonal of the inner edge line of the ROI using the following method:

[0096]

[0097]

[0098] In summary, based on the above calculation method and pixel information, the inner curve of each edge line pixel can be obtained. After obtaining the expression of the edge curve, the intersection point P1 of the edge line and the y-axis is taken as the position of the edge line within the pixel, and N is the tangent direction of the pixel position. After obtaining the position of the edge line within the pixel, an ellipse is fitted using the least squares method to obtain the edge detection image.

[0099] In a preferred embodiment of the present invention, the step of performing edge anomaly removal operation on the edge detection image to obtain a target defocus image includes:

[0100] The edge detection image is segmented and filled to obtain the target edge detection image, and the edge line pixels of the ring in the target edge detection image are extracted.

[0101] The angle between adjacent normals within the edge line pixels is calculated based on the edge line pixels, where the normals are the normals of the target edge detection image;

[0102] Based on the included angle between the adjacent normals, edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data;

[0103] The fitted ellipse is obtained by performing least squares fitting on the data of the first inner and outer circle edge points.

[0104] Based on the first inner and outer circle edge point data and the fitted ellipse, the distance from the inner edge point of the edge pixel to the fitted ellipse is determined;

[0105] Based on the distance from the edge point within the edge pixel to the fitted ellipse, abnormal points in the target edge detection image are removed to obtain the second inner and outer circle edge point data;

[0106] The target out-of-focus image is obtained by fitting the data of the second inner and outer circle edge points using the least squares method.

[0107] In a specific embodiment, the fitting accuracy of the ring in the edge detection image is mainly affected by two situations: the normal direction of the inner edge line of the pixel is significantly tilted, for example, the inner edge of the pixel forms a straight line at the four vertices of the ring; or the inner edge line of the pixel obviously jumps out of the edge of the ring.

[0108] The following sections address these two scenarios respectively. Before processing, image segmentation and image filling methods are first used on each frame to obtain a preliminary edge detection image, and the edge line pixels of the ring in the preliminary edge detection image are extracted.

[0109] Then, the angle between adjacent normals within the edge pixel is calculated. Based on the fact that the circular edge is smooth, the direction angle θ of the circular edge pixel normal is... i (i = 1, 2, 3, ..., n) should also vary uniformly. Therefore, the angle Δθ between the normal directions of every two consecutive edge lines should also vary. j =θ i+1 -θ i (where i = 1, 2, 3, ..., n-1; j = 1, 2, 3, ..., m), which also varies uniformly.

[0110] Similarly, the distance data from the edge point within the edge pixel to the fitted ellipse is used.

[0111] In a preferred embodiment of the present invention, the step of removing edge anomalies from the target edge detection image based on the included angle between the adjacent normals to obtain the first inner and outer circle edge point data includes:

[0112] Determine the mean and variance of the angle between adjacent normals within the edge pixel;

[0113] The threshold range of the distribution area is determined based on the mean and the variance.

[0114] The edge pixels corresponding to the angles between the adjacent normals that are outside the threshold range of the distribution area are identified as edge anomalies, and the edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data.

[0115] In a specific implementation, since the distribution of outliers is random and follows a normal distribution, therefore Δθ j This also conforms to the normal distribution law. According to the properties of the normal distribution, the mean μ and variance δ of this univariate array can be expressed as:

[0116]

[0117]

[0118] Its probability density function is:

[0119]

[0120] Based on the characteristics of the normal distribution, the region μ±aδ (a=3) contains 99.7% of the data, the region μ±aδ (a=2) contains 95.4% of the data, and the region μ±aδ (a=1) contains 68.3% of the data. Points outside these regions can be considered outliers.

[0121] In a preferred embodiment of the present invention, the step of removing outliers from the target edge detection image based on the distance from the edge point within the edge pixel to the fitted ellipse to obtain the second inner and outer circle edge point data includes:

[0122] Determine the mean and variance of the distances from the inner edge points of the edge pixels to the fitted ellipse;

[0123] The threshold range of the distribution area is determined based on the mean and the variance.

[0124] Edge points within the edge pixels whose distance to the fitted ellipse is outside the threshold range of the distribution area are defined as outliers. These outliers in the target edge detection image are then removed to obtain the second inner and outer circle edge point data.

[0125] In a specific embodiment, since the distribution of outliers is random and conforms to a normal distribution, the distance data from the edge points within the edge pixels to the first fitted circle also conforms to a normal distribution. Based on the normal distribution formula, the mean and variance of the distance data from the edge points within the edge pixels to the first fitted circle are determined. Then, the edge points corresponding to the distance data from the edge points within the edge pixels outside the distribution area threshold to the first fitted circle are defined as outliers and removed to obtain the edge point data of the second inner and outer circles.

[0126] In a preferred embodiment of the present invention, determining the point array corresponding to the projection center of the plurality of rings on the annular calibration plate on the target defocused image includes:

[0127] Determine the center point of the ring in the out-of-focus image of the target;

[0128] The projection center point of the ring on the target defocused image is determined based on the center point of the ring.

[0129] The point array is obtained based on multiple projection center points.

[0130] For a specific embodiment, please refer to Figure 3 This invention provides a schematic diagram of an embodiment of a circular projection center. In the circular ring, an arbitrary straight line l1 passing through the center intersects the inner and outer circles at four points. Tangents to the inner circle are drawn through the intersection points q1 and q2. These two tangents intersect the outer circle at four points q5, q6, q7, and q8. Connecting these four points yields intersection points p1 and p2. Connecting intersection points p1 and p2 yields the straight line l2.

[0131] The intersection point e of lines l1 and l2 is the center point of the ring in the defocused image of the target. According to the properties of the projective geometry of the ring, point e′ is still the projection center of the ring in the projection of this ring.

[0132] Line l′1 passes through the geometric centers e and e′ of the ellipse. It is known that line l′1 must pass through the projection center of the annulus. Line l′1 intersects the inner and outer annulus at points q′1, q′2, q′3, and q′4. Tangents to the inner circle are drawn through points q′1 and q′2, intersecting the outer circle at points q′5, q′6, q′7, and q′8 respectively. Connecting these points q′1, q′2, q′3, q′4, q′5, q′6, q′7, and q′8 yields intersection points ′′1 and p′2. Connecting ′′1 and p′2 forms line l′2. Therefore, line l′2 must also pass through the projection center of the ellipse. The intersection point e′ of lines l′1 and l′2 is the required projection center of the annulus.

[0133] In a preferred embodiment of the present invention, the step of normalizing the point array to obtain the point matrix of the target out-of-focus image corresponding to the in-focus image includes:

[0134] The point array is normalized to obtain a normalized point array;

[0135] The normalized point array is converted into a point matrix of the positive focus image.

[0136] In a specific embodiment, the normalized point array is converted into a point matrix of a positive-focus image using the following formula, where the coordinates of the center point of the perspective projection of the i-th positive-focus annulus in the j-th image are:

[0137] P i,j =p(x i,j y i,j ) / d i,j ×D j

[0138] Where p(x) i,j y i,j ) is the i-th annular perspective projection in the j-th defocused image.

[0139] Center point coordinates, D j d is the distance from the position of the j-th in-focus image to the camera. i It is the distance between the points where the camera and the defocus calibration plate images intersect on the camera's main optical axis.

[0140] First, set the defocus distance to 1, which is d = defocus distance (mm) / defocus pixel distance (pixel). Then, convert d to the focal distance, i.e., D = d * focal pixel distance. This converts the pixel array of the defocused image into the pixel array of the focused image.

[0141] In a preferred embodiment of the present invention, the camera calibration based on the point matrix of the positive-focus image includes:

[0142] The point matrix of the orthogonal image is used as the pixel coordinate array of the camera for camera calibration.

[0143] In a preferred embodiment of the present invention, the step of using the point matrix of the orthogonal image as the pixel coordinate array of the camera for camera calibration includes:

[0144] The product of the camera intrinsic parameter matrix and the product of the extrinsic parameter matrix are determined based on the pixel coordinate array.

[0145] The intrinsic parameter matrix is ​​determined based on the product of the intrinsic parameter matrices;

[0146] The extrinsic parameter matrix is ​​determined based on the product of the extrinsic parameter matrices;

[0147] The distortion parameters of the camera are determined based on the pixel coordinate array;

[0148] Based on the intrinsic parameter matrix, the extrinsic parameter matrix, and the distortion parameters, the camera parameters are optimized using the LM algorithm to complete camera calibration.

[0149] It should be noted that the LM method, short for Levenberg-Marquardt method, is a least-squares estimation method for regression parameters in nonlinear regression. Proposed by D.W. Marquardt in 1963, it was developed based on a 1944 paper by K. Levenberg. This method combines the steepest descent method and the linearization method (Taylor series). The steepest descent method is suitable for the initial stage of iteration when the parameter estimates are far from the optimal value, while the linearization method, i.e., the Gauss-Newton method, is suitable for the later stages of iteration when the parameter estimates are close to the optimal value. Combining the two methods allows for a faster finding of the optimal value.

[0150] On the other hand, the present invention also provides a camera calibration device, such as Figure 4 A structural diagram of an embodiment of a camera calibration device 400 provided by the present invention includes:

[0151] The defocus image acquisition module 401 is used to acquire defocus images of the circular calibration plate at different angles, and to sharpen the defocus images at different angles to obtain sharpened defocus images.

[0152] Edge detection module 402 is used to perform edge detection on the sharpened out-of-focus image based on a sub-pixel edge detection algorithm to obtain an edge detection image;

[0153] Anomaly removal module 403 is used to perform anomaly removal operation on the edge detection image to obtain a target out-of-focus image;

[0154] The projection center determination module 404 is used to determine the point array corresponding to the projection center of multiple rings on the ring calibration plate on the target defocused image;

[0155] The focus image point matrix determination module 405 normalizes the point array to obtain the point matrix of the focus image corresponding to the target out-of-focus image.

[0156] The camera calibration module 406 calibrates the camera based on the point matrix of the positive focus image.

[0157] Compared with existing technologies, this invention acquires defocused images from different angles of a circular calibration plate and sharpens these images to obtain sharpened defocused images. Then, it performs edge detection on the sharpened defocused images using a sub-pixel edge detection algorithm to obtain edge-detected images. Next, it performs edge anomaly removal on the edge-detected images to obtain the target defocused image, making the circular edge data more accurate. Then, it determines the point array corresponding to the projection centers of multiple circles on the circular calibration plate onto the target defocused image. The point array is normalized to obtain the point matrix, i.e., feature points, of the corresponding focus image of the target defocused image. This method improves the robustness and accuracy of feature point coordinate extraction. Finally, it calibrates the camera based on the point matrix of the focus image, greatly improving the accuracy of orthogonal image calibration and solving the problem of difficulty in accurately extracting feature point coordinates or large errors in feature point coordinate extraction during ultra-large results and long-distance computer vision measurements.

[0158] The camera calibration method and apparatus proposed in this invention have been described in detail above. Specific examples have been used to illustrate the principle and implementation of this invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of ​​this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of ​​this invention. The above description is only a preferred embodiment of this invention, but the protection scope of this invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the protection scope of this invention.

Claims

1. A camera calibration method, characterized in that, include: Collect out-of-focus images of the circular calibration plate at different angles, and sharpen the out-of-focus images at different angles to obtain sharpened out-of-focus images; The sharpened out-of-focus image is subjected to edge detection based on a sub-pixel edge detection algorithm to obtain an edge-detected image. The edge detection image is subjected to an edge anomaly removal operation to obtain the target out-of-focus image; Determine the point array corresponding to the projection center of multiple rings on the circular calibration plate on the target defocused image; The point array is normalized to obtain the point matrix of the in-focus image corresponding to the out-of-focus image of the target; The camera is calibrated based on the point matrix of the positive focus image; The step of performing edge anomaly removal on the edge detection image to obtain the target defocus image includes: The edge detection image is segmented and filled to obtain the target edge detection image, and the edge line pixels of the ring in the target edge detection image are extracted. The angle between adjacent normals within the edge line pixels is calculated based on the edge line pixels, where the normals are the normals of the target edge detection image; Based on the included angle between the adjacent normals, edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data; The fitted ellipse is obtained by performing least squares fitting on the data of the first inner and outer circle edge points. Based on the first inner and outer circle edge point data and the fitted ellipse, the distance from the inner edge point of the edge line pixel to the fitted ellipse is determined; Based on the distance from the edge point within the edge line pixel to the fitted ellipse, abnormal points in the target edge detection image are removed to obtain the second inner and outer circle edge point data; The target out-of-focus image is obtained by fitting the data of the second inner and outer circle edge points using the least squares method.

2. The camera calibration method according to claim 1, characterized in that, The subpixel-based edge detection algorithm is used to perform edge detection on the sharpened out-of-focus image to obtain an edge-detected image, including: Determine the edge lines and grayscale values ​​of the edge line pixels in the sharpened out-of-focus image; The inner curve of the edge line pixel is determined based on the gray value of the edge line pixel. Based on the inner curve, the position of the edge line within the edge line pixel is determined; The edge detection image is obtained by fitting the position of the edge line within the edge line pixels.

3. The camera calibration method according to claim 1, characterized in that, The step of removing edge anomalies from the target edge detection image based on the included angle between adjacent normals to obtain first inner and outer circle edge point data includes: Determine the mean and variance of the angle between adjacent normals within the edge line pixel; The threshold range of the distribution area is determined based on the mean and the variance. The edge line pixels corresponding to the angles between the adjacent normals that are outside the threshold range of the distribution area are identified as edge anomalies, and the edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data.

4. The camera calibration method according to claim 1, characterized in that, The step of removing outliers from the target edge detection image based on the distance from the edge point within the edge line pixel to the fitted ellipse to obtain the second inner and outer circle edge point data includes: Determine the mean and variance of the distances from the inner edge points of the edge line pixels to the fitted ellipse; The threshold range of the distribution area is determined based on the mean and the variance. Edge points within the edge line pixels whose distance to the fitted ellipse is outside the threshold range of the distribution area are defined as outliers. These outliers in the target edge detection image are then removed to obtain the second inner and outer circle edge point data.

5. The camera calibration method according to claim 1, characterized in that, The step of determining the point array corresponding to the projection center of the plurality of rings on the annular calibration plate on the target defocused image includes: Determine the center point of the ring in the out-of-focus image of the target; The projection center point of the ring on the target defocused image is determined based on the center point of the ring. The point array is obtained based on multiple projection center points.

6. The camera calibration method according to claim 1, characterized in that, The step of normalizing the point array to obtain the point matrix of the target out-of-focus image corresponding to the in-focus image includes: The point array is normalized to obtain a normalized point array; The normalized point array is converted into a point matrix of the positive focus image.

7. A camera calibration method according to claim 1, characterized in that, The camera calibration based on the point matrix of the positive-focus image includes: The point matrix of the positive focus image is used as the pixel coordinate array of the camera for camera calibration.

8. A camera calibration method according to claim 7, characterized in that, The step of using the point matrix of the positive-focus image as the pixel coordinate array of the camera for camera calibration includes: The product of the camera intrinsic parameter matrix and the product of the extrinsic parameter matrix are determined based on the pixel coordinate array. The intrinsic parameter matrix is ​​determined based on the product of the intrinsic parameter matrices; The extrinsic parameter matrix is ​​determined based on the product of the extrinsic parameter matrices; The distortion parameters of the camera are determined based on the pixel coordinate array; Based on the intrinsic parameter matrix, the extrinsic parameter matrix, and the distortion parameters, the camera parameters are optimized using the LM algorithm to complete camera calibration.

9. A camera calibration device, characterized in that, include: The defocus image acquisition module is used to acquire defocus images of the circular calibration plate at different angles, and to sharpen the defocus images at different angles to obtain sharpened defocus images. The edge detection module is used to perform edge detection on the sharpened out-of-focus image based on a sub-pixel edge detection algorithm to obtain an edge-detected image; Anomaly removal module, used to perform anomaly removal operation on the edge detection image to obtain a target out-of-focus image, includes: The edge detection image is segmented and filled to obtain the target edge detection image, and the edge line pixels of the ring in the target edge detection image are extracted. The angle between adjacent normals within the edge line pixels is calculated based on the edge line pixels, where the normals are the normals of the target edge detection image; Based on the included angle between the adjacent normals, edge anomalies in the target edge detection image are removed to obtain the first inner and outer circle edge point data; The fitted ellipse is obtained by performing least squares fitting on the data of the first inner and outer circle edge points. Based on the first inner and outer circle edge point data and the fitted ellipse, the distance from the inner edge point of the edge line pixel to the fitted ellipse is determined; Based on the distance from the edge point within the edge line pixel to the fitted ellipse, abnormal points in the target edge detection image are removed to obtain the second inner and outer circle edge point data; The target out-of-focus image is obtained by least-squares fitting of the data of the second inner and outer circle edge points; The projection center determination module is used to determine the point array corresponding to the projection center of multiple rings on the ring calibration plate on the target defocused image; The focus image point matrix determination module normalizes the point array to obtain the point matrix of the focus image corresponding to the target out-of-focus image; The camera calibration module calibrates the camera based on the point matrix of the positive focus image.

Citation Information

Patent Citations

  • Method and device for determining actual center of out-of-focus concentric circle image in vision measurement

    CN115272448A