A telecentric camera calibration method based on virtual target
By using virtual targets instead of physical targets in telecentric camera calibration, using LCD display screen and homography matrix to calculate camera parameters, the time-consuming and precision problems caused by manual moving targets in the prior art are solved, and efficient and automated Telecentric camera calibration.
Patent Information
- Application Number
- CN202210568853.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-07-08
AI Technical Summary
The existing telecentric camera calibration method based on physical targets requires manual movement of the target, which takes time to operate and jitter affects the accuracy, resulting in insufficient automation and precision in calibration.
Virtual targets are used instead of physical targets, virtual targets are generated through LCD display screens and orthogonal projections are performed, and internal and external parameters of the camera are calculated using homography matrix to achieve automated high-precision calibration.
The need to manually move the target is avoided, calibration efficiency and accuracy are improved, and automated telecentric camera parameter calibration is realized.
Smart Images

Figure CN114897993B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of optical measurement, and in particular, is a telecentric camera calibration method based on a virtual target. Background Art
[0002] The process of telecentric camera calibration is to estimate the internal and external parameters of the telecentric camera. Accurately calibrating the internal and external parameters of the camera can directly improve the measurement accuracy. Since telecentric lenses have many advantages such as constant magnification, small lens distortion, and elimination of perspective error, cameras equipped with telecentric lenses (i.e. telecentric cameras) have incomparable advantages over cameras equipped with conventional lenses (i.e. pinhole cameras).
[0003] The commonly used reference for the traditional telecentric camera calibration method based on physical targets is: Zhong C, Liao H, Zhang X. Telecentric stereo micro-vision system: Calibration method and experiments [J]. Optics & Lasers in Engineering, 2014, 57 (jun.): 82-92. This method calibrates by taking multiple photos of physical targets in different positions. The disadvantage of this method is that the target needs to be moved manually multiple times during calibration, which is time-consuming, and the jitter during movement will also have an adverse effect on the calibration accuracy. Summary of the invention
[0004] In order to solve the above technical problems, the present invention discloses a telecentric camera calibration method based on a virtual target, which uses a virtual target instead of a physical target for calibration. Its purpose is to avoid the need to manually move the physical target during the calibration process and to achieve automated and high-precision telecentric camera calibration.
[0005] The specific technical solution adopted by the present invention is as follows:
[0006] A telecentric camera calibration method based on a virtual target specifically comprises the following steps:
[0007] Step 1: Establish a telecentric camera imaging model;
[0008] Step 2: Place the telecentric camera in front of the LCD display screen, and make the imaging plane of the telecentric camera parallel to the surface of the LCD display screen;
[0009] Step 3: Generate a virtual target and orthogonally project the virtual target onto the LCD display screen, and use a telecentric camera to capture the orthogonal projection image of the virtual target on the screen;
[0010] Step 4: Calculate the homography matrix H that maps the virtual target plane to the camera imaging plane, and obtain the internal parameters of the telecentric camera imaging model from the homography matrix H;
[0011] Step 5: Calculate the homography matrix H that maps the LCD display plane to the camera imaging plane c , from the homography matrix H c Obtain the external parameters of the telecentric camera imaging model.
[0012] In a further improvement of the present invention, the camera imaging model in the above step 1 is
[0013]
[0014] Among them, matrix A is the internal parameter matrix, matrix C is the external parameter matrix, α and β are the magnifications of the telecentric camera along the U axis and V axis of the imaging plane, and the 2x3 matrix in the upper left corner of C is is the truncated matrix of the first two rows of the rotation matrix R, the 2x1 matrix in the upper right corner of C is the translation matrix,
[0015] is the coordinate of a point in space in the world coordinate system, is the pixel coordinate of a point in space on the camera imaging plane.
[0016] A further improvement of the present invention is that the specific process of step three is as follows:
[0017] Step 1: Generate a standard target in a checkerboard pattern. The target pattern contains 99 corner points, including 11 corner points in the horizontal direction and 9 corner points in the vertical direction. The spacing between adjacent corner points is equal.
[0018] Step 2: Randomly generate 9 pairs of rotation matrices R and T, and use the following formula to rotate and translate the standard target to generate 9 virtual targets, SP is the standard target, and VP is the virtual target:
[0019]
[0020] Step 3: Orthogonally project the 9 virtual targets onto the LCD display screen, and use a telecentric camera to capture the orthogonal projection patterns of the 9 virtual targets on the LCD display screen.
[0021] According to a further improvement of the present invention, the internal parameter is obtained from the homography matrix H in the above step 4 as follows:
[0022] Step 1: Homography matrix H all variables h 11 ,h 12 ,h 13 ,h 21 ,h 22 ,h 23 It is obtained by solving the following equation, where is the coordinate of the virtual target corner point in the virtual world coordinate system, (u (i) ,v (i) ) is the pixel coordinate of the virtual target corner point on the camera imaging plane:
[0023]
[0024] Step 2: Based on the images of the virtual targets in 9 different postures taken by the telecentric camera and orthogonally projected on the LCD display, 9 corresponding homography matrices H are obtained. The nth homography matrix H (n) The elements in the i-th row and j-th column of Let l1 = α 2 β 2 , l2=α 2 , l3=β 2 ,
[0025] The following equation is obtained:
[0026]
[0027] The solution to the equation is determined by:
[0028] L=(F T F) -1 F T Q
[0029] Then the internal parameter is solved by the following formula
[0030] A further improvement of the present invention is that in the above step 5, the homography matrix H c The way to obtain external parameters is:
[0031] Step 1: The LCD screen displays the standard target, and the camera shoots the standard target displayed on the LCD screen. The mapping matrix H from the standard target plane, i.e. the screen plane, to the camera imaging plane is obtained using the following formula: c All variables in
[0032]
[0033] in is the coordinate of the standard target corner point in the screen coordinate system, (u (i) ,v (i) ) is the pixel coordinate of the standard target corner point on the camera imaging plane;
[0034] Step 2: Get the matrix K containing the external parameters by the following formula:
[0035] K=A-1 H c
[0036] Translation matrix [t x ,t y ] and the upper left 2x2 submatrix of the rotation matrix R The elements in are taken directly from K. Considering that R is orthogonal, the remaining elements of the rotation matrix are obtained from the following formula:
[0037]
[0038] Beneficial effects of the present invention: The present invention uses a virtual target instead of a physical target for calibration, the purpose of which is to avoid the need to manually move the physical target during the calibration process and to achieve automated and high-precision telecentric camera calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of the method principle of the present invention.
[0040] Figure 2 This is a calibration pattern acquisition diagram of the method of the present invention.
[0041] Figure 3 This is a comparison chart of the reprojection errors between the method of the present invention and the traditional calibration method. DETAILED DESCRIPTION
[0042] In order to deepen the understanding of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. The embodiments are only used to explain the present invention and do not limit the protection scope of the present invention.
[0043] Example: Figure 1 As shown, a telecentric camera calibration method based on a virtual target specifically includes the following steps:
[0044] Step 1: Establish a telecentric camera imaging model.
[0045] The telecentric camera imaging model is as follows:
[0046]
[0047] Step 2: Place the telecentric camera in front of the LCD screen, adjust the angle of the LCD screen so that the imaging plane of the telecentric camera is parallel to the surface of the LCD screen, and adjust the distance between the LCD screen and the telecentric camera so that the telecentric camera can clearly image the LCD screen.
[0048] Step 3: Generate a standard target, and generate multiple virtual targets by rotating the standard target multiple times through translation and rotation transformation.
[0049] Step 1: Generate a standard target. The standard target contains 9x11 corner points. The spacing between each corner point is equal, and the spacing is 25 pixels in the LCD display.
[0050] Step 2: Randomly generate 9 pairs of rotation matrices R and translation matrices T. Use the following formula to rotate and translate the standard target to generate 9 virtual targets, SP is the standard target and VP is the virtual target.
[0051]
[0052] Step 4: Calculate the homography matrix H that maps the virtual target plane to the camera imaging plane, and obtain the internal parameters of the telecentric camera imaging model from the homography matrix H.
[0053] Step 1: Homography matrix H all variables h 11 ,h 12 ,h 13 ,h 21 ,h 22 ,h 23 Solve the equation using the least squares method. is the coordinate of the virtual target corner point in the virtual world coordinate system, (u (i) ,v (i) ) is the pixel coordinate of the virtual target corner point on the camera imaging plane.
[0054]
[0055] Step 2: The telecentric camera takes 9 images of virtual targets in different postures orthogonally projected on the LCD display screen, and 9 corresponding homography matrices H are obtained from the 9 images. The nth homography matrix H (n) The elements in the i-th row and j-th column of
[0056] Let l1 = α 2 β 2 , l2=α 2 , l3=β 2 ,
[0057] The following equation is obtained:
[0058]
[0059] The least squares solution of the equation is determined by:
[0060] L=(F T F) -1 F T Q
[0061] Then the internal parameter is solved by the following formula
[0062] Step 5: Calculate the homography matrix H that maps the LCD display plane to the camera imaging plane c , from the homography matrix H c Obtain the external parameters of the telecentric camera imaging model,
[0063] Step 1: The LCD screen displays the standard target, and the camera shoots the standard target displayed on the LCD screen. The mapping matrix H from the standard target plane, i.e., the screen plane, to the camera imaging plane is obtained by the following formula: c ,in is the coordinate of the standard target corner point in the screen coordinate system, (u (i) ,v (i) ) is the pixel coordinate of the standard target corner point on the camera imaging plane
[0064]
[0065] Step 2: Get the matrix K containing external parameters by the following formula:
[0066] K=A -1 H c
[0067] Among them, the translation matrix [t x ,t y ] is obtained from the first two rows of the third column in the matrix K;
[0068] The upper left 2x2 submatrix of the rotation matrix R The elements in are taken from the elements in the first two rows and first two columns of matrix K. Considering that R is orthogonal, the remaining elements r of the rotation matrix are 13 , r 23 And the third row r3 of the rotation matrix is obtained from:
[0069]
[0070] The camera and telecentric lens used in the experiment are BlackflyBFS-PGE-50S5 (resolution: 2000*2000; sensor size: 2 / 3 inch; pixel size: 3.45μm) and XF-5MDT0.14X178 (working distance: 180mm; object field of view: 79.7mm; depth of field: 46.5mm; magnification: 0.138), respectively. The VIVO Neo3 mobile phone screen is used as the LCD display.
[0071] like Figure 3As shown in the figure, the pictures numbered 1-9 are pictures of 9 virtual targets orthogonally projected onto the LCD display and photographed by the telecentric camera, and the tenth picture is a picture of the standard target photographed by the camera on the LCD display. These ten pictures are used to calibrate the internal and external parameters of the camera. Table 1 records the parameter values calibrated by this method.
[0072] Table 1 Calibration parameters
[0073]
[0074] Then, the reprojection error of the method of the present invention is compared with that of the traditional method. The reprojection error is defined as the difference between the actual coordinates of a point in the three-dimensional space on the imaging image plane and the imaging plane coordinates of the point calculated by the camera imaging model. The traditional method is the method mentioned in the background technology. An aluminum oxide chessboard physical target with 11x9 corner points is used to take 10 target pictures in different postures for calibration. The reprojection errors of the corner points of the method of the present invention and the traditional method on the 10 calibration pictures are calculated respectively. Figure 3 The error distribution diagram of the traditional manual physical target is compared with the error distribution diagram of the method proposed in this paper. The error distribution of the method of the present invention is more convergent, indicating that the method of this paper has higher accuracy.
[0075] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A virtual target telecentric camera calibration method, characterized in that: The steps include: Step 1: Establish a telecentric camera imaging model; Step 2: Place the telecentric camera in front of the LCD display screen, and make the imaging plane of the telecentric camera parallel to the surface of the LCD display screen; Step 3: Generate a virtual target and orthogonally project the virtual target onto the LCD display screen, and use a telecentric camera to capture the orthogonal projection image of the virtual target on the screen; Step 4: Calculate the homography matrix H that maps the virtual target plane to the camera imaging plane, and obtain the internal parameters of the telecentric camera imaging model from the homography matrix H; Step 5: Calculate the homography matrix H that maps the LCD display plane to the camera imaging plane c , from the homography matrix H c Obtain the external parameters of the telecentric camera imaging model; The specific process of step three is as follows: Step 1: Generate a standard target in a checkerboard pattern. The target pattern contains 99 corner points, including 11 corner points in the horizontal direction and 9 corner points in the vertical direction. The spacing between adjacent corner points is equal. Step 2: Randomly generate 9 pairs of rotation matrices R and T, and use the following formula to rotate and translate the standard target to generate 9 virtual targets, SP is the standard target, and VP is the virtual target: Step 3: Orthogonally project the 9 virtual targets onto the LCD display screen, and use the telecentric camera to capture the orthogonal projection patterns of the 9 virtual targets on the screen; The method of obtaining the internal parameters from the homography matrix H in step 4 is: Step 1: Homography matrix H all variables h 11 ,h 12 ,h 13 ,h 21 ,h 22 ,h 23 It is obtained by solving the following equation, where is the coordinate of the virtual target corner point in the virtual world coordinate system, (u (i) ,v (i) ) is the pixel coordinate of the virtual target corner point on the camera imaging plane: Step 2: Based on the images of the virtual targets in 9 different postures taken by the telecentric camera and orthogonally projected on the LCD screen, 9 corresponding homography matrices H are obtained. The nth homography matrix H (n) The elements in the i-th row and j-th column of Let l1 = α 2 β 2 , l2=α 2 , l3=β 2 , The following equation is obtained: The solution to the equation is determined by: L=(F T F) -1 F T Q Then the internal parameter is solved by the following formula In step 5, the homography matrix H c The way to obtain external parameters is: Step 1: The LCD screen displays the standard target, and the camera shoots the standard target displayed on the LCD screen. The mapping matrix H from the standard target plane, i.e. the screen plane, to the camera imaging plane is obtained using the following formula: c All variables in in is the coordinate of the standard target corner point in the screen coordinate system, (u (i) ,v (i) ) is the pixel coordinate of the standard target corner point on the camera imaging plane; Step 2: Get the matrix K containing the external parameters by the following formula: K=A -1 H c Translation matrix [t x ,t y ] and the upper left 2x2 submatrix of the rotation matrix R The elements in are taken directly from K. Considering that R is orthogonal, the remaining elements of the rotation matrix are obtained from the following formula:
2. The virtual target telecentric camera calibration method according to claim 1, characterized in that: The telecentric camera imaging model in step 1 is: Among them, matrix A is the internal parameter matrix, matrix C is the external parameter matrix, α and β are the magnifications of the telecentric camera along the U axis and V axis of the imaging plane, and the 2x3 matrix in the upper left corner of C is The first two rows of the rotation matrix R are truncated, and the upper right 1x2 matrix in C is the translation matrix, is the coordinate of a point in space in the world coordinate system, It is the pixel coordinate of a point in space imaged on the camera imaging plane.
