A simplified optical axis alignment method for optical positioning systems

By employing a simple optical axis alignment method, utilizing checkerboard and image gradient information, and combining a six-axis fine-tuning platform and a three-axis motorized guide rail, a simple and efficient optical axis alignment was achieved. This solved the problems of difficult optical axis adjustment and insufficient accuracy in near-infrared optical positioning systems, and improved the accuracy and stability of optical positioning systems.

CN119200249BActive Publication Date: 2025-10-31SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411491246.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-10-31
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

Existing optical axis alignment methods suffer from difficulties in adjustment and insufficient accuracy in near-infrared optical positioning systems. In particular, under the influence of lens processing errors and CMOS interface errors, the optical center coordinates deviate significantly, affecting measurement accuracy.

Method used

A simplified optical axis alignment method is adopted, which utilizes checkerboard and image gradient information, adjusts the CMOS position through a six-axis fine-tuning platform and a three-axis motorized guide rail, and combines quadratic fitting and threshold judgment to accurately calculate the optical center coordinates and align the optical axis.

Benefits of technology

It achieves simple and efficient optical axis alignment, reduces alignment costs, improves the accuracy and stability of the optical positioning system, reduces optical center alignment errors and image blurring, and expands its application to other camera modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200249B_ABST
    Figure CN119200249B_ABST
Patent Text Reader

Abstract

This invention discloses a simplified optical axis alignment method for optical positioning systems, comprising: controlling image acquisition and optical axis adjustment using the optical alignment system; calculating the gradient of the checkerboard region in the acquired image and fitting a curve to solve for the optical center; if the theoretical and actual differences are too large, adjusting the x and y axes of the six-axis adjustment frame in the optical alignment system, and re-acquiring the image and recalculating; quantifying the differences and symmetry of the image; adjusting the tilt angle of the six-axis fine-tuning platform according to the quantized differences and symmetry; and fixing the relative positions of the CMOS and the lens after adjustment. This invention can extract key image information to obtain the optical center coordinates and perform optical axis alignment using simple equipment and patterns, which is both convenient and ensures alignment accuracy, and can be applied to near-infrared optical positioning systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of optical axis alignment, and in particular to a simple optical axis alignment method for optical positioning systems. Background Technology

[0002] The optical center of a lens refers to the point where the optical axis intersects the lens and the CMOS imaging plane of the image sensor. In an ideal pinhole camera model, the image coordinates of the optical center are half the width and height of the CMOS imaging plane in pixels. When the actual optical center coordinates differ from the image center coordinates by 10 pixels, the impact on measurement accuracy is minimal. However, due to lens manufacturing errors and CMOS interface errors, the actual optical center image coordinates often differ by tens of pixels, and in such cases, the impact of these errors on measurement accuracy cannot be ignored.

[0003] Optical axis alignment methods can be divided into direct optical methods and image constraint methods. Direct optical methods use lasers to align the beam with the optical axis, utilizing the position of the light spot in CMOS imaging for alignment. Their advantage is high accuracy, but adjustment is difficult and requires a high-precision calibration stage. Image constraint methods are further divided into calibration methods and MTF image analysis methods. The former uses Zhang Zhengyou's calibration method to solve for the camera's intrinsic and extrinsic parameters, obtaining the optical center coordinates for adjustment. However, this method is cumbersome and rarely used in practical applications. A more common method is to align the optical axis by evaluating the resolution of the four corners of the image. This method is simpler and more accurate, but requires specially made patterns and has not been applied in near-infrared optical positioning systems. In summary, designing a method for near-infrared optical positioning systems that combines simplicity and high accuracy is a key research focus in the field of optical axis alignment technology. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and to propose a simple optical axis alignment method for optical positioning systems. This method can extract key information from an image to obtain the optical center coordinates and perform optical axis alignment with the help of simple equipment and patterns. This method is simple, ensures alignment accuracy, and can be applied to near-infrared optical positioning systems.

[0005] To achieve the above objectives, the technical solution provided by this invention is as follows: a simplified optical axis alignment method for an optical positioning system. This method is performed within an optical axis alignment system, which includes an image sensor (CMOS), a lens, a six-axis fine-tuning platform, a three-axis motorized guide rail, an optical positioning system, a checkerboard pattern, and an optical anti-vibration stage. The CMOS is mounted at the end of the six-axis fine-tuning platform. The six-axis fine-tuning platform and the lens are fixed to the optical anti-vibration stage. The checkerboard pattern is mounted at the end of the three-axis motorized guide rail. The CMOS and the lens are respectively connected to the optical positioning system for image acquisition. The method includes the following steps:

[0006] S1: Adjust the position of the chessboard grid so that it is displayed in the center of the real-time image of the optical positioning system; the three-axis electric guide rail controls the chessboard grid to move along the horizontal and vertical directions of the real-time image at a set first precision step size, and the optical positioning system acquires an image for each movement;

[0007] S2: Extract the checkerboard outline of all images acquired in step S1 using threshold judgment and rectangle detection, calculate the coordinates of the checkerboard center based on the checkerboard outline, and calculate the actual gradient value of the checkerboard region.

[0008] S3: Perform a second fitting between the actual gradient value of the checkerboard region and the coordinates of the checkerboard center to obtain the actual optical center coordinates, and compare them with the center of the CMOS, i.e., the theoretical optical center; calculate the fitted gradient value based on the curve obtained by the second fitting and the coordinates of the checkerboard center. If the absolute value of the difference between the actual optical center and the theoretical optical center is greater than the set first error value, or the absolute value of the difference between the actual gradient value and the fitted gradient value is greater than the set first distance value, then execute step S4, and then repeat steps S1 to S3; otherwise, execute step S5.

[0009] S4: Adjust the CMOS position using a six-axis fine-tuning platform. The adjustment amount of the x-axis and y-axis of the six-axis fine-tuning platform is determined by the difference between the actual optical center and the theoretical optical center and the quantization factor. The size of the quantization factor is determined by the minimum step size of the x-axis and the minimum step size of the y-axis of the six-axis fine-tuning platform, as well as the pixel density of the x-axis and y-axis.

[0010] S5: The three-axis electric guide rail controls the checkerboard to move along the horizontal and vertical directions of the real-time image at a set second precision step size. Each time it moves, the optical positioning system acquires an image and performs the same image processing as in step S2. The actual gradient value of the checkerboard area and the coordinates of the checkerboard center are fitted twice to obtain the actual optical center coordinates. If the absolute value of the difference between the actual optical center and the theoretical optical center is greater than the set second error value or the absolute value of the difference between the actual gradient value and the fitted gradient value is greater than the set second distance value, then steps S4, S1, S2, and S3 are repeated; otherwise, step S6 is executed.

[0011] S6: Compare the fitted curve obtained from the second fitting in step S5 with the actual gradient value of the checkerboard area, quantify the difference and symmetry between the actual gradient value and the fitted gradient value, adjust the tilt angle of the six-axis fine-tuning platform according to the quantized difference and symmetry, and finally fix the relative position of the CMOS and the lens to complete the optical axis alignment.

[0012] Furthermore, in step S1, a cross mark is made at the center of the real-time image display interface of the optical positioning system. The three-axis electric guide rail is moved so that the center of the chessboard coincides with the cross mark. The three-axis electric guide rail controls the chessboard to acquire a images along the horizontal direction of the real-time image at a set first precision step size, and acquire b images along the vertical direction of the real-time image at a set first precision step size.

[0013] Furthermore, the specific operation steps of step S2 are as follows:

[0014] S21: Set a low threshold T min and high threshold T max To filter out noise and background interference affecting the recognition of checkerboard regions in the acquired images, the Canny algorithm is used to detect edges, and polygon approximation is used to detect rectangles within the checkerboard. This yields the coordinates of all rectangular corner points within the checkerboard. The corner coordinates of the checkerboard region are determined by the maximum and minimum values ​​of the rectangular corner coordinates. Finally, the center coordinates (x, y, z) of the i-th image are calculated based on the coordinates of the four corner points of the checkerboard. i ,y i ), where x i y i These are the x and y coordinates of the center, respectively;

[0015] S22: Calculate the actual gradient values ​​of the horizontal image checkerboard region {G1(1),G1(2),G1(3),...,G1(i),...,G1(a)} and the actual gradient values ​​of the vertical image checkerboard region {F1(1),F1(2),F1(3),...,F1(j),...,F1(b)}, where G1(i) represents the actual gradient value of the i-th horizontal image checkerboard region and F1(j) represents the actual gradient value of the j-th vertical image checkerboard region.

[0016]

[0017] In the formula, the gradient of the pixel value in the nth row and mth column is calculated, and N and M are the length and width of the pixel values ​​in the checkerboard area, respectively. This indicates that the gradient of the grayscale value of the pixel is calculated.

[0018] Furthermore, the specific operation steps of step S3 are as follows:

[0019] S31: The actual gradient values ​​{G1(1),G1(2),G1(3),...,G1(i),...,G1(a)} of the horizontal image checkerboard region are compared with the x-coordinates {x1,x2,x3,...,x} of the center coordinates of the horizontal image checkerboard region. i ,...,x a Perform a second-order fitting, where x iLet x represent the x-coordinate of the center of the checkerboard region in the i-th image. The horizontal fitting curve H1(x) obtained by the second fitting has its peak value corresponding to the x-coordinate of the optical center. c The actual gradient values ​​{F1(1),F1(2),F1(3),...,F1(j),...,F1(b)} of the vertical image checkerboard region are compared with the ordinates {y1,y2,y3,...,y...} of the center coordinates of the vertical image checkerboard region. j ,...,y b Perform a second-order fitting, where y j The vertical coordinate of the center of the checkerboard region in the j-th image is represented by the ordinate. The vertical fitting curve V1(y) obtained by the second fitting has its peak value corresponding to the horizontal coordinate of the optical center. c ;

[0020] S32: Calculate (x) c ,y c ) and the theoretical optical center x and y coordinates (x) t ,y t The difference between ) determines whether it satisfies the condition:

[0021]

[0022] In the formula, d1 is the set first error value; based on the fitting curves H1(x) and V1(y) in the horizontal and vertical directions, and the abscissas {x1,x2,x3,...,x...} of the center coordinates of the checkerboard region in the horizontal image, ... i ,...,x a} and the ordinates of the center coordinates of the checkerboard region in the vertical direction of the image {y1,y2,y3,...,y j ,...,y b The fitted gradient values ​​in the horizontal and vertical directions are calculated as {G1'(1),G1'(2),G1'(3),...,G1'(i),...,G1'(a)} and {F1'(1),F1'(2),F1'(3),...,F1'(j),...,F1'(b)}, where G1'(i) represents the fitted gradient value of the checkerboard region of the i-th image in the horizontal direction, and F1'(j) represents the fitted gradient value of the checkerboard region of the j-th image in the vertical direction.

[0023]

[0024] In the formula, H1(x) i () is the x-coordinate i When, substitute the fitted gradient value of the checkerboard region in the horizontal direction into the fitted curve H1(x), the value is obtained; V1(y) j () is the vertical axis with y jWhen the fitted gradient value of the checkerboard region of the j-th image is obtained by substituting it into the fitted curve V1(y) in the vertical direction;

[0025] Determine whether the actual gradient value and the fitted gradient value meet the following conditions:

[0026]

[0027] In the formula, l1 is the set first distance value.

[0028] Further, in step S4, the difference x between the fitted actual optical center and the theoretical optical center is calculated. c -x t And using quantization factors γ1 and γ2, the adjustment amounts Δx and Δy of the six-axis fine-tuning platform along the x and y axes are obtained:

[0029] Δx=(x c -x t )×γ1,Δy=(y c -y t )×γ2

[0030] In the formula, the signs of Δx and Δy represent the movement directions of the six-axis fine-tuning platform along the x and y axes, with positive representing movement in the positive direction and negative representing movement in the negative direction; the magnitudes of the quantization factors γ1 and γ2 are determined by the minimum step size d of the six-axis fine-tuning platform along the x-axis. x minimum step size d on the y-axis y And the pixel density D along the x and y axes x D y Joint decision:

[0031]

[0032] Furthermore, in step S5, the three-axis electric guide rail controls the chessboard to acquire a images along the horizontal direction of the real-time image at a set second precision step size, and acquire b images along the vertical direction of the real-time image at a set second precision step size.

[0033] Set a low threshold T min and high threshold T max To filter out noise and background interference affecting the recognition of checkerboard regions in the acquired images, the Canny algorithm is used to detect edges, and polygon approximation is used to detect rectangles within the checkerboard. This yields the coordinates of all rectangular corner points within the checkerboard. The corner coordinates of the checkerboard region are determined by the maximum and minimum values ​​of the rectangular corner coordinates. Finally, the center coordinates (x, y, z) of the i-th image are calculated based on the coordinates of the four corner points of the checkerboard. i ',y' j ), where x i '、y' j These are the x and y coordinates of the center, respectively;

[0034] Calculate the actual gradient values ​​of the horizontal image checkerboard region {G2(1),G2(2),G2(3),...,G2(i),...,G2(a)} and the actual gradient values ​​of the vertical image checkerboard region {F2(1),F2(2),F2(3),...,F2(j),...,F2(b)}, where G2(i) represents the actual gradient value of the i-th horizontal image checkerboard region and F2(j) represents the actual gradient value of the j-th vertical image checkerboard region.

[0035]

[0036] The actual gradient values ​​{G2(1),G2(2),G2(3),...,G2(i),...,G2(a)} of the horizontal image checkerboard region are compared with the x-coordinates {x1',x'2,x'3,...,x'} of the center coordinates of the horizontal image checkerboard region. i ',...,x' a Perform a second-order fitting, where x i 'Represents the x-coordinate of the center of the checkerboard region in the i-th image. The horizontal fitting curve H2(x) obtained by the second fitting has its peak value corresponding to the x-coordinate of the optical center.' c The actual gradient values ​​{F2(1),F2(2),F2(3),...,F2(j),...,F2(b)} of the vertical image are compared with the ordinates {y1',y'2,y'3,...,y'} of the center coordinates of the checkerboard region in the vertical image. j ,...,y' b Perform a second fitting, where y' j The ordinate represents the center coordinate of the checkerboard region in the j-th image. The vertical fitting curve V2(y) obtained by the second fitting has its peak value corresponding to the abscissa of the optical center, y'. c ;

[0037] Calculate the fitted optical center x and y coordinates (x') c ,y' c ) and the theoretical optical center x and y coordinates (x) t ,y t The absolute value of the difference between the two values ​​is compared with the set second error value d2. The condition is then determined to be met.

[0038]

[0039] Based on the fitted curves H2(x) and V2(y) in the horizontal and vertical directions, the x-coordinates {x1', x'2, x'3, ..., x'} of the center coordinates of the checkerboard region in each image are obtained. i ',...,x'a} and the ordinates of the center coordinates of the chessboard region in each image {y1',y'2,y'3,...,y' j ,...,y' b The fitted gradient values ​​in the horizontal and vertical directions are calculated as {G'2(1),G'2(2),G'2(3),...,G'2(i),...,G'2(a)} and {F2'(1),F2'(2),F2'(3),...,F2'(j),...,F2'(b)}, where G'2(i) represents the fitted gradient value of the checkerboard region in the i-th image in the horizontal direction, and F2'(j) represents the fitted gradient value of the checkerboard region in the j-th image in the vertical direction.

[0040]

[0041] In the formula, H2(x) i ') is the x-coordinate i When ', substitute the fitted gradient value of the checkerboard region in the horizontal direction into the fitted curve H2(x) to obtain the value; V2(y') j ) is the vertical coordinate y' j When the fitted gradient value of the checkerboard region in the j-th image is obtained by substituting it into the fitted curve V2(y) in the vertical direction;

[0042] Determine whether the actual gradient value and the fitted gradient value meet the following conditions:

[0043]

[0044] In the formula, l2 is the set second distance value.

[0045] Furthermore, in step S6, the distribution of the fitted gradient value G2 of the horizontal image checkerboard region and the horizontal coordinate of the checkerboard center is approximately parabolic. The degree of symmetry on both sides of the axis of symmetry reflects whether the CMOS is perpendicular to the optical axis, while the two curves in the horizontal and vertical directions reflect the pitch and yaw of the CMOS, respectively. The A-axis and B-axis of the six-axis fine-tuning platform are responsible for adjusting the pitch and yaw angles of the CMOS, respectively.

[0046] Assuming the actual optical center x' is obtained through fitting. c y' c Let u be the image in the horizontal direction of a images and v be the image in the vertical direction of b images. To quantify the degree of symmetry of the gradients on both sides of the symmetry axis, we first count the number of data sets h corresponding to the left and right sides of the symmetry axis. x h y :

[0047] h x =min(u-1,au),hy =min(v-1,bv)

[0048] Calculate the difference between the actual gradient values ​​corresponding to the left and right sides of the axis of symmetry, and find their mean μ in the horizontal and vertical directions. x and μ y :

[0049]

[0050] In the formula, G2 and F2 are the fitted gradient values ​​of the checkerboard region in the horizontal and vertical directions of the image, respectively; and The actual gradient values ​​corresponding to the left and right sides of the symmetry axis of the fitted curves in the horizontal and vertical directions are subtracted respectively, and then summed.

[0051] To measure the stability of the corresponding actual gradient values, the standard deviation s of the difference between the left and right corresponding actual gradient values ​​is calculated. x s y :

[0052]

[0053] If the image gradient satisfies μ x <μ,μ y <μ,s x <s,s y <s, at this time it is assumed that the CMOS is perpendicular to the optical axis, where μ and s represent the set third and fourth error values, respectively; if not satisfied, the A-axis and B-axis of the six-axis fine-tuning platform are adjusted;

[0054] The A-axis of the six-axis fine-tuning platform adjusts the yaw angle of the CMOS sensor, and the B-axis adjusts the pitch angle. The adjustment amounts Δα for the yaw angle and Δβ for the pitch angle are:

[0055]

[0056] In the formula, and Represents the gradient difference μ x and μ y The transformation relationship to the A-axis and B-axis, θ A and θ B Represents the minimum step size for the A-axis and B-axis;

[0057] If the CMOS sensor and the optical axis are perpendicular, the relative positions of the CMOS sensor and the lens are fixed with special glue to complete the optical axis alignment.

[0058] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0059] 1. The debugging environment of this invention is easy to set up and the calculation speed is fast. While achieving the expected alignment accuracy, it minimizes the alignment cost.

[0060] 2. This invention makes full use of image gradient information, and can indirectly obtain the degree of optical axis offset and tilt from a set of images, which has great research value.

[0061] 3. In the application of optical positioning systems, this invention can effectively reduce optical center alignment errors and improve the blurring of the four corners of the image, thereby further improving the accuracy and stability of the optical positioning system.

[0062] 4. This invention can be extended to other camera module alignment applications, and has high application value and broad prospects. Attached Figure Description

[0063] Figure 1 This is a schematic diagram of the logical flow of the method of the present invention.

[0064] Figure 2 This is a schematic diagram of image acquisition according to an embodiment of the present invention.

[0065] Figure 3 This is a graph showing the optical center fitting curve in an embodiment of the present invention.

[0066] Figure 4 This is a comparison image of the optical axis alignment before and after in an embodiment of the present invention. Detailed Implementation

[0067] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0068] like Figure 1 As shown, this embodiment discloses a simplified optical axis alignment method for an optical positioning system. This method is performed within an optical axis alignment system, which includes an image sensor (CMOS), a lens, a six-axis fine-tuning platform, a three-axis motorized guide rail, an optical positioning system, a checkerboard pattern, and an optical anti-vibration stage. The CMOS is mounted at the end of the six-axis fine-tuning platform. The six-axis fine-tuning platform and the lens are fixed to the optical anti-vibration stage. The checkerboard pattern is mounted at the end of the three-axis motorized guide rail. The CMOS and the lens are respectively connected to the optical positioning system for image acquisition. Specifically, the method includes the following steps:

[0069] S1: Adjust the position of the checkerboard grid so that it is displayed at the center of the real-time image of the optical positioning system; the three-axis electric guide rail controls the checkerboard grid to move along the horizontal and vertical directions of the real-time image at a set first precision step size, and the optical positioning system acquires one image for each movement; wherein, a cross mark is made at the center of the real-time image display interface of the optical positioning system, and the three-axis electric guide rail is moved so that the center of the checkerboard grid coincides with the cross mark, and the three-axis electric guide rail controls the checkerboard grid to acquire 'a' images along the horizontal direction of the real-time image at a set first precision step size, and acquire 'b' images along the vertical direction of the real-time image at a set first precision step size, as shown in the image. Figure 2 As shown.

[0070] S2: Extract the checkerboard outline of all images acquired in step S1 using threshold judgment and rectangle detection, calculate the coordinates of the checkerboard center based on the checkerboard outline, and calculate the actual gradient value of the checkerboard region.

[0071] S21: Set a low threshold T min and high threshold T max To filter out noise and background interference affecting the recognition of checkerboard regions in the acquired images, the Canny algorithm is used to detect edges, and polygon approximation is used to detect rectangles within the checkerboard. This yields the coordinates of all rectangular corner points within the checkerboard. The corner coordinates of the checkerboard region are determined by the maximum and minimum values ​​of the rectangular corner coordinates. Finally, the center coordinates (x, y, z) of the i-th image are calculated based on the coordinates of the four corner points of the checkerboard. i ,y i ), where x i y i These are the x and y coordinates of the center, respectively;

[0072] S22: Calculate the actual gradient values ​​of the horizontal image checkerboard region {G1(1),G1(2),G1(3),...,G1(i),...,G1(a)} and the actual gradient values ​​of the vertical image checkerboard region {F1(1),F1(2),F1(3),...,F1(j),...,F1(b)}, where G1(i) represents the actual gradient value of the i-th horizontal image checkerboard region and F1(j) represents the actual gradient value of the j-th vertical image checkerboard region.

[0073]

[0074] In the formula, the gradient of the pixel value in the nth row and mth column is calculated, and N and M are the length and width of the pixel values ​​in the checkerboard area, respectively. This indicates that the gradient of the grayscale value of the pixel is calculated.

[0075] S3: The actual gradient values ​​{G1(1),G1(2),G1(3),...,G1(i),...,G1(a)} of the horizontal image checkerboard region are compared with the x-coordinates {x1,x2,x3,...,x} of the center coordinates of the horizontal image checkerboard region. i ,...,x a Perform a second-order fitting, where x i Let x represent the x-coordinate of the center of the checkerboard region in the i-th image. The horizontal fitting curve H1(x) obtained by the second fitting has its peak value corresponding to the x-coordinate of the optical center. c The actual gradient values ​​{F1(1),F1(2),F1(3),...,F1(j),...,F1(b)} of the vertical image checkerboard region are compared with the ordinates {y1,y2,y3,...,y...} of the center coordinates of the vertical image checkerboard region. j ,...,y b Perform a second-order fitting, where y j The vertical coordinate of the center of the checkerboard region in the j-th image is represented by the ordinate. The vertical fitting curve V1(y) obtained by the second fitting has its peak value corresponding to the horizontal coordinate of the optical center. c The fitted curves for the x-axis and y-axis are as follows: Figure 3 As shown;

[0076] Calculate (x) c ,y c The center of the CMOS, i.e., the theoretical optical center, is located at the x and y coordinates. t ,y t The difference between ) determines whether it satisfies the condition:

[0077]

[0078] In the formula, d1 is the set first error value; based on the fitting curves H1(x) and V1(y) in the horizontal and vertical directions, and the abscissas {x1,x2,x3,...,x...} of the center coordinates of the checkerboard region in the horizontal image, ... i ,...,x a} and the ordinates of the center coordinates of the checkerboard region in the vertical direction of the image {y1,y2,y3,...,y j ,...,y bThe fitted gradient values ​​in the horizontal and vertical directions are calculated as {G1'(1),G1'(2),G1'(3),...,G1'(i),...,G1'(a)} and {F1'(1),F1'(2),F1'(3),...,F1'(j),...,F1'(b)}, where G1'(i) represents the fitted gradient value of the checkerboard region of the i-th image in the horizontal direction, and F1'(j) represents the fitted gradient value of the checkerboard region of the j-th image in the vertical direction.

[0079]

[0080] In the formula, H1(x) i () is the x-coordinate i When, substitute the fitted gradient value of the checkerboard region in the horizontal direction into the fitted curve H1(x), the value is obtained; V1(y) j () is the vertical axis with y j When the fitted gradient value of the checkerboard region of the j-th image is obtained by substituting it into the fitted curve V1(y) in the vertical direction;

[0081] Determine whether the actual gradient value and the fitted gradient value meet the following conditions:

[0082]

[0083] In the formula, l1 is the set first distance value;

[0084] If the absolute value of the difference between the actual optical center and the theoretical optical center is greater than the set first error value d1, or the absolute value of the difference between the actual gradient value and the fitted gradient value is greater than the set first distance value l1, then step S4 is executed, and then steps S1 to S3 are repeated; otherwise, step S5 is executed.

[0085] S4: Adjust the CMOS position using a six-axis fine-tuning platform. The adjustment amounts on the x and y axes of the six-axis fine-tuning platform are determined by the difference between the actual and theoretical optical centers and the quantization factor. The magnitude of the quantization factor is jointly determined by the minimum step size on the x-axis and the minimum step size on the y-axis of the six-axis fine-tuning platform, as well as the pixel density on the x and y axes, as detailed below:

[0086] The difference x between the actual optical center and the theoretical optical center obtained by calculation and fitting is calculated. c -x t And using quantization factors γ1 and γ2, the adjustment amounts Δx and Δy of the six-axis fine-tuning platform along the x and y axes are obtained:

[0087] Δx=(x c -x t )×γ1,Δy=(y c -y t )×γ2

[0088] In the formula, the signs of Δx and Δy represent the movement directions of the six-axis fine-tuning platform along the x and y axes, with positive representing movement in the positive direction and negative representing movement in the negative direction; the magnitudes of the quantization factors γ1 and γ2 are determined by the minimum step size d of the six-axis fine-tuning platform along the x-axis. x minimum step size d on the y-axis y And the pixel density D along the x and y axes x D y Joint decision:

[0089]

[0090] S5: The three-axis electric guide rail controls the chessboard grid to acquire a images along the horizontal direction of the real-time image at a set second precision step size, and to acquire b images along the vertical direction of the real-time image at a set second precision step size.

[0091] Set a low threshold T min and high threshold T max To filter out noise and background interference affecting the recognition of checkerboard regions in the acquired images, the Canny algorithm is used to detect edges, and polygon approximation is used to detect rectangles within the checkerboard. This yields the coordinates of all rectangular corner points within the checkerboard. The corner coordinates of the checkerboard region are determined by the maximum and minimum values ​​of the rectangular corner coordinates. Finally, the center coordinates (x, y, z) of the i-th image are calculated based on the coordinates of the four corner points of the checkerboard. i ',y' j ), where x i '、y' j These are the x and y coordinates of the center, respectively;

[0092] Calculate the actual gradient values ​​of the horizontal image checkerboard region {G2(1),G2(2),G2(3),...,G2(i),...,G2(a)} and the actual gradient values ​​of the vertical image checkerboard region {F2(1),F2(2),F2(3),...,F2(j),...,F2(b)}, where G2(i) represents the actual gradient value of the i-th horizontal image checkerboard region and F2(j) represents the actual gradient value of the j-th vertical image checkerboard region.

[0093]

[0094] The actual gradient values ​​{G2(1),G2(2),G2(3),...,G2(i),...,G2(a)} of the horizontal image checkerboard region are compared with the x-coordinates {x1',x'2,x'3,...,x'} of the center coordinates of the horizontal image checkerboard region. i ',...,x' a Perform a second-order fitting, where x i'Represents the x-coordinate of the center of the checkerboard region in the i-th image. The horizontal fitting curve H2(x) obtained by the second fitting has its peak value corresponding to the x-coordinate of the optical center.' c The actual gradient values ​​{F2(1),F2(2),F2(3),...,F2(j),...,F2(b)} of the vertical image are compared with the ordinates {y1',y'2,y'3,...,y'} of the center coordinates of the checkerboard region in the vertical image. j ,...,y' b Perform a second fitting, where y' j The ordinate represents the center coordinate of the checkerboard region in the j-th image. The vertical fitting curve V2(y) obtained by the second fitting has its peak value corresponding to the abscissa of the optical center, y'. c ;

[0095] Calculate the fitted optical center x and y coordinates (x') c ,y' c ) and the theoretical optical center x and y coordinates (x) t ,y t The absolute value of the difference between the two values ​​is compared with the set second error value d2. The condition is then determined to be met.

[0096]

[0097] Based on the fitted curves H2(x) and V2(y) in the horizontal and vertical directions, the x-coordinates {x1', x'2, x'3, ..., x'} of the center coordinates of the checkerboard region in each image are obtained. i ',...,x' a} and the ordinates of the center coordinates of the chessboard region in each image {y1',y'2,y'3,...,y' j ,...,y' b The fitted gradient values ​​in the horizontal and vertical directions are calculated as {G'2(1),G'2(2),G'2(3),...,G'2(i),...,G'2(a)} and {F2'(1),F2'(2),F2'(3),...,F2'(j),...,F2'(b)}, where G'2(i) represents the fitted gradient value of the checkerboard region in the i-th image in the horizontal direction, and F2'(j) represents the fitted gradient value of the checkerboard region in the j-th image in the vertical direction.

[0098]

[0099] In the formula, H2(x) i ') is the x-coordinate iWhen ', substitute the fitted gradient value of the checkerboard region in the horizontal direction into the fitted curve H2(x) to obtain the value; V2(y') j ) is the vertical coordinate y' j When the fitted gradient value of the checkerboard region in the j-th image is obtained by substituting it into the fitted curve V2(y) in the vertical direction;

[0100] Determine whether the actual gradient value and the fitted gradient value meet the following conditions:

[0101]

[0102] In the formula, l2 is the set second distance value;

[0103] If the absolute value of the difference between the actual optical center and the theoretical optical center is greater than the set second error value d2, or the absolute value of the difference between the actual gradient value and the fitted gradient value is greater than the set second distance value l2, then repeat steps S4, S1, S2, and S3; otherwise, execute step S6.

[0104] S6: Compare the fitted curve obtained from the second fitting in step S5 with the actual gradient value of the checkerboard area, quantify the difference and symmetry between the actual gradient value and the fitted gradient value, adjust the tilt angle of the six-axis fine-tuning platform according to the quantized difference and symmetry, and finally fix the relative position of the CMOS and the lens to complete the optical axis alignment.

[0105] The distribution of the fitted gradient value G2 of the checkerboard region in the horizontal direction and the horizontal coordinate of the checkerboard center is approximately parabolic. The degree of symmetry on both sides of the axis of symmetry reflects whether the CMOS is perpendicular to the optical axis, while the two curves in the horizontal and vertical directions reflect the pitch and yaw of the CMOS, respectively. The A-axis and B-axis of the six-axis fine-tuning platform are responsible for adjusting the pitch and yaw angles of the CMOS, respectively.

[0106] Assuming the actual optical center x' is obtained through fitting. c y' c Let u be the image in the horizontal direction of a images and v be the image in the vertical direction of b images. To quantify the degree of symmetry of the gradients on both sides of the symmetry axis, we first count the number of data sets h corresponding to the left and right sides of the symmetry axis. x h y :

[0107] h x =min(u-1,au),h y =min(v-1,bv)

[0108] Calculate the difference between the actual gradient values ​​corresponding to the left and right sides of the axis of symmetry, and find their mean μ in the horizontal and vertical directions. x and μ y :

[0109]

[0110] In the formula, G2 and F2 are the fitted gradient values ​​of the checkerboard region in the horizontal and vertical directions of the image, respectively; and The actual gradient values ​​corresponding to the left and right sides of the symmetry axis of the fitted curves in the horizontal and vertical directions are subtracted respectively, and then summed.

[0111] To measure the stability of the corresponding actual gradient values, the standard deviation s of the difference between the left and right corresponding actual gradient values ​​is calculated. x s y :

[0112]

[0113] If the image gradient satisfies μ x <μ,μ y <μ,s x <s,s y <s, at this time it is assumed that the CMOS is perpendicular to the optical axis, where μ and s represent the set third and fourth error values, respectively; if not satisfied, the A-axis and B-axis of the six-axis fine-tuning platform are adjusted;

[0114] The A-axis of the six-axis fine-tuning platform adjusts the yaw angle of the CMOS sensor, and the B-axis adjusts the pitch angle. The adjustment amounts Δα for the yaw angle and Δβ for the pitch angle are:

[0115]

[0116] In the formula, and Represents the gradient difference μ x and μ y The transformation relationship to the A-axis and B-axis, θ A and θ B Represents the minimum step size for the A-axis and B-axis;

[0117] If the CMOS sensor and optical axis are perpendicular, use a special adhesive to fix the relative positions of the CMOS sensor and lens, thus completing the optical axis alignment. A comparison image before and after optical axis alignment is shown below. Figure 4 As shown.

[0118] In summary, by adopting the above scheme, this invention provides a new method for optical axis alignment, namely, fitting the actual optical center position using the gradient information of the image and its location, and performing optical axis alignment using a six-axis fine-tuning platform. In the application of optical positioning systems, this invention can effectively reduce optical center alignment errors, improve the blurring of the four corners of the image, thereby further improving the accuracy and stability of the optical positioning system, and can be extended to the application of other camera module alignment, which has practical promotion value and is worth promoting.

[0119] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A simplified optical axis alignment method for an optical positioning system, wherein the method is performed within an optical axis alignment system comprising an image sensor (CMOS), a lens, a six-axis fine-tuning platform, a three-axis motorized guide rail, an optical positioning system, a checkerboard pattern, and an optical anti-vibration stage; the CMOS is mounted at the end of the six-axis fine-tuning platform, the six-axis fine-tuning platform and the lens are fixed to the optical anti-vibration stage, the checkerboard pattern is mounted at the end of the three-axis motorized guide rail, and the CMOS and the lens are respectively connected to the optical positioning system for image acquisition; characterized in that... Includes the following steps: S1: Adjust the position of the chessboard grid so that it is displayed in the center of the real-time image of the optical positioning system; the three-axis electric guide rail controls the chessboard grid to move along the horizontal and vertical directions of the real-time image at a set first precision step size, and the optical positioning system acquires an image for each movement; S2: Extract the checkerboard outline of all images acquired in step S1 using threshold judgment and rectangle detection, calculate the coordinates of the checkerboard center based on the checkerboard outline, and calculate the actual gradient value of the checkerboard region. S3: Perform a second fitting between the actual gradient value of the checkerboard region and the coordinates of the checkerboard center to obtain the actual optical center coordinates, and compare them with the center of the CMOS, i.e., the theoretical optical center; calculate the fitted gradient value based on the curve obtained by the second fitting and the coordinates of the checkerboard center. If the absolute value of the difference between the actual optical center and the theoretical optical center is greater than the set first error value, or the absolute value of the difference between the actual gradient value and the fitted gradient value is greater than the set first distance value, then execute step S4, and then repeat steps S1 to S3; otherwise, execute step S5. S4: Adjust the CMOS position using a six-axis fine-tuning platform. The adjustment amount of the x-axis and y-axis of the six-axis fine-tuning platform is determined by the difference between the actual optical center and the theoretical optical center and the quantization factor. The size of the quantization factor is determined by the minimum step size of the x-axis and the minimum step size of the y-axis of the six-axis fine-tuning platform, as well as the pixel density of the x-axis and y-axis. S5: The three-axis electric guide rail controls the checkerboard to move along the horizontal and vertical directions of the real-time image at a set second precision step size. Each time it moves, the optical positioning system acquires an image and performs the same image processing as in step S2. The actual gradient value of the checkerboard area and the coordinates of the checkerboard center are fitted twice to obtain the actual optical center coordinates. If the absolute value of the difference between the actual optical center and the theoretical optical center is greater than the set second error value or the absolute value of the difference between the actual gradient value and the fitted gradient value is greater than the set second distance value, then steps S4, S1, S2, and S3 are repeated; otherwise, step S6 is executed. S6: Compare the fitted curve obtained from the second fitting in step S5 with the actual gradient value of the checkerboard area, quantify the difference and symmetry between the actual gradient value and the fitted gradient value, adjust the tilt angle of the six-axis fine-tuning platform according to the quantized difference and symmetry, and finally fix the relative position of the CMOS and the lens to complete the optical axis alignment.

2. The simplified optical axis alignment method for an optical positioning system according to claim 1, characterized in that, In step S1, a cross mark is made at the center of the real-time image display interface of the optical positioning system. The three-axis electric guide rail is moved so that the center of the chessboard coincides with the cross mark. The three-axis electric guide rail controls the chessboard to acquire a images along the horizontal direction of the real-time image at a set first precision step size, and acquire b images along the vertical direction of the real-time image at a set first precision step size.

3. A simplified optical axis alignment method for an optical positioning system according to claim 2, characterized in that, The specific steps of step S2 are as follows: S21: Set a low threshold T min and high threshold T max To filter out noise and background interference affecting the recognition of checkerboard regions in the acquired images, the Canny algorithm is used to detect edges, and polygon approximation is used to detect rectangles within the checkerboard. This yields the coordinates of all rectangular corner points within the checkerboard. The corner coordinates of the checkerboard region are determined by the maximum and minimum values ​​of the rectangular corner coordinates. Finally, the center coordinates (x, y, z) of the i-th image are calculated based on the coordinates of the four corner points of the checkerboard. i ,y i ), where x i y i These are the x and y coordinates of the center, respectively; S22: Calculate the actual gradient values ​​of the horizontal image checkerboard region {G1(1),G1(2),G1(3),...,G1(i),...,G1(a)} and the actual gradient values ​​of the vertical image checkerboard region {F1(1),F1(2),F1(3),...,F1(j),...,F1(b)}, where G1(i) represents the actual gradient value of the i-th horizontal image checkerboard region and F1(j) represents the actual gradient value of the j-th vertical image checkerboard region. In the formula, the gradient of the pixel value in the nth row and mth column is calculated, and N and M are the length and width of the pixel values ​​in the checkerboard area, respectively. This indicates that the gradient of the grayscale value of the pixel is calculated.

4. A simplified optical axis alignment method for an optical positioning system according to claim 3, characterized in that, The specific steps of step S3 are as follows: S31: The actual gradient values ​​{G1(1),G1(2),G1(3),...,G1(i),...,G1(a)} of the horizontal image checkerboard region are compared with the x-coordinates {x1,x2,x3,...,x} of the center coordinates of the horizontal image checkerboard region. i ,...,x a Perform a second-order fitting, where x i Let x represent the x-coordinate of the center of the checkerboard region in the i-th image. The horizontal fitting curve H1(x) obtained by the second fitting has its peak value corresponding to the x-coordinate of the optical center. c The actual gradient values ​​{F1(1),F1(2),F1(3),...,F1(j),...,F1(b)} of the vertical image checkerboard region are compared with the ordinates {y1,y2,y3,...,y...} of the center coordinates of the vertical image checkerboard region. j ,...,y b Perform a second fitting, where y j Let y represent the ordinate of the center coordinate of the checkerboard region in the j-th image. The vertical fitting curve V1(y) obtained by the second fitting has its peak value corresponding to the ordinate of the optical center. c ; S32: Calculate (x) c ,y c ) and the theoretical optical center x and y coordinates (x) t ,y t The difference between ) determines whether it satisfies the condition: In the formula, d1 is the set first error value; based on the fitting curves H1(x) and V1(y) in the horizontal and vertical directions, and the abscissas {x1,x2,x3,...,x...} of the center coordinates of the checkerboard region in the horizontal image, ... i ,...,x a } and the ordinates of the center coordinates of the checkerboard region in the vertical direction of the image {y1,y2,y3,...,y j ,...,y b The fitted gradient values ​​in the horizontal and vertical directions are calculated as {G1'(1),G1'(2),G1'(3),...,G1'(i),...,G1'(a)} and {F1'(1),F1'(2),F1'(3),...,F1'(j),...,F1'(b)}, where G1'(i) represents the fitted gradient value of the checkerboard region of the i-th image in the horizontal direction, and F1'(j) represents the fitted gradient value of the checkerboard region of the j-th image in the vertical direction. In the formula, H1(x) i () is the x-coordinate i When, substitute the fitted gradient value of the checkerboard region in the horizontal direction into the fitted curve H1(x), the value is obtained; V1(y) j () is the vertical axis with y j When the fitted gradient value of the checkerboard region of the j-th image is obtained by substituting it into the fitted curve V1(y) in the vertical direction; Determine whether the actual gradient value and the fitted gradient value meet the following conditions: In the formula, l1 is the set first distance value.

5. A simplified optical axis alignment method for an optical positioning system according to claim 4, characterized in that, In step S4, the difference x between the fitted actual optical center and the theoretical optical center is calculated. c -x t And using quantization factors γ1 and γ2, the adjustment amounts Δx and Δy of the six-axis fine-tuning platform along the x and y axes are obtained: Δx=(x c -x t )×γ1,Δy=(y c -y t )×γ2 In the formula, the signs of Δx and Δy represent the movement directions of the six-axis fine-tuning platform along the x and y axes, with positive representing movement in the positive direction and negative representing movement in the negative direction; the magnitudes of the quantization factors γ1 and γ2 are determined by the minimum step size d of the six-axis fine-tuning platform along the x-axis. x minimum step size d on the y-axis y And the pixel density D along the x and y axes x D y Joint decision:

6. A simplified optical axis alignment method for an optical positioning system according to claim 5, characterized in that, In step S5, the three-axis electric guide rail controls the chessboard to acquire a images along the horizontal direction of the real-time image at a set second precision step size, and acquire b images along the vertical direction of the real-time image at a set second precision step size. Set a low threshold T min and high threshold T max To filter out noise and background interference affecting the recognition of checkerboard regions in the acquired images, the Canny algorithm is used to detect edges, and polygon approximation is used to detect rectangles within the checkerboard. This yields the coordinates of all rectangular corner points within the checkerboard. The corner coordinates of the checkerboard region are determined by the maximum and minimum values ​​of the rectangular corner coordinates. Finally, the center coordinates (x′) of the i-th image are calculated based on the coordinates of the four corner points of the checkerboard. i ,y' j ), where x′ i y' j These are the x and y coordinates of the center, respectively; Calculate the actual gradient values ​​of the horizontal image checkerboard region {G2(1),G2(2),G2(3),...,G2(i),...,G2(a)} and the actual gradient values ​​of the vertical image checkerboard region {F2(1),F2(2),F2(3),...,F2(j),...,F2(b)}, where G2(i) represents the actual gradient value of the i-th horizontal image checkerboard region and F2(j) represents the actual gradient value of the j-th vertical image checkerboard region. The actual gradient values ​​{G2(1),G2(2),G2(3),...,G2(i),...,G2(a)} of the horizontal image checkerboard region are compared with the x-coordinates {x′1,x′2,x′3,...,x′1} of the center coordinates of the horizontal image checkerboard region. i ',...,x' a Perform a quadratic fit, where x′ i Let x represent the x-coordinate of the center of the checkerboard region in the i-th image. The horizontal fitting curve H2(x) obtained by the second fitting has its peak value corresponding to the x-coordinate of the optical center, x'. c The actual gradient values ​​{F2(1),F2(2),F2(3),...,F2(j),...,F2(b)} of the vertical image are compared with the ordinates {y′1,y′2,y′3,...,y′} of the center coordinates of the checkerboard region in the vertical image. j ,...,y' b Perform a second-order fitting, where y' j Let y' represent the ordinate of the center coordinate of the checkerboard region in the j-th image. The vertical fitting curve V2(y) obtained by the second fitting has its peak value corresponding to the optical center's ordinate y'. c ; Calculate the fitted optical center x and y coordinates (x') c ,y' c ) and the theoretical optical center x and y coordinates (x) t ,y t The absolute value of the difference between the two values ​​is compared with the set second error value d2. The condition is then determined to be met. Based on the fitted curves H2(x) and V2(y) in the horizontal and vertical directions, the x-coordinates {x1', x'2, x'3, ..., x'} of the center coordinates of the checkerboard region in each image are obtained. i ',...,x' a } and the ordinates of the center coordinates of the chessboard region in each image {y1',y'2,y'3,...,y' j ,...,y' b The fitted gradient values ​​in the horizontal and vertical directions are calculated as {G'2(1),G'2(2),G'2(3),...,G'2(i),...,G'2(a)} and {F2'(1),F2'(2),F2'(3),...,F2'(j),...,F2'(b)}, where G'2(i) represents the fitted gradient value of the checkerboard region in the i-th image in the horizontal direction, and F2'(j) represents the fitted gradient value of the checkerboard region in the j-th image in the vertical direction. In the formula, H2(x) i ') is the x-coordinate i When ', substitute the fitted gradient value of the checkerboard region in the horizontal direction into the fitted curve H2(x) to obtain the value; V2(y') j ) is the vertical coordinate y' j When the fitted gradient value of the checkerboard region in the j-th image is obtained by substituting it into the fitted curve V2(y) in the vertical direction; Determine whether the actual gradient value and the fitted gradient value meet the following conditions: In the formula, l2 is the set second distance value.

7. A simplified optical axis alignment method for an optical positioning system according to claim 6, characterized in that, In step S6, the distribution of the fitted gradient value G2 of the horizontal image checkerboard region and the horizontal coordinate of the checkerboard center is approximately parabolic. The degree of symmetry on both sides of the axis of symmetry reflects whether the CMOS is perpendicular to the optical axis, while the two curves in the horizontal and vertical directions reflect the pitch and yaw of the CMOS, respectively. The A-axis and B-axis of the six-axis fine-tuning platform are responsible for adjusting the pitch and yaw angles of the CMOS, respectively. Assuming the actual optical center x' is obtained through fitting. c y' c Let u be the image in the horizontal direction of a images and v be the image in the vertical direction of b images. To quantify the degree of symmetry of the gradients on both sides of the symmetry axis, we first count the number of data sets h corresponding to the left and right sides of the symmetry axis. x h y : h x =min(u-1,a-u),h y =min(v-1,b-v) Calculate the difference between the actual gradient values ​​corresponding to the left and right sides of the axis of symmetry, and find their mean μ in the horizontal and vertical directions. x and μ y : In the formula, G2 and F2 are the fitted gradient values ​​of the checkerboard region in the horizontal and vertical directions of the image, respectively; and The actual gradient values ​​corresponding to the left and right sides of the symmetry axis of the fitted curves in the horizontal and vertical directions are subtracted respectively, and then summed. To measure the stability of the corresponding actual gradient values, the standard deviation s of the difference between the left and right corresponding actual gradient values ​​is calculated. x s y : If the image gradient satisfies μ x <μ,μ y <μ,s x <s,s y <s, at this time it is assumed that the CMOS is perpendicular to the optical axis, where μ and s represent the set third and fourth error values, respectively; if not satisfied, the A-axis and B-axis of the six-axis fine-tuning platform are adjusted; The A-axis of the six-axis fine-tuning platform adjusts the yaw angle of the CMOS sensor, and the B-axis adjusts the pitch angle. The adjustment amounts Δα for the yaw angle and Δβ for the pitch angle are: In the formula, and Represents the gradient difference μ x and μ y The transformation relationship to the A-axis and B-axis, θ A and θ B Represents the minimum step size for the A-axis and B-axis; If the CMOS sensor and the optical axis are perpendicular, the relative positions of the CMOS sensor and the lens are fixed with special glue to complete the optical axis alignment.

Citation Information

Patent Citations

  • Optical axis alignment device and method based on camera imaging

    CN107870445A

  • Wave surface gradient feature matching-based surface shape absolute detection center alignment method and optical system

    CN118781184A