A camera production line calibration verification integrated method, system, computer device and storage medium

Through Zhang Zhengyou's calibration method and de-distortion operation, the problems of frequent manual operations and low efficiency in camera production line calibration and verification were solved, and automated camera parameter verification and ranging error calculation were realized, thereby improving test efficiency and applicability.

CN119338922BActive Publication Date: 2025-10-21SHANGHAI YANDING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411580530.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-10-21
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

In the existing technology, camera calibration and verification require the establishment of a separate experimental environment, which requires a lot of manual operation and has low test efficiency, and cannot meet the needs of camera production line calibration and verification.

Method used

The camera is calibrated using the Zhang Zhengyou calibration method. The pixel coordinates of the feature points are obtained through dedistortion operation. The feature points are reconstructed on the Zw=0 plane of the world coordinate system. The distance between the reconstructed feature points is calculated and compared with the actual distance to obtain the ranging error, thereby verifying the camera parameters.

Benefits of technology

It realizes the automation of camera production line calibration and verification, improves test efficiency, reduces manual operations, saves costs, and is suitable for calibration and verification of camera production lines with a variety of field of view ranges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338922B_ABST
    Figure CN119338922B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of camera calibration, and particularly relates to a camera production line calibration and verification integrated method and system, a computer device and a storage medium. A camera is calibrated by using Zhang Zhengyou calibration method to obtain camera calibration parameters; an image is subjected to a distortion removal operation to obtain feature point pixel coordinates after distortion removal; feature points are reconstructed on a Z w =0 plane in a world coordinate system to obtain feature point reconstruction coordinates; distances between the reconstruction feature points are calculated and compared with actual distances to obtain ranging errors, thereby realizing verification of camera parameters. The application is used to solve the problem in the prior art that camera calibration and verification need to be built respectively, more manual operations are needed in the process, the test efficiency is relatively low, and the demand of camera production line calibration and verification cannot be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of camera calibration technology, and specifically relates to an integrated camera production line calibration and verification method, system, computer equipment and storage medium. Background Art

[0002] With the development of machine vision and artificial intelligence technologies, reconstructing and perceiving the surrounding environment through images (3D vision) has become a hot research topic in academia and industry, with widespread applications in video surveillance, visual navigation, industrial inspection, remote sensing, and other fields. To determine the correspondence between the spatial position of an object and its image position, it is necessary to establish a camera geometric model and obtain its parameters through camera calibration. The accuracy of camera calibration directly affects the precision of 3D reconstruction and environmental perception, and is a key foundational research topic in the field of machine vision.

[0003] Currently, reprojection error is commonly used to evaluate the accuracy of camera calibration. This is the difference between the actual imaging position of an object on the image plane and the projected position calculated using a geometric model. However, in applications such as machine vision, photogrammetry, and 3D reconstruction, it is necessary to obtain the spatial position relationship of objects. The reprojection error in pixels cannot intuitively reflect the calibration accuracy of the camera. In existing technologies, the accuracy of camera calibration is effectively verified through triangulation ranging experiments. Although the ranging error in millimeters can be output to reflect the accuracy of camera calibration, the camera calibration and verification experiments require separate experimental environments, which requires a lot of manual operation and low test efficiency, and cannot meet the calibration and verification needs of camera production lines. Summary of the Invention

[0004] The present invention provides an integrated method for camera production line calibration and verification, which is used to solve the problems in the prior art that experimental environments need to be set up separately, a lot of manual operations are required during the process, the test efficiency is low, and the needs of camera production line calibration and verification cannot be met.

[0005] The present invention provides a camera production line calibration and verification integrated system, which is used to implement a camera production line calibration and verification integrated method.

[0006] The present invention provides a computer device for running a step algorithm flow of an integrated method for camera production line calibration and verification.

[0007] The present invention provides a storage medium for storing a step algorithm flow of an integrated method for camera production line calibration and verification.

[0008] The present invention is achieved through the following technical solutions:

[0009] A camera production line calibration and verification integrated method, the method comprising the following steps:

[0010] Step 1: Use Zhang Zhengyou calibration method to calibrate the camera and obtain the camera calibration parameters;

[0011] Step 2: Dedistort the image based on the camera calibration parameters to obtain pixel coordinates of the dedistorted feature points;

[0012] Step 3: Based on the pixel coordinates of the feature points after dedistortion, in the world coordinate system Z w =0 plane reconstruction feature points, obtain the reconstruction coordinates of the feature points;

[0013] Step 4: Reconstruct the coordinates based on the feature points, calculate the distance between the reconstructed feature points, and compare it with the actual distance to obtain the ranging error, thereby verifying the camera parameters.

[0014] Furthermore, the step 1 specifically includes the following steps:

[0015] Step 1.1: Use the camera to be calibrated to take multiple images of the calibration plate and obtain the pixel coordinates of the feature points;

[0016] Step 1.2: Establish a mapping relationship between the pixel coordinates of the feature point image coordinate system and the coordinates of the feature point world coordinate system, calibrate the camera according to the mapping relationship, and obtain the camera calibration parameters.

[0017] Furthermore, the step 1.1 also includes the following: if there are problems such as uneven lighting, camera defocus, and excessive image noise during the calibration plate image capture process;

[0018] The reprojection error of each image is calculated based on the initial calibration, and abnormal images with excessively large reprojection errors are eliminated. The calibration plate image of the eliminated image pose is captured, and the camera is recalibrated.

[0019] According to the camera distortion model,

[0020]

[0021] In the formula, (x dist ,y dist ) is the coordinate of the distortion feature point in the imaging coordinate system; (x, y) is the coordinate of the ideal distortion-free feature point in the imaging coordinate system, where k1, k2, and k3 are radial distortion coefficients; p1 and p2 are tangential distortion coefficients; the initial solution of the internal and external parameters is solved through the homography relationship between the feature point coordinate M in the world coordinate system and the pixel coordinate m in the image coordinate system; then the solved internal and external parameters and distortion coefficients are globally optimized with the goal of minimizing the reprojection error.

[0022] The expression for minimizing the reprojection error is:

[0023]

[0024] Where m ij is the pixel coordinate of the jth (j=1,…,m) feature point on the ith (i=1,…,n) captured image, m′ ij are the pixel coordinates of the reprojected feature points calculated according to the camera geometry model.

[0025] Furthermore, the step 2 is specifically as follows: assuming that the pixel coordinates m of the feature point image coordinate system detected on the distorted image are dist for (u dist ,v dist ), the imaging coordinate system coordinate of the feature point is (x dist ,y dist ), on the undistorted image, the pixel coordinate m of the image coordinate system corresponding to the feature point is (u, v), and the coordinate of the imaging coordinate system is (x, y).

[0026] The dedistortion operation is performed through the dedistortion model to obtain the pixel coordinate m of the dedistorted image coordinate system as (u, v).

[0027] Furthermore, the dedistortion model includes a radial distortion model and a tangential distortion model.

[0028] Furthermore, the step 3 is specifically as follows: suppose the reconstructed feature points are in the world coordinate system Z w = 0 plane, then:

[0029]

[0030] Where u and v are pixel coordinates in the image coordinate system, X w is the value of the world coordinate system in the X direction, w is the value of the Y direction of the world coordinate system, R is the rotation matrix in the external parameters, K is the internal parameter matrix, T is the translation vector in the external parameters, Z c is depth information;

[0031] Solve the depth information Z c , and then use the camera inverse projection formula to obtain the world coordinates M′ of the feature point to be measured i , M′ j ,

[0032]

[0033] Where Z ci , Z cj They are feature points M′ i , M′ j The corresponding depth information.

[0034] Furthermore, the step 4 is specifically to obtain the distance to be measured L' using the reconstructed world coordinate system coordinates of the feature pointij ,

[0035] L′ ij =||M′ i -M′ j ||2 (10)

[0036] Among them, M′ i , M′ j is the world coordinate of the feature point to be measured, ||||2 is the modulus of the vector;

[0037] L′ ij The actual distance L from the feature point ij Comparison to obtain the relative error ε of ranging,

[0038]

[0039] After the ranging is completed, the camera calibration parameters, reprojection error and relative ranging error are output.

[0040] A camera production line calibration and verification integrated system, the system uses the camera production line calibration and verification integrated method as described above, the system includes:

[0041] The camera calibration module uses the Zhang Zhengyou calibration method to calibrate the camera and obtain the camera calibration parameters;

[0042] The image dedistortion module dedistorts the image based on the camera calibration parameters to obtain the pixel coordinates of the feature points after dedistortion;

[0043] The feature point reconstruction module is based on the pixel coordinates of the feature points after dedistortion, in the world coordinate system Z w =0 plane reconstruction feature points, obtain the reconstruction coordinates of the feature points;

[0044] The parameter verification module calculates the distance between the reconstructed feature points based on the coordinates of the feature points, and compares it with the actual distance to obtain the ranging error, thereby verifying the camera parameters.

[0045] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described above is implemented.

[0046] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0047] The beneficial effects of the present invention are:

[0048] The present invention is used to improve the efficiency of calibration and verification of camera production lines.

[0049] The present invention can simultaneously complete ranging verification experiments on existing camera production line calibration equipment without the need to configure a separate ranging verification environment, and can obtain camera parameters, reprojection errors and ranging experiment results at one time.

[0050] The present invention has the advantages of high degree of automation, improved production line calibration and verification efficiency, and cost savings.

[0051] The present invention is not limited to a specific camera geometric model and is widely applicable to the calibration and verification of camera production lines with a variety of field of view ranges. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a flow chart of the method of the present invention.

[0053] Figure 2 2. It is a schematic diagram of the camera ranging verification experiment of the present invention.

[0054] Figure 3 These are the experimental results of the reprojection error and ranging error of the present invention.

[0055] Figure 4 The characteristic point of the present invention is in the world coordinate system Z w = 0 plane reconstruction diagram.

[0056] Figure 5 It is a system schematic diagram of the present invention.

[0057] Figure 6 It is a schematic diagram of a computer device of the present invention. DETAILED DESCRIPTION

[0058] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present application with unnecessary details.

[0059] It will be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0060] It should also be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0061] The following is attached to this application specification Figure 1-4 , clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of this application.

[0062] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.

[0063] Example 1

[0064] This embodiment provides an integrated method for camera production line calibration and verification. Figure 1 As shown, the method includes the following steps:

[0065] Step 1: Use Zhang Zhengyou calibration method to calibrate the camera and obtain the camera calibration parameters;

[0066] Step 1.1: Use the camera to be calibrated to take multiple images of the calibration plate and obtain the pixel coordinates of the feature points; the calibration plate pattern includes but is not limited to one or more combinations of checkerboard, circular spots, field grid, BMW pattern and ChArUco; use a checkerboard calibration plate with known number of rows, columns and feature point spacing. The calibration plate should be as flat as possible and the calibration pattern should be as clear as possible. Take multiple images of the calibration plate in different postures, and the feature points should cover the entire field of view of the camera as much as possible. This embodiment uses a checkerboard calibration plate with 4 rows and 5 columns of feature points and a feature point spacing of 31 mm, and takes 10 calibration images with the calibration plate located in the center, top, bottom, left, right, top left, bottom left, top right, and bottom right of the image;

[0067] The Harris corner detection algorithm is used to extract the sub-pixel coordinates of the feature points. In this embodiment, the sub-pixel corner refinement window size is set to (11, 11), the number of iterations is 30, and the iteration accuracy is 0.001.

[0068] Furthermore, the step 1.1 also includes the following: if there are problems such as uneven lighting, camera defocus, and excessive image noise during the calibration plate image capture process;

[0069] The reprojection error of each image is calculated based on the initial calibration, and abnormal images with excessively large reprojection errors are eliminated. The calibration plate image of the eliminated image pose is captured, and the camera is recalibrated.

[0070] Step 1.2: Establish a mapping relationship between the pixel coordinates of the feature point image coordinate system and the coordinates of the feature point world coordinate system, calibrate the camera according to the mapping relationship, and obtain the camera calibration parameters.

[0071] By obtaining the homography relationship between the world coordinates and pixel coordinates of the feature points on multiple images, the projection equation is established to solve the parameters of the pinhole camera model and construct the world coordinate system (O w -X w Y w Z w ), camera coordinate system (O c -X c Y c Z c ), imaging coordinate system (O-xy) and image coordinate system (O pix -uv). According to the pinhole model, the relationship between the feature point world coordinate system coordinate M and the feature point image coordinate system coordinate m can be expressed as:

[0072]

[0073] Where Z c is the depth information, f x , f y are the focal lengths of the camera in the x and y directions of the imaging coordinate system, u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system, K is the intrinsic parameter matrix; R and T are the rotation matrix and translation vector in the extrinsic parameters, respectively.

[0074] According to the camera distortion model,

[0075]

[0076] In the formula, (x dist ,y dist ) is the coordinate of the distortion feature point in the imaging coordinate system; (x, y) is the coordinate of the ideal distortion-free feature point in the imaging coordinate system, where k1, k2, k3 are radial distortion coefficients; p1 and p2 are tangential distortion coefficients; the initial solution of the internal and external parameters is solved through the homography relationship between the feature point coordinate M in the world coordinate system and the pixel coordinate m in the image coordinate system; then the solved internal and external parameters and distortion coefficients are globally optimized with the goal of minimizing the reprojection error.

[0077] The expression for minimizing the reprojection error is:

[0078]

[0079] Where m ij is the pixel coordinate of the jth (j=1,…,m) feature point on the ith (i=1,…,n) captured image, m′ ij are the pixel coordinates of the reprojected feature points calculated according to the camera geometry model.

[0080] This embodiment uses the Levenberg-Marquardt optimization algorithm for iterative solution, the number of iterations is set to 500 times, and the iterative convergence accuracy is set to 1e-8.

[0081] Step 2: Dedistort the image based on the camera calibration parameters in step 1 to obtain the pixel coordinates of the dedistorted feature points.

[0082] Furthermore, let the pixel coordinates m of the feature point image coordinate system detected on the distorted image be dist for (u dist ,v dist ), the imaging coordinate system coordinate of the feature point is (x dist ,y dist ), on the undistorted image, the pixel coordinate m of the image coordinate system corresponding to the feature point is (u, v), and the coordinates of the imaging coordinate system are (x, y);

[0083] The dedistortion operation is performed through the dedistortion model to obtain the pixel coordinate m of the dedistorted image coordinate system as (u, v).

[0084] Furthermore, the dedistortion model includes a radial distortion model and a tangential distortion model.

[0085] This embodiment uses the following method to perform dedistortion based on the conversion relationship between the image coordinate system and the imaging coordinate system:

[0086]

[0087] Where, f x , f y are the focal lengths of the camera in the x and y directions of the imaging coordinate system, u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system.

[0088] The obtained (x dist ,y dist ) as the initial value (x0,y0),

[0089]

[0090] The dedistorted imaging coordinate system (x, y) can be obtained by repeatedly iterating the distortion model.

[0091]

[0092] When the number of iterations or the iteration accuracy requirement is reached, the iteration is exited; the x obtained by the iteration n ,y n As the imaging coordinate system coordinates (x, y) on the undistorted image;

[0093] According to the conversion relationship between the image coordinate system and the imaging coordinate system,

[0094]

[0095] Through the above process, the pixel coordinate m of the dedistorted image coordinate system can be obtained as (u, v).

[0096] Step 3: Based on the pixel coordinates of the feature points after dedistortion in step 2, in the world coordinate system Z w =0 plane reconstruction feature points, obtain the reconstruction coordinates of the feature points;

[0097] Assume that the reconstructed feature points are in the world coordinate system Z w = 0 plane, then:

[0098]

[0099] Where u and v are pixel coordinates in the image coordinate system, X w is the value of the X-axis direction of the world coordinate system, Y w is the value of the Y axis direction of the world coordinate system, R is the rotation matrix in the external parameters, K is the internal parameter matrix, T is the translation vector in the external parameters, Z c is depth information;

[0100] The third dimension on both sides of the equation has only one unknown quantity Z c , solving this equation gives the depth information Z c .

[0101] Solve the depth information Z c , and then use the camera inverse projection formula to obtain the world coordinates M′ of the feature point to be measured i , M′ j ,

[0102]

[0103] Where Z ci , Z cj They are feature points M′ i , M′ j The corresponding depth information.

[0104] Step 4: Reconstruct the coordinates based on the feature points in step 3, calculate the distance between the reconstructed feature points, and compare it with the actual distance to obtain the ranging error to verify the camera parameters;

[0105] The distance to be measured L' is obtained by using the reconstructed world coordinates of the feature points ij ,

[0106] L′ ij =||M′ i -M′ j ||2 (10)

[0107] Among them, M′ i , M′ j is the world coordinate of the feature point to be measured, ‖‖2 is the modulus of the vector;

[0108] L′ ij The actual distance L from the feature point ij The actual distance between the upper left corner feature point and the lower right corner feature point of the checkerboard calibration plate measured in this embodiment is 155mm.

[0109]

[0110] After the ranging is completed, the camera calibration parameters, reprojection error and relative ranging error are output.

[0111] Example 2

[0112] This embodiment provides an integrated system for camera production line calibration and verification. Figure 5 As shown, the system uses a camera production line calibration and verification integrated method as described in Example 1, and the system includes:

[0113] The camera calibration module uses the Zhang Zhengyou calibration method to calibrate the camera to obtain the camera calibration parameters, and then performs global optimization based on the camera distortion model;

[0114] The specific working process of the camera calibration module is to use the camera to be calibrated to shoot multiple calibration plate images and obtain the pixel coordinates of the feature points; the calibration plate pattern includes but is not limited to one or more combinations of checkerboard, circular spots, field grid, BMW pattern and ChArUco; a checkerboard calibration plate with known number of rows, columns and feature point spacing is used. The calibration plate is as flat as possible and the calibration pattern is as clear as possible. Multiple calibration plate images of different postures are taken, and the feature points cover the entire field of view of the camera as much as possible. This embodiment uses a checkerboard calibration plate with 4 rows and 5 columns of feature points and a feature point spacing of 31mm. 10 calibration images are taken with the calibration plate located in the center, top, bottom, left, right, top left, bottom left, top right, and bottom right of the image.

[0115] The Harris corner detection algorithm is used to extract the sub-pixel coordinates of the feature points. In this embodiment, the sub-pixel corner refinement window size is set to (11, 11), the number of iterations is 30, and the iteration accuracy is 0.001.

[0116] Furthermore, if there are problems such as uneven lighting, camera defocus, or excessive image noise during the calibration plate image capture process,

[0117] The reprojection error of each image is calculated based on the initial calibration, and abnormal images with excessively large reprojection errors are eliminated. The calibration plate image of the eliminated image pose is captured, and the camera is recalibrated.

[0118] Furthermore, a mapping relationship between the pixel coordinates of the feature point image coordinate system and the coordinates of the feature point world coordinate system is established, and the camera is calibrated according to the mapping relationship to obtain the camera calibration parameters.

[0119] By obtaining the homography relationship between the world coordinates and pixel coordinates of the feature points on multiple images, the projection equation is established to solve the parameters of the pinhole camera model and construct the world coordinate system (O w -X w Y w Z w ), camera coordinate system (O c -X c Y c Z c ), imaging coordinate system (O-xy) and image coordinate system (O pix -uv). According to the pinhole model, the relationship between the feature point world coordinate system coordinate M and the feature point image coordinate system coordinate m can be expressed as:

[0120]

[0121] Where Z c is the depth information, f x , f y are the focal lengths of the camera in the x and y directions of the imaging coordinate system, u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system, K is the intrinsic parameter matrix; R and T are the rotation matrix and translation vector in the extrinsic parameters, respectively.

[0122] Furthermore, global optimization is performed based on the camera calibration parameters and camera distortion model.

[0123] Going further, the camera distortion model,

[0124]

[0125] In the formula, (x dist ,y dist) is the coordinate of the distortion feature point in the imaging coordinate system; (x, y) is the coordinate of the ideal distortion-free feature point in the imaging coordinate system, where k1, k2, k3 are radial distortion coefficients; p1 and p2 are tangential distortion coefficients; the initial solution of the internal and external parameters is solved through the homography relationship between the feature point coordinate M in the world coordinate system and the pixel coordinate m in the image coordinate system; then the solved internal and external parameters and distortion coefficients are globally optimized with the goal of minimizing the reprojection error.

[0126] The expression for minimizing the reprojection error is:

[0127]

[0128] Where m ij is the pixel coordinate of the jth (j=1,…,m) feature point on the ith (i=1,…,n) captured image, m′ ij are the pixel coordinates of the reprojected feature points calculated according to the camera geometry model.

[0129] This embodiment uses the Levenberg-Marquardt optimization algorithm for iterative solution, the number of iterations is set to 500 times, and the iterative convergence accuracy is set to 1e-8.

[0130] The image dedistortion module dedistorts the image based on the camera calibration parameters to obtain the pixel coordinates of the feature points after dedistortion;

[0131] Furthermore, let the pixel coordinates m of the feature point image coordinate system detected on the distorted image be dist for (u dist ,v dist ), the imaging coordinate system coordinate of the feature point is (x dist ,y dist ), on the undistorted image, the pixel coordinate m of the image coordinate system corresponding to the feature point is (u, v), and the coordinate of the imaging coordinate system is (x, y).

[0132] The dedistortion operation is performed through the dedistortion model to obtain the pixel coordinate m of the dedistorted image coordinate system as (u, v).

[0133] Furthermore, the dedistortion model includes a radial distortion model and a tangential distortion model.

[0134] This embodiment uses the following method to perform dedistortion based on the conversion relationship between the image coordinate system and the imaging coordinate system:

[0135]

[0136] Where, f x , f yare the focal lengths of the camera in the x and y directions of the imaging coordinate system, u0 and v0 are the principal point offsets of the camera in the x and y directions of the imaging coordinate system, respectively;

[0137] The obtained (x dist ,y dist ) as the initial value (x0,y0),

[0138]

[0139] The dedistorted imaging coordinate system (x, y) can be obtained by repeatedly iterating the distortion model.

[0140]

[0141] When the number of iterations or the iteration accuracy requirement is reached, the iteration is exited and the iterative x n ,y n As the imaging coordinate system coordinates (x, y) on the undistorted image.

[0142] According to the conversion relationship between the image coordinate system and the imaging coordinate system,

[0143]

[0144] Through the above process, the pixel coordinate m of the dedistorted image coordinate system can be obtained as (u, v).

[0145] The feature point reconstruction module is based on the pixel coordinates of the feature points after dedistortion, in the world coordinate system Z w =0 plane reconstruction feature points, obtain the reconstruction coordinates of the feature points;

[0146] Assume that the reconstructed feature points are in the world coordinate system Z w = 0 plane, then:

[0147]

[0148] Where u and v are pixel coordinates in the image coordinate system, X w is the value of the X-axis direction of the world coordinate system, Y w is the value of the Y axis direction of the world coordinate system, R is the rotation matrix in the external parameters, K is the internal parameter matrix, T is the translation vector in the external parameters, Z c is depth information;

[0149] The third dimension on both sides of the equation has only one unknown quantity Z c , solving this equation gives the depth information Z c ;

[0150] Solve the depth information Z c , and then use the camera inverse projection formula to obtain the world coordinates M′ of the feature point to be measuredi , M′ j

[0151]

[0152] Where Z ci , Z cj They are feature points M′ i , M′ j The corresponding depth information.

[0153] The parameter verification module calculates the distance between the reconstructed feature points based on the coordinates of the feature points, and compares it with the actual distance to obtain the ranging error, thereby verifying the camera parameters.

[0154] The distance to be measured L' is obtained by using the reconstructed world coordinates of the feature points ij ,

[0155] L′ ij =||M′ i -M′ j ||2 (10)

[0156] Among them, M′ i , M′ j is the world coordinate of the feature point to be measured, ||||2 is the modulus of the vector;

[0157] L′ ij The actual distance L from the feature point ij The actual distance between the upper left corner feature point and the lower right corner feature point of the checkerboard calibration plate measured in this embodiment is 155mm.

[0158]

[0159] After the ranging is completed, the camera calibration parameters, reprojection error and relative ranging error are output.

[0160] Example 3

[0161] An embodiment of the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. The memory is used to store software programs and modules, and the processor executes various functional applications and data processing by executing the software programs and modules stored in the memory. The memory and processor are connected via a bus. Specifically, the processor implements any step of the first embodiment above by executing the computer program stored in the memory.

[0162] It should be understood that in the embodiments of the present invention, the processor referred to may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0163] The memory may include a read-only memory, a flash memory, and a random access memory, and provides instructions and data to the processor. A portion or all of the memory may also include a non-volatile random access memory.

[0164] As can be seen from the above, the electronic device provided by the embodiment of the present invention can implement the integrated camera production line calibration and verification method described in Example 1 by running a computer program, thereby obtaining camera parameters, reprojection error, and ranging test results in one go. This reduces manual operation and improves testing efficiency.

[0165] It should be understood that if the above-mentioned integrated modules / units are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the above-mentioned embodiment methods by instructing related hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.

[0166] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

[0167] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0168] It should be noted that the methods and detailed examples provided in the above embodiments can be combined with the devices and equipment provided in the embodiments, and references can be made to each other, and no further details will be given.

[0169] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0170] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal equipment and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For example, the division of the modules or units described above is merely a logical functional division. In actual implementation, other division methods may be used. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.

[0171] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A camera production line calibration and verification integrated method, characterized in that: The method comprises the following steps, Step 1: Use Zhang Zhengyou calibration method to calibrate the camera and obtain the camera calibration parameters; Step 2: Dedistort the image based on the camera calibration parameters to obtain pixel coordinates of the dedistorted feature points; Step 3: Based on the pixel coordinates of the feature points after dedistortion, in the world coordinate system Plane reconstruction feature points to obtain feature point reconstruction coordinates; Assume that the reconstructed feature points are in the world coordinate system On a plane, we have: (8) Where, and All are pixel coordinates in the image coordinate system. is the value in the X direction of the world coordinate system, is the value in the Y direction of the world coordinate system, is the rotation matrix in the extrinsic parameters, is the internal parameter matrix, is the translation vector in the extrinsic parameters, is depth information; Solving depth information , and then use the camera inverse projection formula to obtain the world coordinates of the feature point to be measured 、 , (9) Where, 、 Feature points 、 Corresponding depth information; Step 4: Reconstruct the coordinates based on the feature points, calculate the distance between the reconstructed feature points, and compare it with the actual distance to obtain the ranging error, thereby verifying the camera parameters.

2. The camera production line calibration and verification integrated method according to claim 1, characterized in that: The step 1 specifically includes the following steps: Step 1.1: Use the camera to be calibrated to take multiple images of the calibration plate and obtain the pixel coordinates of the feature points; Step 1.2: Establish a mapping relationship between the pixel coordinates of the feature point image coordinate system and the coordinates of the feature point world coordinate system, calibrate the camera according to the mapping relationship, and obtain the camera calibration parameters.

3. The camera production line calibration and verification integrated method according to claim 2, characterized in that: The step 1.1 also includes if there are problems such as uneven lighting, camera defocus, and excessive image noise during the calibration plate image capture process; The reprojection error of each image is calculated based on the initial calibration, and abnormal images with excessively large reprojection errors are eliminated. The calibration plate image of the eliminated image pose is captured, and the camera is recalibrated.

4. The camera production line calibration and verification integrated method according to claim 1, characterized in that: Specifically, step 2 is as follows: assuming that the pixel coordinates of the feature point image coordinate system detected on the distorted image are for , the imaging coordinate system coordinates of the feature point are , on the undistorted image, the pixel coordinates of the image coordinate system corresponding to the feature point are for , the imaging coordinate system coordinates are ; Perform dedistortion operation through the dedistortion model to obtain the pixel coordinates of the dedistorted image coordinate system for ; The dedistortion model includes a radial distortion model and a tangential distortion model.

5. The camera production line calibration and verification integrated method according to claim 1, characterized in that: The step 4 is specifically to use the reconstructed world coordinate system coordinates of the feature point to obtain the distance to be measured , (10) in, 、 is the world coordinate of the feature point to be measured, is the magnitude of the vector; Will Actual distance to feature points Compare the relative error of ranging , (11) After the ranging is completed, the camera calibration parameters, reprojection error and relative ranging error are output.

6. A camera production line calibration and verification integrated system, characterized in that: The system uses a camera production line calibration and verification integrated method as described in any one of claims 1 to 5, and the system includes: The camera calibration module uses the Zhang Zhengyou calibration method to calibrate the camera and obtain the camera calibration parameters; The image dedistortion module dedistorts the image based on the camera calibration parameters to obtain the pixel coordinates of the feature points after dedistortion; Feature point reconstruction module, based on the pixel coordinates of the feature points after dedistortion, in the world coordinate system Plane reconstruction feature points to obtain feature point reconstruction coordinates; The parameter verification module calculates the distance between the reconstructed feature points based on the coordinates of the feature points, and compares it with the actual distance to obtain the ranging error, thereby verifying the camera parameters.

7. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Calibration method of single-camera mirror binocular vision system

    CN108416812A