Camera calibration internal reference precision verification method, device and equipment and storage medium

By combining dedistortion processing, perspective transformation and multi-dimensional detection, the problem of insufficient accuracy of camera calibration internal parameter accuracy verification in the prior art is solved, and a more comprehensive and finer internal parameter accuracy verification effect is achieved.

CN119515986APending Publication Date: 2025-02-25SHENZHEN HANGSHENG ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411136896.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When verifying the accuracy of camera calibration internal parameters, the prior art is greatly affected by environmental factors, and the tangential distortion detection is not sensitive enough, making it difficult to accurately evaluate the accuracy of internal parameters.

Method used

By combining dedistortion processing, perspective transformation and multi-dimensional detection, a dedistortion image is obtained by performing dedistortion processing on the target image, and a first detection is performed; then a perspective transformation is performed on the dedistortion image to obtain a perspective transformation image, and a second detection is performed. When both the first detection result and the second detection result meet the standards, the test result of the calibration internal reference is determined to be passed.

Benefits of technology

It effectively solves the problem of how to more comprehensively and accurately verify and evaluate the accuracy of camera calibration internal parameters in internal parameter accuracy verification, achieves a more comprehensive and precise internal parameter accuracy verification effect, and improves the sensitivity of tangential distortion detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515986A_ABST
    Figure CN119515986A_ABST
Patent Text Reader

Abstract

The invention discloses a camera calibration internal reference precision verification method, device and equipment and a storage medium, and relates to the technical field of cameras, and the method comprises the steps: carrying out the distortion removal of a target image based on a calibration internal reference, and obtaining a distortion-removed image; performing first detection on the distorted image to obtain a first detection result; performing perspective transformation on the distorted image based on the target image to obtain a perspective transformation image; performing second detection on the perspective transformation image to obtain a second detection result; and when both the first detection result and the second detection result reach the standard, determining that the test result of the calibration internal reference is test pass. Through the scheme, a more comprehensive and fine internal reference precision verification effect is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of camera technology, and in particular to a method, device, equipment and storage medium for verifying the accuracy of camera calibration internal parameters. Background Art

[0002] With the rapid development of the intelligent driving industry, visual sensor cameras play an important role in measuring the speed and distance of targets. Camera manufacturers perform internal calibration for each camera and write the calibration results to the internal storage device. The accuracy of the internal parameters directly affects the accuracy of the camera's speed and distance measurement functions. At the same time, the large difference in the internal parameter accuracy of each camera will also lead to product consistency issues;

[0003] At present, most of the main internal parameter accuracy verification methods use the function of visual ranging to indirectly test the accuracy of the internal parameters. However, the above methods are greatly affected by environmental factors. For example, factors such as lighting conditions, background complexity, and obstructions may affect the image quality, thereby increasing the ranging error and affecting the evaluation of the accuracy of the internal parameters. Another verification method is to dedistort the image and determine whether the straightness of the originally straight object meets the requirements. However, this method may not be sensitive enough when evaluating tangential distortion, because the changes caused by tangential distortion may be relatively small, and it is difficult to accurately evaluate with simple straightness judgment.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a method, device, equipment and storage medium for verifying the accuracy of camera calibration internal parameters, aiming to solve the technical problem of how to more comprehensively and accurately test and evaluate the accuracy of camera calibration internal parameters.

[0006] To achieve the above purpose, the present application proposes a method for verifying the accuracy of camera calibration internal parameters, the method comprising:

[0007] Based on the calibration internal parameters, the target image is dedistorted to obtain a dedistorted image;

[0008] Performing a first detection on the dedistorted image to obtain a first detection result;

[0009] Based on the target image, performing perspective transformation on the dedistorted image to obtain a perspective transformed image;

[0010] Performing a second detection on the perspective transformed image to obtain a second detection result;

[0011] When both the first detection result and the second detection result meet the standard, the test result of the calibration internal reference is determined to be a test pass.

[0012] In one embodiment, the step of performing a first detection on the dedistorted image to obtain a first detection result includes:

[0013] Performing straightness detection and parallelism detection on the dedistorted image respectively to obtain a first detection result, and when both the straightness detection result and the parallelism detection result meet the standard, the first detection result meets the standard;

[0014] The step of performing a second detection on the perspective transformed image to obtain a second detection result comprises:

[0015] The perspective transformed image is subjected to straightness detection, parallelism detection and verticality detection to obtain a second detection result. When the straightness detection result, the parallelism detection result and the verticality detection result all meet the standard, the second detection result meets the standard.

[0016] In one embodiment, the step of performing parallelism detection on the dedistorted image includes:

[0017] Performing straight line fitting on points on the straight line in the dedistorted image to obtain a fitting straight line;

[0018] Determine whether the fitted straight lines close to the horizontal direction are parallel, and whether the fitted straight lines close to the vertical direction are parallel;

[0019] If the fitted straight lines in the horizontal direction are not parallel and / or the fitted straight lines in the vertical direction are not parallel, then obtaining a set of intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction;

[0020] Based on the set of intersection points, determining the farthest distances of the intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction respectively;

[0021] When the longest distance between the intersection points does not exceed a preset threshold, it is determined that the first parallelism detection result is a test pass.

[0022] In one embodiment, the step of performing parallelism detection and verticality detection on the perspective transformed image includes:

[0023] Performing straight line fitting on points on a straight line in the perspective transformed image to obtain a fitting straight line;

[0024] Obtaining the slope of the fitting straight line to obtain a slope set;

[0025] Based on the slope set, a first cumulative difference and a second cumulative difference are acquired, wherein the first cumulative difference is the inspection data of the parallelism detection, and the second cumulative difference is the inspection data of the perpendicularity detection;

[0026] When the first cumulative difference is within a first preset threshold range, determining that the second parallelism detection result is a test pass;

[0027] When the second accumulated difference is within a second preset threshold range, it is determined that the verticality detection result is a test pass.

[0028] In one embodiment, based on the slope set, the step of obtaining the first cumulative difference and the second cumulative difference comprises:

[0029] Obtaining the slope difference between the fitted straight lines that are nearly parallel to each other to obtain a first cumulative difference;

[0030] Obtain the product of the slopes of the fitted straight lines that are nearly perpendicular to each other, and perform a difference calculation between each slope product and -1 to obtain a second cumulative difference.

[0031] In one embodiment, the step of acquiring a perspective transformed image based on the target image and the dedistorted image includes:

[0032] Determining a homography matrix based on the pixel coordinates of the target corner points in the target image and the world coordinate points of the target corner points;

[0033] The dedistorted image is perspective transformed using the homography matrix to obtain a perspective transformed image.

[0034] In one embodiment, the calibration internal parameters include focal length and center offset, and before the step of performing dedistortion processing on the target image based on the calibration internal parameters to obtain the dedistorted image, the step further includes:

[0035] Determining a third detection result of the focal length according to the accuracy of the focal length;

[0036] Determine a fourth detection result of the center offset according to the accuracy of the center offset;

[0037] If the third test result and the fourth test result do not meet the standard, the test result of the calibration internal reference is determined to be a test failure, and the subsequent steps are not performed;

[0038] If both the third detection result and the fourth detection result meet the standard, the step of performing dedistortion processing on the target image based on the calibration internal reference is performed to obtain a dedistorted image.

[0039] In addition, to achieve the above purpose, the present application also proposes a camera calibration internal parameter accuracy verification device, the camera calibration internal parameter accuracy verification device comprising:

[0040] A dedistortion module performs dedistortion processing on the target image to obtain a dedistorted image;

[0041] A first detection module performs a first detection on the dedistorted image to obtain a first detection result;

[0042] A perspective transformation module, used for performing perspective transformation on the dedistorted image to obtain a perspective transformed image;

[0043] The second detection module is used to perform a second detection on the perspective transformed image to obtain a second detection result.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for verifying the accuracy of camera calibration internal parameters, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the camera calibration internal parameter accuracy verification method as described above.

[0045] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the camera calibration internal parameter accuracy verification method as described above are implemented.

[0046] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the camera calibration internal parameter accuracy verification method as described above.

[0047] One or more technical solutions proposed in this application have at least the following technical effects:

[0048] The technical solution of the present application adopts a technical means that combines de-distortion processing, perspective transformation and multi-dimensional detection. This method effectively solves the problem of how to more comprehensively and accurately test and evaluate the accuracy of the camera's calibration internal parameters in the internal parameter accuracy verification. Specifically, firstly, by de-distorting the target image, the image distortion caused by distortion is reduced and the detection accuracy is improved; then, the de-distorted image is mapped to a new perspective through perspective transformation, which further amplifies the impact of potential distortion on the image structure, making the detection of straightness, parallelism and perpendicularity more intuitive and accurate. In particular, the judgment of perpendicularity and parallelism after perspective transformation supplements the evaluation of tangential distortion and significantly improves the sensitivity of tangential distortion detection.

[0049] Compared with existing technologies, this method achieves a more comprehensive and detailed internal parameter accuracy verification effect. It no longer relies solely on a single visual distance measurement or straightness detection, but combines multiple technical means and detection dimensions to ensure accurate and reliable evaluation results under different distortion types. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0052] Figure 1 A flowchart of a camera calibration internal parameter accuracy verification method embodiment 1 provided in this application;

[0053] Figure 2 A schematic diagram of a parallelism detection process provided in Example 1 of the present application;

[0054] Figure 3 A flowchart of a method for verifying the accuracy of internal parameters of camera calibration provided in the second embodiment of the present application;

[0055] Figure 4 This is a schematic diagram of the module structure of a camera calibration internal parameter accuracy verification method device in an embodiment of the present application;

[0056] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in a method for verifying the accuracy of internal parameters of camera calibration in an embodiment of the present application.

[0057] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0058] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0059] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0060] It can be seen from the above embodiments that the technical solution of the present application adopts a technical means combining de-distortion processing, perspective transformation and multi-dimensional detection. This method effectively solves the problem of how to more comprehensively and accurately test and evaluate the accuracy of the camera's calibration internal parameters in the internal parameter accuracy verification, thereby achieving a more comprehensive and detailed internal parameter accuracy verification effect.

[0061] Based on this, the present application embodiment provides a method for verifying the accuracy of camera calibration internal parameters. Figure 1 , Figure 1 A flowchart diagram of a first embodiment of a method for verifying the accuracy of internal parameters of camera calibration provided in this application.

[0062] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown here.

[0063] The first embodiment of the present application provides a method for verifying the accuracy of camera calibration internal parameters, the verification method comprising steps S10 to S50:

[0064] Step S10, based on the calibration internal reference, dedistorting the target image to obtain a dedistorted image;

[0065] It should be noted that the camera calibration internal parameters mainly include the lens focal length (focal_x, focal_y), center coordinates (Center_x, Center_y), radial distortion coefficients (k1, k2, k3, k4), and tangential distortion coefficients (p1, p2); the target image is a plurality of images containing the standard calibration plate pattern taken by the camera. It is necessary to ensure that the corner points of the calibration plate in each image are clearly visible and the image quality is good.

[0066] In addition, it should be noted that after obtaining the target image, it needs to be dedistorted. The steps of dedistortion are as follows: obtain the camera's intrinsic matrix and distortion parameters through the camera calibration process. These parameters usually include focal length (focal_x, focal_y), center coordinates (Center_x, Center_y), radial distortion coefficients (k1, k2, k3, k4) and tangential distortion coefficients (p1, p2); use image processing libraries such as OpenCV to implement dedistortion processing. OpenCV provides the undistort() function, which can directly dedistort the image according to the intrinsic matrix and distortion parameters and finally return the dedistorted image.

[0067] Step S20, performing a first detection on the dedistorted image to obtain a first detection result;

[0068] It should be noted that the above-mentioned first detection includes straightness detection and parallelism detection. When the straightness detection result and the parallelism detection result both meet the standard, the first detection result meets the standard.

[0069] Reference Figure 2 , Figure 2 A schematic diagram of a parallelism detection process provided in the first embodiment of the present application, wherein the parallelism detection in step S20 may include the following steps:

[0070] S21, performing straight line fitting on points on the straight line in the dedistorted image to obtain a fitting straight line;

[0071] It should be noted that before performing straight line fitting on the dedistorted image, the pixel coordinates of the target corner points in the dedistorted image are first extracted. A feature detection algorithm (such as Harris corner detection, Shi-Tomasi corner detection, or a corner detection algorithm specifically used for chessboards, such as findChessboardCorners in OpenCV) can be used to identify the target corner points in the image. Subsequently, the target corner points in the dedistorted image are divided into two directions, nearly vertical and nearly horizontal, for straight line fitting to obtain a fitting line. Specifically, all corner point coordinates are traversed. The angle between the line connecting each point and the center of the image and the positive direction of the x-axis is calculated. According to the size of the angle, the corner points are divided into two groups: one group is nearly vertical (the angle is close to 90 degrees or 270 degrees), and the other group is nearly horizontal (the angle is close to 0 degrees or 180 degrees). A threshold (such as 10 degrees or less) is set to accurately assign the corner points to their respective groups. For each group of corner points, a straight line fitting algorithm (such as least squares method, RANSAC, etc.) is used to fit a straight line, and the fitted straight line is extended. Finally, the parameters of the fitted straight line (such as slope, intercept) and the extended straight line image are output.

[0072] S22, determining whether the fitted straight lines close to the horizontal direction are parallel, and whether the fitted straight lines close to the vertical direction are parallel;

[0073] It should be noted that after obtaining the fitted straight lines in the near horizontal direction and the near vertical direction, the slopes of the above-mentioned fitted straight lines are obtained, and it is determined whether the slope differences of the fitted straight lines in the near horizontal direction and the near vertical direction are within the preset threshold range. If they are within the preset threshold range, the corresponding fitted straight lines are considered to be parallel. If not, the corresponding fitted straight lines are considered to be not parallel.

[0074] It should be noted that if the judgment result of the above steps is that all the fitted straight lines are parallel, it can be considered that the parallelism detection result meets the standard. If the judgment result is that some of the fitted straight lines are parallel and some of the fitted straight lines are not parallel, it is necessary to continue to perform the following steps: If the fitted straight lines close to the horizontal direction are not parallel and / or the fitted straight lines close to the vertical direction are not parallel, then obtain the set of intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction.

[0075] S23, if the fitted straight lines in the horizontal direction are not parallel and / or the fitted straight lines in the vertical direction are not parallel, obtaining a set of intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction;

[0076] It can be understood that if the straight lines are judged not to be parallel (in fact, they are parallel in three-dimensional space), then according to the principle of perspective transformation, the extension lines of the two straight lines will intersect at a point (vanishing point) in the image.

[0077] S24, based on the set of intersection points, determining the farthest distances of the intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction respectively;

[0078] It should be noted that whether the farthest distance of the intersection is within the threshold range is determined because the farthest distance of the intersection can more intuitively reflect the degree of non-parallelism between the straight lines, while the shortest distance may be affected by factors such as noise and error and is not accurate enough.

[0079] S25, when the longest distance between the intersection points does not exceed a preset threshold, determining that the first parallelism detection result is a test pass.

[0080] It should be noted that a specific positional relationship between the target and the camera is preset, and two thresholds in the near horizontal direction and the near vertical direction are set according to this relationship. These two thresholds represent the maximum allowable range of the intersection of the fitting straight line.

[0081] In addition, it should be noted that when only one intersection point is generated, it is only necessary to determine whether the farthest distance of the intersection points in this direction is within the threshold range.

[0082] It is understandable that distortion is a common problem in the camera imaging process, mainly including radial distortion and tangential distortion. Distortion will cause the straight lines in the image to become curved visually, thus affecting the image quality and analysis results. The de-distortion process corrects the intrinsic parameter matrix through the known distortion coefficient so that the straight lines in the image are restored to the original straight lines. Therefore, whether the straight lines formed by the target corner points in the de-distorted image are parallel is an important basis for verifying the accuracy of the distortion coefficient.

[0083] It should be noted that the above steps S21 to S25 are an implementation method of the levelness detection in the above step S20. The implementation process of the straightness detection will be described in detail below. If the first detection result in step S20 is not up to standard, the test result of the calibration internal parameter is judged to be a passed test, and the subsequent steps will no longer be executed.

[0084] Step S30, based on the target image, performing perspective transformation on the dedistorted image to obtain a perspective transformed image;

[0085] In a feasible implementation, step S30 may include steps S31 to S32:

[0086] S31, determining a homography matrix based on the pixel coordinates of the target corner points in the target image and the world coordinate points of the target corner points;

[0087] It is understood that the homography matrix is ​​a 3x3 matrix, which is usually used to describe the mapping relationship between two planes, such as from one image plane to another image plane, or from an image plane to a plane in the three-dimensional world (when the Z coordinate of the plane is fixed). In the embodiment of the present application, the world coordinate system is fixed on the target, the world coordinate Z axis of the target corner point is 0, and the homography matrix is ​​used to describe the mapping from the world coordinates of the target corner point (Z=0) to the pixel coordinates of the target corner point in the distorted image.

[0088] S32, performing perspective transformation on the dedistorted image using the homography matrix to obtain a perspective transformed image.

[0089] It is understandable that in the perspective transformed image, if there is an error in the calibration internal parameters, the straight line may no longer maintain its original straightness, parallelism or perpendicularity. These errors may be caused by various factors such as focal length, center position, distortion coefficient, etc. If these geometric characteristics are not judged, these potential errors may not be discovered. Therefore, a subsequent second test of the perspective transformed image is required.

[0090] Step S40, performing a second detection on the perspective transformed image to obtain a second detection result;

[0091] It should be noted that the above-mentioned second detection includes straightness detection, parallelism detection and verticality detection. When the straightness detection result, the parallelism detection result and the verticality detection result all meet the standards, the second detection result meets the standards.

[0092] In a feasible implementation, the parallelism detection and verticality detection in step S40 may include steps S41 to S45:

[0093] S41, performing straight line fitting on points on the straight line in the perspective transformed image to obtain a fitting straight line;

[0094] It should be noted that step S41 is basically the same as the above step S21 and will not be described again here.

[0095] S42, obtaining the slope of the fitting straight line to obtain a slope set;

[0096] S43, based on the slope set, obtaining a first cumulative difference and a second cumulative difference;

[0097] In a feasible implementation, step S43 may include steps S431 to S432:

[0098] S431, obtaining the slope difference between the fitted straight lines that are nearly parallel to each other to obtain a first cumulative difference;

[0099] It should be noted that for each fitted straight line detected, its slope is calculated. The slope may be infinite (for vertical lines). Other representation methods (such as angles or the inverse of slopes) can be used to group the fitted straight lines into potential parallel line sets according to the slopes. A slope difference threshold is set to group straight lines with similar slopes into the same group. For each parallel line group, the slope difference between all straight lines in the group is calculated. For each parallel line group, the cumulative value of all slope differences is calculated, which can be the sum of the absolute values ​​of the differences or the sum of squares, which is the first cumulative difference. The first cumulative difference of each group is compared with the preset threshold to determine the parallelism of the image. If the cumulative differences of all groups are within the first preset threshold, it can be considered that the parallelism of the image is good.

[0100] S432, obtaining the slope product between the nearly mutually perpendicular fitting straight lines, and performing a difference calculation between each slope product and -1 to obtain a second cumulative difference.

[0101] It should be noted that for each detected fitting line, its slope is calculated. The slope may be infinite (for vertical lines). Other representation methods (such as the angle or the reciprocal of the slope) can be used to filter out nearly vertical lines based on the slope. For the vertical lines that have been filtered out, the slope product (or the cosine value of the angle difference) is calculated for each pair and compared with -1. The absolute value or square sum of the difference between all slope products and -1 is calculated as the second cumulative difference, and the second cumulative difference is compared with the second preset threshold to determine the verticality of the image.

[0102] S44, when the first cumulative difference is within a first preset threshold range, determining that the second parallelism detection result is a test pass;

[0103] S45: When the second accumulated difference is within a second preset threshold range, determine that the verticality detection result is a test pass.

[0104] As described above, both step S20 and step S40 include straightness detection, and both step S20 and step S40 can use the following straightness detection method:

[0105] First, the pixel coordinates of the target corner points in the target image are extracted. The target image may be a dedistorted image or a perspective transformed image.

[0106] According to the layout of the target, the corner points are grouped into horizontal and vertical lines;

[0107] Fit a straight line using methods such as least squares or RANSAC;

[0108] For each corner point, use the point-to-line distance formula to calculate its distance to the fitted line;

[0109] Sum the distances of all points to get the error sum;

[0110] If the error sum is within the preset threshold range, the straightness test result is considered to be up to standard; otherwise, the straightness test result is considered to be unsatisfactory.

[0111] Step S50: When both the first detection result and the second detection result meet the standard, the test result of the calibration internal reference is determined to be a test pass.

[0112] Reference Figure 3 , Figure 3 A flow chart of a camera calibration internal parameter accuracy verification method provided in the second embodiment of the present application. In another embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above introduction and will not be repeated later.

[0113] Before step S10, the camera calibration internal parameter accuracy verification method further includes steps S01 to S04:

[0114] S01, determining a third detection result of the focal length according to the accuracy of the focal length;

[0115] It should be noted that the accuracy of the focal length is determined by judging whether the actual focal length (focal_x, focal_y) of the camera is within a reasonable error range of the theoretically calculated value.

[0116] The theoretical value of focal_x is the effective focal length of the lens EFL / CMOS horizontal pixel size dx;

[0117] The theoretical value of focal_y is the effective focal length of the lens EFL / CMOS longitudinal pixel size dy;

[0118] For focal_x, the allowed range is [EFL / dx-threshold, EFL / dx+threshold];

[0119] For focal_y, the allowed range is [EFL / dy-threshold, EFL / dy+threshold];

[0120] If the value of focal_x is within its allowable range [EFL / dx-threshold, EFL / dx+threshold], and the value of focal_y is within its allowable range [EFL / dy-threshold, EFL / dy+threshold], then it is considered that the third detection result meets the standard;

[0121] If any parameter of focal_x and focal_y does not meet the standard, it is considered that the third detection result does not meet the standard.

[0122] S02, determining a fourth detection result of the center offset according to the accuracy of the center offset;

[0123] It should be noted that Center_x and Center_y are the center points of the image, the image resolution is (x, y), and the first threshold a and the second threshold b are set;

[0124] For Center_x, the allowed range is [xa, x+a];

[0125] For Center_y, the allowed range is [yb, y+b];

[0126] If the value of Center_x is within its allowable range [xa, x+a], and the value of Center_y is within its allowable range [xa, x+a], then it is considered that the fourth test result meets the standard;

[0127] If any parameter of Center_x and Center_y does not meet the standard, it is considered that the fourth detection result does not meet the standard.

[0128] S03, if the third test result and the fourth test result do not meet the standard, determine that the test result of the calibration internal reference is a test failure, and do not execute subsequent steps;

[0129] S04, if both the third detection result and the fourth detection result meet the standard, then execute the step: based on the calibration internal reference, dedistort the target image to obtain a dedistorted image.

[0130] It should be noted that steps S01 to S04 can be executed before step S10 or after step S10. The execution order of steps S01 to S04 does not affect the judgment of the final detection result, but can improve the verification efficiency of the accuracy of the camera calibration internal parameters. If it is executed in the first step, it can be used as a prior judgment. If the calibrated focal length and center have been detected as substandard data in the first step, the subsequent detection process can be directly abandoned, and the detection result of the calibration internal parameters is determined to be failed. It can be understood that steps S01 to S04 are executed in the first step as the best implementation method in the embodiment of the present application, and the execution order of steps S01 to S04 in the present application is not limited here.

[0131] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for verifying the accuracy of internal parameters of camera calibration in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0132] This application also provides a camera calibration internal parameter accuracy verification device, please refer to Figure 4 , the camera calibration internal parameter accuracy verification device comprises:

[0133] The dedistortion module 10 is used to perform dedistortion processing on the target image to obtain a dedistorted image;

[0134] A first detection module 20, configured to perform a first detection on the dedistorted image to obtain a first detection result;

[0135] A perspective transformation module 30, configured to perform perspective transformation on the dedistorted image to obtain a perspective transformed image;

[0136] The second detection module 40 is used to perform a second detection on the perspective transformed image to obtain a second detection result.

[0137] The camera calibration internal parameter accuracy verification device provided by the present application adopts the camera calibration internal parameter accuracy verification method in the above-mentioned embodiment, which can solve the technical problem of how to more comprehensively and accurately test and evaluate the accuracy of the camera calibration internal parameter. Compared with the prior art, the beneficial effects of the camera calibration internal parameter accuracy verification device provided by the present application are the same as the beneficial effects of the camera calibration internal parameter accuracy verification method provided by the above-mentioned embodiment, and the other technical features in the camera calibration internal parameter accuracy verification device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0138] The present application provides a camera calibration internal parameter accuracy verification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the camera calibration internal parameter accuracy verification method in the above-mentioned embodiment.

[0139] Reference below Figure 5 , which shows a schematic diagram of the structure of a camera calibration internal parameter accuracy verification device suitable for implementing the embodiment of the present application. The camera calibration internal parameter accuracy verification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The camera calibration internal parameter accuracy verification device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0140] like Figure 5As shown, the camera calibration internal parameter accuracy verification device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the camera calibration internal parameter accuracy verification device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the camera calibration internal parameter accuracy verification device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a camera calibration internal parameter accuracy verification device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0141] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0142] The camera calibration internal parameter accuracy verification device provided by the present application adopts the camera calibration internal parameter accuracy verification method in the above embodiment, which can solve the technical problem of how to more comprehensively and accurately test and evaluate the accuracy of the camera calibration internal parameter. Compared with the prior art, the beneficial effects of the camera calibration internal parameter accuracy verification device provided by the present application are the same as the beneficial effects of the camera calibration internal parameter accuracy verification method provided by the above embodiment, and the other technical features in the camera calibration internal parameter accuracy verification device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0143] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0145] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the camera calibration internal parameter accuracy verification method in the above-mentioned embodiment.

[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0147] The above-mentioned computer-readable storage medium may be included in the camera calibration internal parameter accuracy verification device; or it may exist independently without being assembled into the camera calibration internal parameter accuracy verification device.

[0148] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0149] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0150] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0151] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned camera calibration internal parameter accuracy verification method, and can solve the technical problem of how to more comprehensively and accurately test and evaluate the accuracy of the camera calibration internal parameters. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the camera calibration internal parameter accuracy verification method provided in the above-mentioned embodiment, and will not be repeated here.

[0152] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned camera calibration internal parameter accuracy verification method.

[0153] The computer program product provided by the present application can solve the technical problem of how to more comprehensively and accurately test and evaluate the accuracy of the calibration internal parameters of the camera. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the camera calibration internal parameter accuracy verification method provided by the above embodiment, which will not be repeated here.

[0154] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A camera calibration internal parameter accuracy verification method, characterized in that: The method comprises: Based on the calibration internal parameters, the target image is dedistorted to obtain a dedistorted image; Performing a first detection on the dedistorted image to obtain a first detection result; Based on the target image, performing perspective transformation on the dedistorted image to obtain a perspective transformed image; Performing a second detection on the perspective transformed image to obtain a second detection result; When both the first detection result and the second detection result meet the standard, the test result of the calibration internal reference is determined to be a test pass.

2. The method according to claim 1, characterized in that The step of performing a first detection on the dedistorted image to obtain a first detection result comprises: Performing straightness detection and parallelism detection on the dedistorted image respectively to obtain a first detection result, and when both the straightness detection result and the parallelism detection result meet the standard, the first detection result meets the standard; The step of performing a second detection on the perspective transformed image to obtain a second detection result comprises: The perspective transformed image is subjected to straightness detection, parallelism detection and verticality detection to obtain a second detection result. When the straightness detection result, the parallelism detection result and the verticality detection result all meet the standard, the second detection result meets the standard.

3. The method according to claim 2, characterized in that The step of performing parallelism detection on the dedistorted image comprises: Performing straight line fitting on points on the straight line in the dedistorted image to obtain a fitting straight line; Determine whether the fitted straight lines close to the horizontal direction are parallel, and whether the fitted straight lines close to the vertical direction are parallel; If the fitted straight lines in the horizontal direction are not parallel and / or the fitted straight lines in the vertical direction are not parallel, then obtaining a set of intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction; Based on the set of intersection points, determining the farthest distances of the intersection points of the fitted straight lines in the horizontal direction and / or the vertical direction respectively; When the longest distance between the intersection points does not exceed a preset threshold, it is determined that the first parallelism detection result is a test pass.

4. The method according to claim 2, characterized in that The steps of performing parallelism detection and verticality detection on the perspective transformed image include: Performing straight line fitting on points on a straight line in the perspective transformed image to obtain a fitting straight line; Obtaining the slope of the fitting straight line to obtain a slope set; Based on the slope set, a first cumulative difference and a second cumulative difference are acquired, wherein the first cumulative difference is the inspection data of the parallelism detection, and the second cumulative difference is the inspection data of the perpendicularity detection; When the first cumulative difference is within a first preset threshold range, determining that the second parallelism detection result is a test pass; When the second accumulated difference is within a second preset threshold range, it is determined that the verticality detection result is a test pass.

5. The method according to claim 4, characterized in that The step of obtaining the first cumulative difference and the second cumulative difference based on the slope set comprises: Obtaining the slope difference between the fitted straight lines that are nearly parallel to each other to obtain a first cumulative difference; Obtain the product of the slopes of the fitted straight lines that are nearly perpendicular to each other, and perform a difference calculation between each slope product and -1 to obtain a second cumulative difference.

6. The method according to claim 1, characterized in that The step of acquiring a perspective transformed image based on the target image and the dedistorted image comprises: Determining a homography matrix based on the pixel coordinates of the target corner points in the target image and the world coordinate points of the target corner points; The dedistorted image is perspective transformed using the homography matrix to obtain a perspective transformed image.

7. The method according to claim 1, characterized in that The calibration internal parameters include focal length and center offset. Before the step of performing dedistortion processing on the target image based on the calibration internal parameters to obtain the dedistorted image, the step further includes: Determining a third detection result of the focal length according to the accuracy of the focal length; Determine a fourth detection result of the center offset according to the accuracy of the center offset; If the third test result and the fourth test result do not meet the standard, the test result of the calibration internal reference is determined to be a test failure, and the subsequent steps are not performed; If both the third detection result and the fourth detection result meet the standard, the step of performing dedistortion processing on the target image based on the calibration internal reference is performed to obtain a dedistorted image.

8. A camera calibration internal parameter accuracy verification device, characterized in that: The device for verifying the accuracy of the camera calibration internal parameters includes: A dedistortion module is used to perform dedistortion processing on the target image to obtain a dedistorted image; A first detection module, used to perform a first detection on the dedistorted image to obtain a first detection result; A perspective transformation module, used for performing perspective transformation on the dedistorted image to obtain a perspective transformed image; The second detection module is used to perform a second detection on the perspective transformed image to obtain a second detection result.

9. A device for verifying the accuracy of camera calibration internal parameters, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the camera calibration internal parameter accuracy test method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the camera calibration internal parameter accuracy test method according to any one of claims 1 to 7 are implemented.