Simple optical axis alignment method for optical positioning system

By using image sensors and fine-tuning platforms in the near-infrared optical positioning system to combine image gradient information for optical axis alignment, the contradiction between simplicity and high precision of the optical axis alignment method is solved, and efficient optical center alignment is achieved. Improves the accuracy and stability of the system.

CN119200249AActive Publication Date: 2024-12-27SOUTH CHINA UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing optical axis alignment method is difficult to take into account both simplicity and high precision in near-infrared optical positioning systems, and there is a problem of large error in the center alignment.

Method used

Using a simple optical axis alignment method, the image sensor CMOS, six-axis fine-tuning platform, three-axis electric guide rail, checkerboard and optical shock-proof platform are gradually adjusted through image gradient information and secondary fitting technology to ensure optical axis alignment. Accuracy of heart coordinates.

Benefits of technology

It realizes simple and efficient optical axis alignment in near-infrared optical positioning system, reduces optical center alignment error, improves the accuracy and stability of the optical positioning system, and can be expanded to other camera modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200249A_ABST
    Figure CN119200249A_ABST
Patent Text Reader

Abstract

The invention discloses a simple optical axis alignment method for an optical positioning system, which comprises the following steps of: controlling image acquisition and optical axis adjustment by an optical alignment system, calculating the gradient of a checkerboard area of an acquired image, fitting a curve to solve an optical center, and adjusting the x axis and the y axis of a six-axis adjusting frame in the optical alignment system if the difference between a theoretical value and an actual value is too large, the images are collected again and calculated; and quantizing the difference and symmetry degree of the image, adjusting the inclination angle of the six-axis fine adjustment platform according to the quantized difference and symmetry degree, and fixing the relative position of the CMOS and the lens after the adjustment is completed. By means of simple equipment and patterns, image key information can be extracted to obtain optical center coordinates, optical axis alignment is carried out, the method is simple and convenient, the alignment precision is guaranteed, and the method can be applied to a near-infrared optical positioning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of optical axis alignment, and in particular to a simple optical axis alignment method for an optical positioning system. Background Art

[0002] The optical center of the lens refers to the point where the optical axis passes through the lens and intersects the CMOS imaging plane of the image sensor. In the ideal camera pinhole model, the image coordinates of the optical center are half the width and height of the CMOS imaging plane expressed in pixels. When the actual optical center coordinates differ from the image center coordinates by 10 pixels, the measurement accuracy is not greatly affected. However, due to factors such as lens processing errors and errors in the CMOS interface, the actual optical center image coordinates often differ by more than a dozen or even dozens of pixels, and the impact of the error on the measurement accuracy cannot be ignored.

[0003] Optical axis alignment methods can be divided into direct optical methods and image constraint methods. The direct optical method uses lasers to align the light beam with the optical axis and uses the spot position of CMOS imaging to align the optical axis. Its advantage is high precision, but it is difficult to adjust and requires a high-precision calibration platform. The image constraint method is divided into calibration method and MTF image analysis method. The former uses Zhang Zhengyou calibration method to solve the internal and external parameters of the camera and obtain the coordinates of the optical center for adjustment, but this method is relatively cumbersome and is relatively rare in practical applications. The more common method is to align the optical axis by evaluating the resolution of the four corners of the image. This method is relatively simple and has high precision, but it requires special patterns and has not been used in near-infrared optical positioning systems. In summary, designing a method that is applied in near-infrared optical positioning system scenarios and is both simple and high-precision is the focus of research in the field of optical axis alignment technology. Summary of the invention

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

[0005] To achieve the above-mentioned purpose, the technical solution provided by the present invention is: a simple optical axis alignment method for an optical positioning system, the method is performed in the optical axis alignment system, the optical axis alignment system includes an image sensor CMOS, a lens, a six-axis fine-tuning platform, a three-axis electric guide rail, an optical positioning system, a chessboard and an optical anti-vibration table, the CMOS is installed at the end of the six-axis fine-tuning platform, the six-axis fine-tuning platform and the lens are fixed on the optical anti-vibration table, the chessboard is installed at the end of the three-axis electric guide rail, and the CMOS and the lens are respectively connected to the optical positioning system for image acquisition; comprising the following steps:

[0006] S1: Adjust the chessboard position 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 chessboard to move along the horizontal and vertical directions of the real-time image according to the set first precision step length, and the optical positioning system collects an image every time it moves;

[0007] S2: extracting the checkerboard outline of all images collected in step S1 by using threshold judgment and rectangle detection, calculating the coordinates of the center of the checkerboard according to the checkerboard outline, and calculating the actual gradient value of the checkerboard area;

[0008] S3: Performing a quadratic fit on the actual gradient value of the chessboard area and the coordinates of the chessboard center to obtain the coordinates of the actual optical center, and comparing them with the center of the CMOS, i.e., the theoretical optical center; calculating the fitting gradient value based on the curve obtained by the quadratic fit and the coordinates of the chessboard 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 fitting gradient value is greater than the set first distance value, then executing step S4, and then repeating steps S1 to S3; otherwise, executing step S5;

[0009] S4: using a six-axis fine-tuning platform to adjust the CMOS position, wherein 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, and the size of the quantization factor is jointly determined by the minimum x-axis step length, the minimum y-axis step length and the pixel density of the x-axis and y-axis of the six-axis fine-tuning platform;

[0010] S5: The three-axis electric guide rail controls the chessboard to move along the horizontal and vertical directions of the real-time image according to the set second precision step length. Each time the optical positioning system moves, an image is collected and the same image processing as step S2 is performed; the actual gradient value of the chessboard area and the chessboard center coordinates are quadratically fitted 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 fitting curve obtained by the quadratic 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 fitting gradient value, adjust the inclination angle of the six-axis fine-tuning platform according to the quantified difference and symmetry, and finally, fix the relative position of the CMOS and the lens to complete the optical axis alignment.

[0012] Further, in step S1, 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 chessboard coincides with the cross mark. The three-axis electric guide rail controls the chessboard to collect a images along the horizontal direction of the real-time image according to the set first precision step size, and to collect b images along the vertical direction of the real-time image according to the set first precision step size.

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

[0014] S21: Set the low threshold T min and high threshold T max , filter out the influence of noise and background on the recognition of the checkerboard area in the collected image, use the Canny algorithm to detect the edge and use polygon approximation to detect the rectangle in the checkerboard, and obtain the coordinates of all the corner points of the rectangle in the checkerboard. The coordinates of the corner points of the checkerboard area are determined by the maximum and minimum values ​​of the coordinates of the rectangle corner points, and the center coordinates (x i ,y i ), where x i ,y i are the horizontal and vertical coordinates of the center coordinates respectively;

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

[0016]

[0017] In the formula, the gradient of the pixel value in the nth row and the mth column is obtained. N and M are the length and width of the pixel value in the chessboard area, respectively. Indicates the gradient of the gray value of the pixel.

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

[0019] S31: Compare the actual gradient values ​​{G1(1), G1(2), G1(3), ..., G1(i), ..., G1(a)} of the horizontal image checkerboard region with the horizontal coordinates {x1, x2, x3, ..., x i ,...,x a} for quadratic fitting, where x iThe horizontal coordinate represents the coordinate of the center of the chessboard area of ​​the i-th image. The horizontal fitting curve H1(x) obtained by quadratic fitting has a peak value corresponding to the horizontal coordinate x of the optical center. c , the actual gradient values ​​of the vertical image checkerboard area {F1(1), F1(2), F1(3), ..., F1(j), ..., F1(b)} and the vertical coordinates of the center coordinates of the vertical image checkerboard area {y1, y2, y3, ..., y j ,...,y b} for quadratic fitting, where y j The ordinate represents the coordinate of the center of the checkerboard area of ​​the jth image. The vertical fitting curve V1(y) obtained by quadratic fitting has a peak value corresponding to the abscissa of the optical center y c ;

[0020] S32: Calculate (x c ,y c ) and the horizontal and vertical coordinates of the theoretical optical center (x t ,y t ) to determine whether it meets the conditions:

[0021]

[0022] Where d1 is the set first error value; according to the fitting curves H1(x) and V1(y) in the horizontal and vertical directions, the horizontal coordinates {x1, x2, x3, ..., x i ,...,x a} and the vertical coordinates of the center coordinates of the chessboard area of ​​the image {y1,y2,y3,...,y j ,...,y b}, calculate the fitted gradient values ​​{G1'(1), G1'(2), G1'(3), ..., G1'(i), ..., G1'(a)} and {F1'(1), F1'(2), F1'(3), ..., F1'(j), ..., F1'(b)} in the horizontal and vertical directions, where G1'(i) represents the fitted gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F1'(j) represents the fitted gradient value of the checkerboard area of ​​the j-th image in the vertical direction:

[0023]

[0024] In the formula, H1(x i ) is the horizontal axis x i , substitute the horizontal fitting curve H1(x) to obtain the fitting gradient value of the chessboard area of ​​the i-th image; V1(y j ) is the vertical coordinate y j, substitute the fitting curve V1(y) in the vertical direction to obtain the fitting gradient value of the checkerboard area of ​​the jth image;

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

[0026]

[0027] Where l1 is the set first distance value.

[0028] Further, in step S4, the difference x between the actual optical center obtained by fitting and the theoretical optical center is calculated. c -x t As well as the quantization factors γ1 and γ2, the adjustment values ​​Δx and Δy of the x-axis and y-axis of the six-axis fine-tuning platform are obtained:

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

[0030] In the formula, the positive and negative values ​​of Δx and Δy represent the moving directions of the x-axis and y-axis of the six-axis fine-tuning platform, where positive represents moving in the positive direction and negative represents moving in the negative direction. The magnitudes of the quantization factors γ1 and γ2 are determined by the minimum step length d of the x-axis of the six-axis fine-tuning platform. x , minimum step length d on the y axis y and the pixel density D of the x-axis and y-axis x , D y Joint decision:

[0031]

[0032] Further, in step S5, the three-axis electric guide rail controls the chessboard to collect a images along the horizontal direction of the real-time image according to the set second precision step length, and collects b images along the vertical direction of the real-time image according to the set second precision step length;

[0033] Set the low threshold T min and high threshold T max , filter out the influence of noise and background on the recognition of the checkerboard area in the collected image, use the Canny algorithm to detect the edge and use polygon approximation to detect the rectangle in the checkerboard, and obtain the coordinates of all the corner points of the rectangle in the checkerboard. The coordinates of the corner points of the checkerboard area are determined by the maximum and minimum values ​​of the coordinates of the rectangle corner points, and the center coordinates (x i ',y' j ), where x i ',y' j are the horizontal and vertical coordinates of the center coordinates respectively;

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

[0035]

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

[0037] Calculate the horizontal and vertical coordinates of the fitting optical center (x' c ,y' c ) and the horizontal and vertical coordinates of the theoretical optical center (x t ,y t ) and the set second error value d2 to determine whether it meets the condition:

[0038]

[0039] According to the fitting curves H2(x) and V2(y) in the horizontal and vertical directions, the horizontal coordinates {x1', x'2, x'3, ..., x i ',...,x'a} and the vertical coordinates of the center coordinates of the chessboard area of ​​each image {y1',y'2,y'3,...,y' j ,...,y' b}, calculate the fitted gradient values ​​{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)} in the horizontal and vertical directions, where G'2(i) represents the fitted gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F2'(j) represents the fitted gradient value of the checkerboard area of ​​the j-th image in the vertical direction:

[0040]

[0041] In the formula, H2(x i ') is the horizontal axis x i ', substitute the horizontal fitting curve H2(x) to obtain the fitting gradient value of the chessboard area of ​​the i-th image; V2(y' j ) is the vertical coordinate y' j , substitute the fitting curve V2(y) in the vertical direction to obtain the fitting gradient value of the checkerboard area of ​​the jth image;

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

[0043]

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

[0045] Further, in step S6, the distribution of the fitting gradient value G2 of the chessboard area of ​​the horizontal image and the horizontal coordinate of the chessboard center is approximately a parabola, and the degree of symmetry on both sides of the symmetry axis reflects whether the CMOS is perpendicular to the optical axis, and the two curves in the horizontal and vertical directions respectively reflect the pitch and yaw conditions of the CMOS; the A axis and the B axis of the six-axis fine-tuning platform are responsible for adjusting the pitch angle and yaw angle of the CMOS respectively;

[0046] Assume that the actual optical center x' is obtained by fitting c ,y' c They correspond to the uth image in the horizontal direction a and the vth image in the vertical direction b. In order 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 in the actual gradient values ​​corresponding to the left and right sides of the symmetry axis, and find its horizontal and vertical mean μ x and μ y :

[0049]

[0050] Where G2 and F2 are the fitted gradient values ​​of the checkerboard area of ​​the image in the horizontal and vertical directions respectively; and Differences are made between the actual gradient values ​​corresponding to the left and right sides of the symmetry axis of the fitting curve in the horizontal and vertical directions, and then the sum is calculated;

[0051] In order to measure the stability of the corresponding actual gradient value, the standard deviation s of the difference between the actual gradient values ​​on the left and right is calculated. x 、s y :

[0052]

[0053] If the image gradient satisfies μ x <μ,μ y <μ,s x <s, s y <s, at this time, the CMOS is considered to be perpendicular to the optical axis, where μ and s represent the set third error value and fourth error value 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, and the B-axis adjusts the pitch angle of the CMOS. The adjustment amount of the yaw angle Δα and the pitch angle Δβ are:

[0055]

[0056] In the formula, and Represents the gradient difference μ x and μ y The conversion relationship between the A-axis and the B-axis is θ A and θ B Represents the minimum step size of the A-axis and the B-axis;

[0057] If the CMOS and the optical axis meet the vertical condition, the relative position of the CMOS and the lens is 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 the present invention is easy to build and has a fast calculation speed. It can achieve the expected alignment accuracy while reducing the alignment cost as much as possible.

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

[0061] 3. The present invention can effectively reduce the optical center alignment error in the application of the optical positioning system, 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. The present invention can be extended to other camera module alignment applications and has high application value and broad prospects. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0064] Figure 2 Schematic diagram of image acquisition according to an embodiment of the present invention.

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

[0066] Figure 4 This is a comparison diagram before and after the optical axis alignment of an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0068] like Figure 1 As shown, this embodiment discloses a simple optical axis alignment method for an optical positioning system, which is performed in an optical axis alignment system, wherein the optical axis alignment system includes an image sensor CMOS, a lens, a six-axis fine-tuning platform, a three-axis electric guide rail, an optical positioning system, a chessboard, and an optical anti-vibration platform. 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 on the optical anti-vibration platform, the chessboard is mounted at the end of the three-axis electric guide rail, and the CMOS and the lens are respectively connected to the optical positioning system for image acquisition. Specifically, the following steps are included:

[0069] S1: Adjust the chessboard position 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 chessboard to move along the horizontal and vertical directions of the real-time image according to the set first precision step length, and the optical positioning system collects an image each time it moves; 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 chessboard coincides with the cross mark, and the three-axis electric guide rail controls the chessboard to collect a images along the horizontal direction of the real-time image according to the set first precision step length, and collect b images along the vertical direction of the real-time image according to the set first precision step length, and the collected images are shown in FIG. Figure 2 shown.

[0070] S2: extracting the checkerboard outline of all images collected in step S1 by using threshold judgment and rectangle detection, calculating the coordinates of the center of the checkerboard according to the checkerboard outline, and calculating the actual gradient value of the checkerboard area;

[0071] S21: Set the low threshold T min and high threshold T max , filter out the influence of noise and background on the recognition of the checkerboard area in the collected image, use the Canny algorithm to detect the edge and use polygon approximation to detect the rectangle in the checkerboard, and obtain the coordinates of all the corner points of the rectangle in the checkerboard. The coordinates of the corner points of the checkerboard area are determined by the maximum and minimum values ​​of the coordinates of the rectangle corner points, and the center coordinates (x i ,y i ), where x i ,y i are the horizontal and vertical coordinates of the center coordinates respectively;

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

[0073]

[0074] In the formula, the gradient of the pixel value in the nth row and the mth column is obtained. N and M are the length and width of the pixel value in the chessboard area, respectively. Indicates the gradient of the gray value of the pixel.

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

[0076] Calculate (x c ,y c ) and the center of CMOS, i.e. the theoretical optical center horizontal and vertical coordinates (x t ,y t ) to determine whether it meets the conditions:

[0077]

[0078] Where d1 is the set first error value; according to the fitting curves H1(x) and V1(y) in the horizontal and vertical directions, the horizontal coordinates {x1, x2, x3, ..., x i ,...,x a} and the vertical coordinates of the center coordinates of the chessboard area of ​​the image {y1,y2,y3,...,y j ,...,y b}, calculate the fitted gradient values ​​{G1'(1), G1'(2), G1'(3), ..., G1'(i), ..., G1'(a)} and {F1'(1), F1'(2), F1'(3), ..., F1'(j), ..., F1'(b)} in the horizontal and vertical directions, where G1'(i) represents the fitted gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F1'(j) represents the fitted gradient value of the checkerboard area of ​​the j-th image in the vertical direction:

[0079]

[0080] In the formula, H1(x i ) is the horizontal axis x i , substitute the horizontal fitting curve H1(x) to obtain the fitting gradient value of the chessboard area of ​​the i-th image; V1(y j ) is the vertical coordinate y j , substitute the fitting curve V1(y) in the vertical direction to obtain the fitting gradient value of the checkerboard area of ​​the jth image;

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

[0082]

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

[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, execute step S4, and then repeat steps S1 to S3; otherwise, execute step S5.

[0085] S4: Use the six-axis fine-tuning platform to adjust the CMOS position, where 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, and the size of the quantization factor is jointly determined by the minimum x-axis step size, the minimum y-axis step size of the six-axis fine-tuning platform, and the pixel density of the x-axis and y-axis. The specific situation is as follows:

[0086] Calculate the difference x between the actual optical center obtained by fitting and the theoretical optical center c -x t As well as the quantization factors γ1 and γ2, the adjustment values ​​Δx and Δy of the x-axis and y-axis of the six-axis fine-tuning platform are obtained:

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

[0088] In the formula, the positive and negative values ​​of Δx and Δy represent the moving directions of the x-axis and y-axis of the six-axis fine-tuning platform, where positive represents moving in the positive direction and negative represents moving in the negative direction. The magnitudes of the quantization factors γ1 and γ2 are determined by the minimum step length d of the x-axis of the six-axis fine-tuning platform. x , minimum step length d on the y axis y and the pixel density D of the x-axis and y-axis x , D y Joint decision:

[0089]

[0090] S5: the three-axis electric guide rail controls the chessboard to collect a images along the horizontal direction of the real-time image according to the set second precision step length, and collects b images along the vertical direction of the real-time image according to the set second precision step length;

[0091] Set the low threshold T min and high threshold T max , filter out the influence of noise and background on the recognition of the checkerboard area in the collected image, use the Canny algorithm to detect the edge and use polygon approximation to detect the rectangle in the checkerboard, and obtain the coordinates of all the corner points of the rectangle in the checkerboard. The coordinates of the corner points of the checkerboard area are determined by the maximum and minimum values ​​of the coordinates of the rectangle corner points, and the center coordinates (x i ',y' j ), where x i ',y' j are the horizontal and vertical coordinates of the center coordinates respectively;

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

[0093]

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

[0095] Calculate the horizontal and vertical coordinates of the fitting optical center (x' c ,y' c ) and the horizontal and vertical coordinates of the theoretical optical center (x t ,y t ) and the set second error value d2 to determine whether it meets the condition:

[0096]

[0097] According to the fitting curves H2(x) and V2(y) in the horizontal and vertical directions, the horizontal coordinates {x1', x'2, x'3, ..., x i ',...,x' a} and the vertical coordinates of the center coordinates of the chessboard area of ​​each image {y1',y'2,y'3,...,y' j ,...,y' b}, calculate the fitted gradient values ​​{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)} in the horizontal and vertical directions, where G'2(i) represents the fitted gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F2'(j) represents the fitted gradient value of the checkerboard area of ​​the j-th image in the vertical direction:

[0098]

[0099] In the formula, H2(x i ') is the horizontal axis x i', substitute the horizontal fitting curve H2(x) to obtain the fitting gradient value of the chessboard area of ​​the i-th image; V2(y' j ) is the vertical coordinate y' j , substitute the fitting curve V2(y) in the vertical direction to obtain the fitting gradient value of the checkerboard area of ​​the jth image;

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

[0101]

[0102] Where 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 steps S4, S1, S2, and S3 are repeated, otherwise, step S6 is executed;

[0104] S6: Compare the fitting curve obtained by the quadratic 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 fitting gradient value, adjust the inclination angle of the six-axis fine-tuning platform according to the quantified 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 chessboard area in the horizontal direction and the horizontal coordinate of the chessboard center is approximately a parabola. The degree of symmetry on both sides of the symmetry axis reflects whether the CMOS is perpendicular to the optical axis, while the two curves in the horizontal and vertical directions respectively reflect the pitch and yaw conditions of the CMOS; the A-axis and B-axis of the six-axis fine-tuning platform are responsible for adjusting the pitch angle and yaw angle of the CMOS respectively;

[0106] Assume that the actual optical center x' is obtained by fitting c ,y' c They correspond to the uth image in the horizontal direction a and the vth image in the vertical direction b. In order 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 in the actual gradient values ​​corresponding to the left and right sides of the symmetry axis, and find its horizontal and vertical mean μ x and μ y :

[0109]

[0110] Where G2 and F2 are the fitted gradient values ​​of the checkerboard area of ​​the image in the horizontal and vertical directions respectively; and Differences are made between the actual gradient values ​​corresponding to the left and right sides of the symmetry axis of the fitting curve in the horizontal and vertical directions, and then the sum is calculated;

[0111] In order to measure the stability of the corresponding actual gradient value, the standard deviation s of the difference between the actual gradient values ​​on the left and right is calculated. x 、s y :

[0112]

[0113] If the image gradient satisfies μ x <μ,μ y <μ,s x <s, s y <s, at this time, the CMOS is considered to be perpendicular to the optical axis, where μ and s represent the set third error value and fourth error value 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, and the B-axis adjusts the pitch angle of the CMOS. The adjustment amount of the yaw angle Δα and the pitch angle Δβ are:

[0115]

[0116] In the formula, and Represents the gradient difference μ x and μ y The conversion relationship between the A-axis and the B-axis is θ A and θ B Represents the minimum step size of the A-axis and B-axis;

[0117] If the CMOS and the optical axis meet the vertical condition, fix the relative position of the CMOS and the lens with special glue to complete the optical axis alignment. The comparison before and after the optical axis alignment is shown in the figure below. Figure 4 shown.

[0118] To sum up, after adopting the above scheme, the present invention provides a new method for optical axis alignment, that is, to fit the actual optical center position by utilizing the gradient information of the image and its position, and to utilize a six-axis fine-tuning platform to perform optical axis alignment; the present invention can effectively reduce the optical center alignment error in the application of the optical positioning system, and 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 expanded to other camera module alignment applications, which has practical promotion value and is worthy of promotion.

[0119] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A simple optical axis alignment method for an optical positioning system, the method is performed in the optical axis alignment system, the optical axis alignment system comprises an image sensor CMOS, a lens, a six-axis fine-tuning platform, a three-axis electric guide rail, an optical positioning system, a chessboard and an optical anti-vibration table, 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 on the optical anti-vibration table, the chessboard is mounted at the end of the three-axis electric guide rail, the CMOS and the lens are respectively connected to the optical positioning system for image acquisition; characterized in that, The following steps are involved: S1: Adjust the chessboard position 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 chessboard to move along the horizontal and vertical directions of the real-time image according to the set first precision step length, and the optical positioning system collects an image every time it moves; S2: extracting the checkerboard outline of all images collected in step S1 by using threshold judgment and rectangle detection, calculating the coordinates of the center of the checkerboard according to the checkerboard outline, and calculating the actual gradient value of the checkerboard area; S3: Performing a quadratic fit on the actual gradient value of the chessboard area and the coordinates of the chessboard center to obtain the coordinates of the actual optical center, and comparing them with the center of the CMOS, i.e., the theoretical optical center; calculating the fitting gradient value based on the curve obtained by the quadratic fit and the coordinates of the chessboard 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 fitting gradient value is greater than the set first distance value, then executing step S4, and then repeating steps S1 to S3; otherwise, executing step S5; S4: using a six-axis fine-tuning platform to adjust the CMOS position, wherein 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, and the size of the quantization factor is jointly determined by the minimum x-axis step length, the minimum y-axis step length and the pixel density of the x-axis and y-axis of the six-axis fine-tuning platform; S5: The three-axis electric guide rail controls the chessboard to move along the horizontal and vertical directions of the real-time image according to the set second precision step length. Each time the optical positioning system moves, an image is collected and the same image processing as step S2 is performed; the actual gradient value of the chessboard area and the chessboard center coordinates are quadratically fitted 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 fitting curve obtained by the quadratic 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 fitting gradient value, adjust the inclination angle of the six-axis fine-tuning platform according to the quantified difference and symmetry, and finally, fix the relative position of the CMOS and the lens to complete the optical axis alignment.

2. A simple 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, and 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 collect a images along the horizontal direction of the real-time image according to the set first precision step size, and to collect b images along the vertical direction of the real-time image according to the set first precision step size.

3. A simple optical axis alignment method for an optical positioning system according to claim 2, characterized in that: The specific operation steps of step S2 are as follows: S21: Set the low threshold T min and high threshold T max , filter out the influence of noise and background on the recognition of the checkerboard area in the collected image, use the Canny algorithm to detect the edge and use polygon approximation to detect the rectangle in the checkerboard, and obtain the coordinates of all the corner points of the rectangle in the checkerboard. The coordinates of the corner points of the checkerboard area are determined by the maximum and minimum values ​​of the coordinates of the rectangle corner points, and the center coordinates (x i ,y i ), where x i ,y i are the horizontal and vertical coordinates of the center coordinates respectively; S22: Calculate the actual gradient values ​​of the checkerboard area of ​​the horizontal image {G1(1), G1(2), G1(3), ..., G1(i), ..., G1(a)} and the actual gradient values ​​of the checkerboard area of ​​the vertical image {F1(1), F1(2), F1(3), ..., F1(j), ..., F1(b)}, where G1(i) represents the actual gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F1(j) represents the actual gradient value of the checkerboard area of ​​the j-th image in the vertical direction: In the formula, the gradient of the pixel value in the nth row and the mth column is obtained. N and M are the length and width of the pixel value in the chessboard area, respectively. Indicates the gradient of the gray value of the pixel.

4. A simple optical axis alignment method for an optical positioning system according to claim 3, characterized in that: The specific operation steps of step S3 are as follows: S31: Compare the actual gradient values ​​{G1(1), G1(2), G1(3), ..., G1(i), ..., G1(a)} of the horizontal image checkerboard region with the horizontal coordinates {x1, x2, x3, ..., x i ,...,x a } for quadratic fitting, where x i The horizontal coordinate represents the coordinate of the center of the chessboard area of ​​the i-th image. The horizontal fitting curve H1(x) obtained by quadratic fitting has a peak value corresponding to the horizontal coordinate x of the optical center. c , the actual gradient values ​​of the vertical image checkerboard area {F1(1), F1(2), F1(3), ..., F1(j), ..., F1(b)} and the vertical coordinates of the center coordinates of the vertical image checkerboard area {y1, y2, y3, ..., y j ,...,y b } for quadratic fitting, where y j The ordinate represents the coordinate of the center of the checkerboard area of ​​the jth image. The vertical fitting curve V1(y) obtained by quadratic fitting has a peak value corresponding to the abscissa of the optical center y c ; S32: Calculate (x c ,y c ) and the horizontal and vertical coordinates of the theoretical optical center (x t ,y t ) to determine whether it meets the conditions: Where d1 is the set first error value; according to the fitting curves H1(x) and V1(y) in the horizontal and vertical directions, the horizontal coordinates {x1, x2, x3, ..., x i ,...,x a } and the vertical coordinates of the center coordinates of the chessboard area of ​​the image in the vertical direction {y1,y2,y3,...,y j ,...,y b }, calculate the fitted gradient values ​​{G1'(1), G1'(2), G1'(3), ..., G1'(i), ..., G1'(a)} and {F1'(1), F1'(2), F1'(3), ..., F1'(j), ..., F1'(b)} in the horizontal and vertical directions, where G1'(i) represents the fitted gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F1'(j) represents the fitted gradient value of the checkerboard area of ​​the j-th image in the vertical direction: In the formula, H1(x i ) is the horizontal axis x i , substitute the horizontal fitting curve H1(x) to obtain the fitting gradient value of the chessboard area of ​​the i-th image; V1(y j ) is the vertical coordinate y j , substitute the fitting curve V1(y) in the vertical direction to obtain the fitting gradient value of the checkerboard area of ​​the jth image; Determine whether the actual gradient value and the fitted gradient value meet the conditions: Where l1 is the set first distance value.

5. A simple optical axis alignment method for an optical positioning system according to claim 4, characterized in that: In step S4, the difference x between the actual optical center obtained by fitting and the theoretical optical center is calculated. c -x t As well as the quantization factors γ1 and γ2, the adjustment values ​​Δx and Δy of the x-axis and y-axis of the six-axis fine-tuning platform are obtained: Δx=(x c -x t )×γ1,Δy=(y c -y t )×γ2 In the formula, the positive and negative values ​​of Δx and Δy represent the moving directions of the x-axis and y-axis of the six-axis fine-tuning platform, where positive represents moving in the positive direction and negative represents moving in the negative direction. The magnitudes of the quantization factors γ1 and γ2 are determined by the minimum step length d of the x-axis of the six-axis fine-tuning platform. x , minimum step length d on the y axis y and the pixel density D of the x-axis and y-axis x , D y Joint decision:

6. A simple 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 collect a images along the horizontal direction of the real-time image according to the set second precision step length, and collects b images along the vertical direction of the real-time image according to the set second precision step length; Set the low threshold T min and high threshold T max , filter out the influence of noise and background on the recognition of the checkerboard area in the collected image, use the Canny algorithm to detect the edge and use polygon approximation to detect the rectangle in the checkerboard, and obtain the coordinates of all the corner points of the rectangle in the checkerboard. The coordinates of the corner points of the checkerboard area are determined by the maximum and minimum values ​​of the coordinates of the rectangle corner points, and 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 are the horizontal and vertical coordinates of the center coordinates respectively; Calculate the actual gradient values ​​of the chessboard area of ​​the horizontal image {G2(1), G2(2), G2(3), ..., G2(i), ..., G2(a)} and the actual gradient values ​​of the chessboard area of ​​the vertical image {F2(1), F2(2), F2(3), ..., F2(j), ..., F2(b)}, where G2(i) represents the actual gradient value of the chessboard area of ​​the i-th horizontal image, and F2(j) represents the actual gradient value of the chessboard area of ​​the j-th vertical image: The actual gradient values ​​of the horizontal checkerboard area of ​​the image {G2(1), G2(2), G2(3), ..., G2(i), ..., G2(a)} and the horizontal coordinates of the center coordinates of the checkerboard area of ​​the image {x′1, x′2, x′3, ..., x′ i ,...,x' a } for quadratic fitting, where x′ i The horizontal coordinate represents the coordinates of the center of the chessboard area of ​​the i-th image. The horizontal fitting curve H2(x) obtained by quadratic fitting has a peak value corresponding to the horizontal coordinate x' of the optical center. c , the actual gradient values ​​of the vertical image {F2(1), F2(2), F2(3), ..., F2(j), ..., F2(b)} and the vertical coordinates of the center coordinates of the chessboard area of ​​the vertical image {y′1, y′2, y′3, ..., y′ j ,...,y' b } for quadratic fitting, where y' j The ordinate represents the coordinates of the center of the checkerboard area of ​​the jth image. The vertical fitting curve V2(y) obtained by quadratic fitting has a peak value corresponding to the abscissa y' of the optical center. c ; Calculate the horizontal and vertical coordinates of the fitted optical center (x' c ,y' c ) and the horizontal and vertical coordinates of the theoretical optical center (x t ,y t ) and the set second error value d2 to determine whether it meets the condition: According to the fitting curves H2(x) and V2(y) in the horizontal and vertical directions, the horizontal coordinates {x1', x'2, x'3, ..., x i ',...,x' a } and the vertical coordinates of the center coordinates of the chessboard area of ​​each image {y1',y'2,y'3,...,y' j ,...,y' b }, calculate the fitted gradient values ​​{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)} in the horizontal and vertical directions, where G'2(i) represents the fitted gradient value of the checkerboard area of ​​the i-th image in the horizontal direction, and F2'(j) represents the fitted gradient value of the checkerboard area of ​​the j-th image in the vertical direction: In the formula, H2(x i ') is the horizontal axis x i ', substitute the horizontal fitting curve H2(x) to obtain the fitting gradient value of the chessboard area of ​​the i-th image; V2(y' j ) is the vertical coordinate y' j , substitute the fitting curve V2(y) in the vertical direction to obtain the fitting gradient value of the checkerboard area of ​​the jth image; Determine whether the actual gradient value and the fitted gradient value meet the conditions: Wherein, l2 is the set second distance value.

7. A simple optical axis alignment method for an optical positioning system according to claim 6, characterized in that: In step S6, the distribution of the fitting gradient value G2 of the chessboard area of ​​the horizontal image and the horizontal coordinate of the chessboard center is approximately a parabola, and the degree of symmetry on both sides of the symmetry axis reflects whether the CMOS is perpendicular to the optical axis, and the two curves in the horizontal and vertical directions respectively reflect the pitch and yaw conditions of the CMOS; the A axis and the B axis of the six-axis fine-tuning platform are responsible for adjusting the pitch angle and yaw angle of the CMOS respectively; Assume that the actual optical center x' is obtained by fitting c ,y' c They correspond to the uth image in the horizontal direction a and the vth image in the vertical direction b. In order 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 in the actual gradient values ​​corresponding to the left and right sides of the symmetry axis, and find its horizontal and vertical mean μ x and μ y : Where G2 and F2 are the fitted gradient values ​​of the checkerboard area of ​​the image in the horizontal and vertical directions respectively; and Differences are made between the actual gradient values ​​corresponding to the left and right sides of the symmetry axis of the fitting curve in the horizontal and vertical directions, and then the sum is calculated; In order to measure the stability of the corresponding actual gradient value, the standard deviation s of the difference between the actual gradient values ​​on the left and right is calculated. x 、s y : If the image gradient satisfies μ x <μ,μ y <μ,s x <s, s y <s, at this time, the CMOS is considered to be perpendicular to the optical axis, where μ and s represent the set third error value and fourth error value 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, and the B-axis adjusts the pitch angle of the CMOS. The adjustment amount of the yaw angle Δα and the pitch angle Δβ are: In the formula, and Represents the gradient difference μ x and μ y The conversion relationship between the A-axis and the B-axis is θ A and θ B Represents the minimum step size of the A-axis and B-axis; If the CMOS and the optical axis meet the vertical condition, the relative position of the CMOS and the lens is 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

  • Checkerboard center point detection method, and camera distortion calibration method and system

    CN112037284A

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

    CN118781184A