Camera module optical center and principal point testing method, testing device and storage medium

By using surface fitting algorithms and color block calculations of standard images in camera module testing, the testing process for optical centers and principal points is simplified, solving the problem of low testing efficiency in existing technologies, reducing costs and improving correction efficiency.

CN121000866BActive Publication Date: 2026-02-03NINGBO SUNNY OPOTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511517397.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2026-02-03
Estimated Expiration
2045-10-23

AI Technical Summary

Technical Problem

In existing technologies, optical center testing and principal point testing are two separate processes, resulting in high cost of standard plate manufacturing and low testing efficiency.

Method used

A method for testing the optical center and principal point using a camera module is adopted. By acquiring the image of the target plate, the color block pattern is removed using a surface fitting algorithm, the center coordinates of the optical center region are calculated, and the principal point is calculated using the color blocks on the target plate. This avoids additional uniform light sources and MARK points, simplifying the testing process.

Benefits of technology

It improves the efficiency of optical center and principal point testing, reduces the cost of standard plate manufacturing, simplifies the testing process, and improves the efficiency of optical center and principal point correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121000866B_ABST
    Figure CN121000866B_ABST
Patent Text Reader

Abstract

The application discloses a light center and principal point testing method, testing equipment and storage medium of a camera module. The light center and principal point testing method of the camera module comprises a light center test. The light center test comprises obtaining a calibration plate image. The calibration plate image comprises a plurality of color block patterns corresponding to color blocks on the calibration plate. A curved surface fitting algorithm is used to remove the color block patterns in the calibration plate image to obtain a light center test image. The middle region of the light center test image has a high gray value, and the surrounding region has a low gray value. A pixel point set with a gray value greater than a threshold Threshoc is selected to obtain a light center region. The center coordinates (OCx, OCy) of the light center region are calculated as the coordinates of the light center of the camera module. The calibration plate image is used for light center calculation, which is beneficial to avoid light center testing by an additional uniform light source, thereby simplifying the process of light center and principal point testing and improving the efficiency of light center and principal point testing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of camera modules, and in particular to a camera module optical center and principal point testing method, testing device and storage medium. BACKGROUND

[0002] With the rapid development of camera functions in the field of intelligent devices and the continuous improvement of consumer demand, the product diversity of camera modules has been significantly improved, and long-focus, super-large aperture, large image surface, etc. Camera modules have gradually become the standard configuration of intelligent devices. Under this trend, the assembly process and performance calibration of camera modules face high standards. Among them, the optical center and the principal point as the core parameters to define the optical center of the lens and the reference of the image sensor, the calibration accuracy will greatly affect the center deviation and the picture illumination uniformity of the camera module. Therefore, realizing high-precision and high-efficiency correction of the optical center and the principal point has become an important link to improve the performance quality of the camera module and ensure the stability of mass production.

[0003] In related technologies, the optical center test and the principal point test are usually divided into two independent processes: first, test the optical center of the camera module in a uniform light source environment without any pattern to avoid the interference of the color block of the calibration plate on the optical center calculation; then, transfer the camera module to another station equipped with a calibration plate, and calculate and locate the principal point by recognizing the MARK points pre-set on the calibration plate. This testing method leads to high cost of calibration plate manufacturing, low overall testing efficiency and other problems. SUMMARY

[0004] One object of the present application is to provide a camera module optical center and principal point testing method to simplify the process of optical center and principal point testing and improve the efficiency of optical center and principal point testing.

[0005] Another object of the present application is to provide a testing device to implement the above-mentioned camera module optical center and principal point testing method through a processor.

[0006] Another object of the present application is to provide a storage medium to store a program that can be executed by a processor to implement the above-mentioned camera module optical center and principal point testing method.

[0007] To achieve the above at least one object, the technical scheme adopted by the present application is: a light center and principal point testing method of a camera module, comprising: light center testing, the light center testing comprising: acquiring a target plate image, the target plate image comprising a plurality of color block patterns corresponding to color blocks on a target plate; removing the color block patterns in the target plate image by using a curved surface fitting algorithm to obtain a light center test image, the middle region of the light center test image having a high gray value and the surrounding region having a low gray value; selecting a pixel point set with a gray value greater than a threshold value Threshoc to obtain a light center region; and calculating the center coordinates (OCx, OCy) of the light center region as the coordinates of the light center of the camera module.

[0008] As a preferred, the light center and principal point testing method of the camera module further comprises principal point testing, the principal point testing comprising: performing binaryzation processing on the target plate image to obtain a principal point test image, the principal point test image comprising a plurality of color block patterns, and the corresponding color blocks of the color block patterns being symmetrically distributed with respect to the principal point on the target plate; calculating the coordinates of the midpoint between any two of the color block patterns to obtain a midpoint set; calculating the distance dist between any two of the midpoints in the midpoint set, and when the distance dist is less than a threshold value Thresh2, determining that the two midpoints are the same point; and the midpoint determined as the same point most frequently being the principal point of the camera module.

[0009] As a preferred, the curved surface fitting algorithm comprises: selecting pixel points with a gray value greater than a threshold value Thresh1 on the target plate image to obtain a to-be-fitted image; establishing a polynomial equation and substituting the gray values of a plurality of pixel points in the to-be-fitted image into the polynomial equation to obtain a fitting coefficient coef; and fitting the to-be-fitted image by using the fitting coefficient coef to obtain the light center test image.

[0010] As a preferred, acquiring the threshold value Thresh1 comprises: acquiring a gray value img(x, y) of the target plate image; calculating a minimum gray value minV1, a maximum gray value maxV1 and an average gray value meanV1 of the target plate image according to the gray value img(x, y); and calculating the threshold value Thresh1, wherein a1, b1 and c1 are proportional parameters, respectively representing the proportion of the minimum gray value minV1, the maximum gray value maxV1 and the average gray value meanV1 in the threshold value Thresh1.

[0011] ​As a preferred embodiment, obtaining the optical center region and calculating the center coordinates (OCx, OCy) of the optical center region includes comparing the grayscale value of each pixel in the optical center test image with a threshold Threshoc; when the grayscale value of a pixel is greater than the threshold Threshoc, the horizontal coordinate xi and vertical coordinate yi of the pixel are respectively added to the total horizontal coordinate value SumX and the total vertical coordinate value SumY, and the count value k is incremented by 1; wherein the initial values ​​of the total horizontal coordinate value SumX, the total vertical coordinate value SumY, and the count value k are all 0; the mean of the horizontal coordinates is calculated. , as OCx; calculate the mean of the ordinate. , as OCy, to obtain the center coordinates (OCx, OCy) of the optical center region.

[0012] As a preferred embodiment, obtaining the threshold Threshoc includes: obtaining the optical center test image Zimg(x,y); based on the optical center test image Zimg(x,y), counting the number of pixels Hist(m) for each grayscale value, where m is 0, 1, 2, ..., 255; and solving... To obtain mi, where Ratio is a preset proportion parameter, w is the width of the optical center test image, and h is the height of the optical center test image; the threshold Threshoc = mi.

[0013] As a preferred method, a histogram algorithm is used to count the number of pixels Hist(m) for each grayscale value; the ratio parameter Ratio ranges from 10% to 30%.

[0014] As a preferred embodiment, the target image is reduced by a factor of N to obtain the image to be processed; the image to be processed is binarized to obtain the principal point test image.

[0015] As a preferred embodiment, obtaining the threshold Thresh2 used for binarization processing includes: obtaining the grayscale values ​​Reimg(x,y) of the image to be processed; calculating the minimum grayscale value minV2, the maximum grayscale value maxV2, and the average grayscale value meanV2 of the image to be processed based on the grayscale values ​​Reimg(x,y); and calculating the threshold Thresh2. , where a2, b2 and c2 are proportional parameters, representing the proportions of the minimum gray value minV2, the maximum gray value maxV2 and the average gray value meanV2 in the threshold Thresh2, respectively.

[0016] As a preferred embodiment, the principal point test further includes: finding connected regions on the principal point test image; calculating the area of ​​each connected region; determining that the connected region is the color block graphic when the area of ​​the connected region is greater than the lower area limit areaB and less than the upper area limit areaT; and calculating the center coordinates of each color block graphic, wherein the center coordinates of the color block graphic are used to calculate the coordinates of the midpoint between any two color blocks.

[0017] As a preferred option, two color blocks symmetrically distributed with respect to the main point on the label are grouped together, and the coordinates of the midpoints between the color block graphics corresponding to each group of color blocks are calculated to obtain the midpoint set.

[0018] As a preferred embodiment, one of the midpoints in the midpoint set is designated as the target point, and the remaining midpoints are designated as undetermined points. The distance *dist* between the target point and each of the undetermined points is calculated. When the distance *dist* is less than a threshold value... When the target point is determined to be the same point as the target point, each of the midpoints in the midpoint set is taken as the target point, and the number of the target points corresponding to the target points that are determined to be the same point is counted and recorded as the statistical value Dnum. The midpoint corresponding to the largest statistical value Dnum is indexed and taken as the main point of the camera module.

[0019] As a preferred option, the threshold The value ranges from 0.5 pixel coordinates to 1.5 pixel coordinates.

[0020] To achieve at least one of the above objectives, the technical solution adopted by the present invention is as follows: a testing device, comprising: a processor; a memory, wherein executable instructions of the processor are stored; wherein the processor is configured to perform the steps of the optical center and principal point testing method of the camera module as described above by executing the executable instructions.

[0021] To achieve at least one of the above objectives, the technical solution adopted by the present invention is: a storage medium for storing a computer-readable program, wherein the program is executed by a processor to implement the steps of the optical center and principal point testing method of the camera module as described above.

[0022] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0023] (1) The test method allows the use of the target image for optical center calculation, which helps to avoid the need for additional uniform light source for optical center testing, thereby simplifying the process of optical center and principal point testing and improving the efficiency of optical center and principal point testing;

[0024] (2) The test method allows the use of color blocks on the target plate to calculate the principal point, which helps to avoid adding extra MARK points on the target plate for principal point testing, thereby reducing the production cost of the target plate;

[0025] (3) The test method allows the use of a standard plate to test the optical center and principal point of the camera module, thereby reducing the environmental requirements for optical center testing and the requirements for the standard plate for principal point testing. At the same time, the standard plate is also used for SFR testing, thereby reducing equipment and material costs and improving the correction efficiency of optical center and principal point. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating the testing process for the optical center and principal point of the relevant technology.

[0027] Figure 2 This is a schematic flowchart of optical center and principal point testing according to some embodiments of this application.

[0028] Figure 3A It is an image of a marker plate with MARK dots, which is a related technology.

[0029] Figure 3B It is another image of a marker plate with MARK dots in the related technology.

[0030] Figure 3C It is another image of a marker plate with MARK dots in the related technology.

[0031] Figure 4 These are reference pedigree images according to some embodiments of this application.

[0032] Figure 5 These are binarized images according to some embodiments of this application.

[0033] Figure 6 These are optical center test images according to some embodiments of this application.

[0034] Figure 7A These are the optical center region and optical center according to some embodiments of this application.

[0035] Figure 7B Examples of optical center regions and coordinate values ​​of optical centers according to some embodiments of this application.

[0036] Figure 8 These are reference pedigree images according to other embodiments of this application.

[0037] Figure 9 The image to be processed is based on some embodiments of this application.

[0038] Figure 10 These are key point test images according to some embodiments of this application.

[0039] Figure 11A These are the main points of some embodiments of this application.

[0040] Figure 11B These are examples of the coordinate values ​​of principal points according to some embodiments of this application. Detailed Implementation

[0041] The present invention will now be further described in conjunction with specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.

[0042] The terms “comprising” and “having”, and any variations thereof, in the specification and claims of this application are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.

[0043] It should be noted that, as used in this application, the terms “basically,” “approximately,” and similar terms are used to indicate approximation rather than degree, and are intended to describe inherent deviations in measured or calculated values ​​that would be recognized by a person skilled in the art.

[0044] In related technologies, such as Figure 1 , Figures 3A to 3C As shown, optical center testing and principal point testing are typically separated into two independent processes. The specific procedure is as follows: First, the camera module is powered on; then, in a uniform light source environment without any pattern, a small light source is moved above the camera module to obtain an image for optical center calculation, thereby calculating the coordinates of the optical center; next, the small light source is removed, and the camera module photographs the target plate with MARK points to obtain an image for principal point calculation, thereby calculating the coordinates of the principal point; finally, the camera module undergoes SFR (Spatial Frequency Response) testing. This testing method leads to problems such as high target plate manufacturing costs and low overall testing efficiency.

[0045] To address or at least partially mitigate the shortcomings of the aforementioned optical center and principal point testing methods, this application proposes a method for testing the optical center and principal point of a camera module, such as... Figure 2 As shown, it mainly includes two parts: optical center testing and principal point testing. The optical center testing is as follows: Figures 4 to 7B As shown, it includes the following steps:

[0046] A. Obtain the label image, which includes several color block graphics, and the color block graphics correspond to the color blocks on the label.

[0047] B. Using a surface fitting algorithm, the color block graphics in the standard plate image are removed to obtain the optical center test image. The gray value of the central area of ​​the optical center test image is high, and the gray value of the surrounding area is low.

[0048] C. Select a set of pixels with gray values ​​greater than the threshold Threshoc to obtain the optical center region;

[0049] D. Calculate the center coordinates (OCx, OCy) of the optical center region to serve as the coordinates of the optical center of the camera module.

[0050] The optical center testing method described above allows for optical center calculation using a target image, which helps avoid the need for additional uniform light sources, thus simplifying the process of optical center and principal point testing and improving the efficiency of optical center and principal point testing.

[0051] It is understandable that related technologies employ the point light source method to measure the optical center. Specifically, a small point light source is placed in front of a solid-color background, such as a white diffuse reflector, to form a high-contrast light spot. By moving the camera module or light source, the center of the light spot remains stationary in the image, and this stationary point is the projection of the optical center onto the image. If a marker with colored patches is used for the point light source method, the texture of the marker will interfere with the detection of the light spot center; in other words, it will reduce the accuracy of the optical center test.

[0052] In this embodiment, the surface fitting algorithm in step B is used to remove color block graphics from the target image to obtain an optical center test image with high gray values ​​in the central area and low gray values ​​in the surrounding area, such as... Figure 6 As shown, this helps to avoid the influence of color block graphics on the optical center test. Further, through step C, the brightest region in the optical center test image, i.e., the optical center region, is obtained, as shown... Figure 7A and Figure 7B As shown. Furthermore, through step D, the center coordinates of the optical center region are calculated, and used as the coordinates of the optical center of the camera module, as follows. Figure 7B As shown, Figure 7B The coordinates of the optical center in the example are merely an example, and this application does not impose specific limitations on the coordinate values ​​of the optical center. It is worth noting that the above-described optical center testing method is applicable to different target plates and can handle different camera modules, thereby expanding the applicability of the optical center testing method.

[0053] In some embodiments, the principal point test is as follows: Figures 8 to 11B As shown, it includes the following steps:

[0054] E. Binarize the target image to obtain the main point test image. The main point test image includes several color block graphics. The color blocks corresponding to the color blocks on the target are symmetrically distributed with respect to the main point.

[0055] F. Calculate the coordinates of the midpoint between any two color blocks to obtain the set of midpoints;

[0056] G. Calculate the distance dist between any two midpoints in the midpoint set. When the distance dist is less than the threshold... When two midpoints are equal, they are determined to be the same.

[0057] H, the midpoint that is identified as the most frequent point of agreement, is used as the main point of the camera module.

[0058] It should be understood that in related technologies, additional marker points with distinguishing features are added to the label, such as... Figures 3A to 3C As shown, the circled dots are MARK points. The coordinates of the principal point are obtained using the position of the MARK points, but this increases the production cost of the label. In this embodiment, the principal point can be calculated using the color blocks on the label through the above-mentioned principal point testing method, which helps to avoid adding extra MARK points (feature points) to the label for principal point testing, thereby reducing the production cost of the label.

[0059] Specifically, such as Figure 8 As shown, since the color blocks on the chart are symmetrically arranged relative to the principal point, step F calculates the coordinates of the midpoint between any two color blocks, i.e., calculates the coordinates of the midpoint between every two color blocks. The resulting set of midpoints contains the most midpoints that fall on the principal point. Further, step G calculates the distance between every two midpoints to identify the midpoints with the most common points; in other words, it identifies the midpoints that fall on the most common coordinates. Even further, step H selects the coordinates that appear most frequently in the set of midpoints as the coordinates of the principal point.

[0060] In at least one embodiment, the threshold The value ranges from 0.5 to 1.5 pixels, which can be used to determine whether the coordinates of two midpoints are actually the same. It should be understood that within the range of 0.5 to 1.5 pixels, the coordinates of the two midpoints differ very little, and the coordinates of either midpoint can be selected as the coordinates of the principal point, with the fluctuation range meeting the required precision.

[0061] It is worth mentioning that the aforementioned optical center and principal point testing methods allow for the use of a reference plate to test the optical center and principal point of the camera module. This reduces the environmental requirements for optical center testing and the requirements for the reference plate for principal point testing. In other words, the same reference plate image can be used for both optical center and principal point testing, enabling simultaneous optical center and principal point testing. This improves the compatibility of optical center and principal point testing, simplifies the testing process, and increases the correction efficiency of optical center and principal points. Furthermore, the reference plate is also used for SFR testing, thereby reducing equipment and material costs.

[0062] In some embodiments, the surface fitting algorithm in step B includes the following steps:

[0063] B1. Select pixels on the standard image whose grayscale value is greater than the threshold Thresh1 to obtain the image to be fitted, Fimg(x,y); that is, , ;

[0064] B2. Establish a polynomial equation and substitute the gray values ​​of several pixels in the image to be fitted to obtain the fitting coefficients (coef).

[0065] B3. Fit the image to be fitted using the fitting coefficient coef to obtain the optical center test image, such as... Figure 6 As shown.

[0066] It should be understood that the target image contains several color blocks, which are usually black and have low grayscale values. Step B1 selects pixels in the target image with grayscale values ​​greater than the threshold Thresh1, thus removing the color blocks to obtain the image to be fitted. Further, steps B2 and B3 "fill in" the areas where the color blocks were removed, resulting in a photocenter test image with a natural grayscale transition, which helps avoid interference from the color blocks in the photocenter test.

[0067] It is worth mentioning that in step B1, the target image can be binarized using a threshold Thresh1 to obtain a binarized image, such as... Figure 5 As shown, the color block graphic is black, and the rest is white, thus allowing the coordinates of the white part to be extracted. Furthermore, binarizing the image facilitates the operator's check of the appropriateness of the threshold Thresh1. Further, the pixels in the image to be fitted are the pixels corresponding to the coordinates of the aforementioned white part, and the data of the pixels in the image to be fitted is the grayscale data of the standard image, not the grayscale data of the binarized image.

[0068] In some embodiments, step B1 further includes obtaining a threshold Thresh1. Specifically, obtaining the threshold Thresh1 includes the following steps:

[0069] B11. Obtain the grayscale value of the target image img(x,y);

[0070] B12. Based on the grayscale value img(x,y), calculate the minimum grayscale value minV1, the maximum grayscale value maxV1, and the average grayscale value meanV1 of the target image.

[0071] B13. Calculate the threshold Thresh1. , where a1, b1 and c1 are proportional parameters, representing the proportions of the minimum gray value minV1, the maximum gray value maxV1 and the average gray value meanV1 in the threshold Thresh1, respectively.

[0072] It should be understood that a1, b1, and c1 are manually set fixed parameters, while the minimum grayscale value minV1, maximum grayscale value maxV1, and average grayscale value meanV1 are calculated parameters related to the target image. Specifically, ; ; .

[0073] Furthermore, by using a1, b1, and c1, the threshold Thresh1 can be adjusted according to the minimum gray value minV1, the maximum gray value maxV1, and the average gray value meanV1; that is, the threshold Thresh1 can adaptively change according to the overall brightness of the target image, thereby improving the flexibility and applicability of the optical center testing method.

[0074] In some embodiments, step B2 calculates the fitting coefficients coef using the least squares method, wherein... The polynomial equation is , where n is the number of pixels in the image to be fitted, and m is the number of coefficients in the polynomial equation. In other words, the gray values ​​of all pixels in the image to be fitted are substituted into the polynomial equation to obtain the fitting coefficients (coef).

[0075] In at least one embodiment, a sixth-order polynomial is used for fitting, with a coefficient of 28. It should be understood that the number of pixels in the image to be fitted is far more than 28, therefore n >> m. The polynomial equation is overdetermined. The least squares method is used to minimize the sum of squared residuals of all equations to obtain a better solution for the fitting coefficients coef. This results in a more natural transition of grayscale values ​​in the optical center test image, which is beneficial for improving the accuracy and reliability of the final optical center coordinate calculation.

[0076] In other embodiments, a subset of pixels in the image to be fitted can be selected to calculate the fitting coefficients (coef), thereby reducing computational load, improving the efficiency of optical center testing, and lowering the computational performance requirements of the optical center testing equipment, which helps save costs. This application does not impose specific limitations on selecting all or a subset of pixels in the image to be fitted for calculating the fitting coefficients (coef).

[0077] In some embodiments, the optical center test image in step B3 is denoted as Zimg(x,y). Specifically, Where hw is the number of pixels in the target image, h is the height of the target image, and w is the width of the target image. In other words, the area where the subtracted color blocks are removed is "filled" by the fitting coefficient coef, so that the number of pixels, length, and width of the optical center test image obtained after fitting are consistent with the number of pixels, length, and width of the target image, respectively.

[0078] In some embodiments, obtaining the optical center region and calculating the center coordinates (OCx, OCy) of the optical center region includes the steps of...

[0079] CD1. Compare the grayscale value of each pixel in the optical center test image with the threshold Threshoc.

[0080] CD2. When the grayscale value of a pixel exceeds the threshold Threshoc, the pixel's x-coordinate xi and y-coordinate yi are added to the total x-coordinate value SumX and the total y-coordinate value SumY, respectively, and the count value k is incremented by 1; the initial values ​​of the total x-coordinate value SumX, the total y-coordinate value SumY, and the count value k are all 0; that is, ;

[0081] CD3, Calculate the mean of the x-axis. , as OCx; calculate the mean of the ordinate. , as OCy, to obtain the center coordinates (OCx, OCy) of the optical center region; that is, .

[0082] It should be understood that through steps CD1 to CD3, regions in the optical center test image with gray values ​​higher than the threshold Threshoc can be selected; in other words, such as... Figure 7A and Figure 7B As shown, a relatively bright area in the optical center test image can be selected as the optical center region, thus roughly determining the location range of the optical center of the camera module. Furthermore, the center coordinates of the optical center region are calculated to serve as the coordinates of the optical center of the camera module.

[0083] In some embodiments, step CD1 further includes obtaining a threshold Threshoc. Specifically, obtaining the threshold Threshoc includes the following steps:

[0084] CD11. Obtain the optical center test image Zimg(x,y);

[0085] CD12. Based on the optical center test image Zimg(x,y), count the number of pixels Hist(m) for each gray value, where m is 0, 1, 2, ..., 255;

[0086] CD13, Solve To obtain mi, where Ratio is a preset proportion parameter, w is the width of the optical center test image, and h is the height of the optical center test image;

[0087] CD14, Threshoc=mi.

[0088] In some embodiments, the histogram algorithm is used to count the number of pixels Hist(m) for each gray value of the optical center test image Zimg(x,y), i.e. It should be understood that other algorithms can also be used to obtain Hist(m), and this application does not impose specific restrictions on this.

[0089] It should be understandable that the formula in step CD13... The number of pixels is counted from high to low based on their grayscale values ​​until the number of pixels with a grayscale value of mi is added. At this point, the ratio of the counted number of pixels to the total number of pixels in the optical center test image satisfies the ratio parameter Ratio. In this case, the threshold Threshoc = mi. Here, mi is a value of 0, 1, 2, ..., 255.

[0090] It is worth mentioning that, without adding the number of pixels with a grayscale value of mi, the following condition is met: And by adding the number of pixels with a grayscale value of mi, we can satisfy... At that time, the threshold Threshoc=mi or Threshoc=m(i-1) can be set according to actual needs. This application does not impose specific restrictions on this.

[0091] In at least one embodiment, the ratio parameter Ratio ranges from 10% to 30%. It should be understood that if the ratio parameter Ratio is less than 10%, the area of ​​the optical center region may be too small; in other words, too few pixels may participate in the optical center calculation, thus reducing the accuracy of the optical center test. If the ratio parameter Ratio is greater than 30%, the optical center region may involve the boundary of the optical center test image, further reducing the accuracy of the optical center test. In this embodiment, the ratio parameter Ratio ranges from 10% to 30%, meaning it is a value within this range. This ensures that the area of ​​the optical center region is appropriate and helps avoid involving the boundary of the optical center test image, thereby improving the accuracy and calculation precision of the optical center test.

[0092] In some embodiments, step E further includes reducing the target image by a factor of N to obtain the image to be processed, such as... Figure 9 As shown; the image to be processed is binarized to obtain the principal point test image Binimg(x,y), as follows. Figure 10 As shown. Specifically, , where Thresh2 is the threshold for binarization.

[0093] It should be understood that by reducing the size of the target image, the number of pixels required for subsequent steps can be reduced, thereby improving processing efficiency; and the computational performance requirements of the main point testing equipment can be lowered, which is beneficial for cost savings. It is worth mentioning that the target image can be reduced using methods such as nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation, and this application does not impose specific limitations on this.

[0094] In some embodiments, step E further includes obtaining the threshold Thresh2 used for binarization processing. Specifically, obtaining the threshold Thresh2 includes the following steps:

[0095] E1. Obtain the grayscale value Reimg(x,y) of the image to be processed;

[0096] E2. Based on the grayscale value Reimg(x,y), calculate the minimum grayscale value minV2, the maximum grayscale value maxV2, and the average grayscale value meanV2 of the image to be processed.

[0097] E3. Calculate the threshold Thresh2. , where a2, b2 and c2 are proportional parameters, representing the proportions of the minimum gray value minV2, the maximum gray value maxV2 and the average gray value meanV2 in the threshold Thresh2, respectively.

[0098] It should be understood that a2, b2, and c2 are manually set fixed parameters, while the minimum grayscale value minV2, maximum grayscale value maxV2, and average grayscale value meanV2 are calculated parameters related to the grayscale value Reimg(x,y). Specifically, .

[0099] Furthermore, by using a2, b2, and c2, the threshold Thresh2 can be adjusted according to the minimum gray value minV2, the maximum gray value maxV2, and the average gray value meanV2; that is, the threshold Thresh2 can adaptively change according to the overall brightness of the image to be processed, thereby improving the flexibility and applicability of the principal point test method.

[0100] In some embodiments, principal point testing further includes the step of...

[0101] F1. Find the connected regions on the principal point test image; that is, ;

[0102] F2. Calculate the area of ​​each connected region, i.e., When the area of ​​a connected region is greater than the lower limit areaB and less than the upper limit areaT, the connected region is determined to be a color block graphic.

[0103] F3. Calculate the center coordinates of each color block graphic, such as Figure 10 As shown, the center coordinates of the color block graphic are used to calculate the coordinates of the midpoint between any two color blocks, that is, , y, where pointx(q) and pointy(q) are the coordinates of the q-th color block.

[0104] It is understandable that steps F1 and F2 enable more reliable identification of the block pattern, which helps to avoid interference from small specks in the principal point test, thereby improving the accuracy of subsequent principal point coordinate calculation.

[0105] In at least one embodiment, the formula for calculating the coordinates of the midpoint between two color blocks is: Where Mpointx(p) and Mpointy(p) are the coordinates of the p-th midpoint; ;and .

[0106] In some embodiments, step G specifically includes the step...

[0107] G1. Take one of the midpoints in the midpoint set as the target point, and the remaining midpoints as undetermined points. Calculate the distance *dist* between the target point and each undetermined point. If the distance *dist* is less than a threshold... When the point to be determined is the same as the target point, that is, Where Mpointx(pi) and Mpointy(pi) are the coordinates of the pi-th target point's midpoint, and Mpointx(pj) and Mpointy(pj) are the coordinates of the pj-th undetermined point's midpoint;

[0108] G2. Each midpoint in the midpoint set is taken as a target point. The number of undetermined points corresponding to each target point that are identified as the same point is counted, and denoted as the statistical value Dnum; that is... ;

[0109] G3, the maximum statistical value Dnum, and the midpoint corresponding to the maximum statistical value Dnum, are used as the principal point (Cx, Cy) of the camera module; that is, .

[0110] It should be understood that through steps G1 and G2, the distance dist between each midpoint in the midpoint set and the remaining midpoints can be calculated one by one, and the distance dist is compared with the threshold. This is to further determine and count how many common points each midpoint has. Furthermore, through step G3, the midpoint with the most common points is obtained and used as the main point (Cx, Cy) of the camera module, as shown below. Figure 11A and Figure 11B As shown, Figure 11B The coordinates of the principal point in the example are only for illustration, and this application does not impose specific restrictions on the coordinate values ​​of the principal point.

[0111] As mentioned earlier, since the color blocks on the chart are symmetrically arranged relative to the principal point, the number of midpoints falling on or near the principal point is the largest in the midpoint set. Steps G1 and G2 can count the number of midpoints falling on a certain coordinate; step G3 allows us to select the coordinate that appears most frequently in the midpoint set as the principal point (Cx, Cy).

[0112] In other embodiments, two color blocks symmetrically distributed relative to the main point on the label are grouped together, and the coordinates of the midpoints between the corresponding color block graphics in each group are calculated to obtain a set of midpoints. This helps reduce the amount of computation, especially when there are many color blocks on the label, significantly reducing the computational workload of the midpoint coordinates, thereby improving the computational efficiency of the main point test and reducing the computational performance requirements of the main point test equipment, which helps save costs. Furthermore, the main point (Cx, Cy) can be calculated through the above steps G1 to G3; or, the coordinates that appear most frequently in the set of midpoints can be used as the coordinates of the main point. This application does not impose specific limitations on this.

[0113] It is worth mentioning that, after the above optical center test to calculate the coordinates (OCx, OCy) of the optical center, the optical center of the camera module can be further corrected so that the distance between the actual position (OCx, OCy) of the optical center and the theoretical optical center is within the threshold range; similarly, after the above principal point test to calculate the coordinates (Cx, Cy) of the principal point, the principal point of the camera module can be further corrected so that the distance between the actual position (Cx, Cy) of the principal point and the theoretical principal point is within the threshold range.

[0114] In some embodiments, after completing optical center correction and principal point correction, the camera module undergoes SFR testing. It should be understood that different camera modules use different reference plates for SFR testing, and the aforementioned optical center and principal point testing methods are applicable to different reference plates, improving compatibility. Furthermore, the optical center and principal point have a significant impact on the SFR of the camera module; therefore, it is necessary to test, calculate, and correct the optical center and principal point of the camera module before performing SFR testing to ensure the accuracy of the measured SFR.

[0115] In at least one embodiment, such as Figure 2 As shown, the specific process for testing the optical center and principal point is as follows: First, the camera module is powered on; then, the camera module takes a picture of the target board to obtain the image of the target board, and then the coordinates (OCx, OCy) of the optical center and the coordinates (Cx, Cy) of the principal point are calculated; finally, the camera module is subjected to SFR testing; this simplifies the testing process of the camera module and improves testing efficiency.

[0116] A testing device includes: a processor; a memory storing executable instructions of the processor; wherein the processor is configured to execute the steps of the above-described method for testing the optical center and principal point of a camera module by executing the executable instructions, thereby enabling the calculation of the optical center and principal point using a target image, which helps to avoid the need for optical center testing with an additional uniform light source and to avoid the need to set additional MARK points on the target, thereby simplifying the process of optical center and principal point testing and improving the efficiency of optical center and principal point testing.

[0117] A storage medium for storing a computer-readable program, which is executed by a processor to implement the steps of the optical center and principal point testing method of the camera module described above. This method enables the calculation of optical center and principal point using a target image, which helps to avoid optical center testing through an additional uniform light source and avoids setting additional MARK points on the target, thereby simplifying the process of optical center and principal point testing and improving the efficiency of optical center and principal point testing.

[0118] Furthermore, the storage medium includes, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specifically, the storage medium includes, but is not limited to: electrical connections having one or more wires, portable disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0119] Furthermore, this includes program code written in any combination of one or more programming languages ​​to execute the aforementioned testing methods for the optical center and principal point of the camera module. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0120] The basic principles, main features, and advantages of this invention have been described above. Those skilled in the art should understand that this invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made without departing from the spirit and scope of the invention, and all such changes and modifications fall within the scope of the invention as claimed. The scope of protection claimed by this invention is defined by the appended claims and their equivalents.

Claims

1. A method for testing the optical center and principal point of a camera module, characterized in that, include: Optical center testing and principal point testing, wherein the optical center testing includes, Acquire a label image, the label image including a plurality of color block graphics, the color block graphics corresponding to the color blocks on the label; A surface fitting algorithm is used to remove the color block graphics in the target image to obtain the optical center test image. The optical center test image has a high gray value in the middle area and a low gray value in the surrounding area. Select a set of pixels with gray values ​​greater than the threshold Threshoc to obtain the optical center region; Calculate the center coordinates (OCx, OCy) of the optical center region to serve as the coordinates of the optical center of the camera module; The principal point test includes, The target image is binarized to obtain the main point test image. The main point test image includes several color block graphics, and the color blocks corresponding to the several color block graphics are symmetrically distributed on the target with respect to the main point. Calculate the coordinates of the midpoint between any two of the color block graphics to obtain the set of midpoints; Calculate the distance dist between any two midpoints in the midpoint set. When the distance dist is less than a threshold... When the two midpoints are determined to be identical, they are considered to be the same point. The midpoint that is identified as having the most identical points is designated as the main point of the camera module.

2. The method for testing the optical center and principal point of a camera module according to claim 1, characterized in that, The surface fitting algorithm includes, Select pixels in the target image whose grayscale value is greater than the threshold Thresh1 to obtain the image to be fitted. Establish a polynomial equation and substitute the gray values ​​of several pixels in the image to be fitted to obtain the fitting coefficients coef. The image to be fitted is fitted using the fitting coefficient coef to obtain the optical center test image.

3. The method for testing the optical center and principal point of a camera module according to claim 2, characterized in that, Obtaining the threshold Thresh1 includes, Obtain the grayscale value img(x,y) of the target image; Based on the grayscale value img(x,y), calculate the minimum grayscale value minV1, the maximum grayscale value maxV1, and the average grayscale value meanV1 of the target image; Calculate the threshold Thresh1. Where a1, b1 and c1 are proportional parameters, representing the proportions of the minimum gray value minV1, the maximum gray value maxV1 and the average gray value meanV1 in the threshold Thresh1, respectively.

4. The method for testing the optical center and principal point of a camera module according to claim 1, characterized in that, Obtaining the optical center region and calculating the center coordinates (OCx, OCy) of the optical center region includes: The grayscale value of each pixel in the optical center test image is compared with the threshold Threshoc. When the gray value of a pixel is greater than the threshold Threshoc, the horizontal coordinate xi and vertical coordinate yi of the pixel are added to the total horizontal coordinate value SumX and the total vertical coordinate value SumY, respectively, and the count value k is incremented by 1; the initial values ​​of the total horizontal coordinate value SumX, the total vertical coordinate value SumY, and the count value k are all 0. Calculate the mean of the x-axis , as OCx; calculate the mean of the ordinate. , as OCy, to obtain the center coordinates (OCx, OCy) of the optical center region.

5. The method for testing the optical center and principal point of a camera module according to claim 1, characterized in that, Obtaining the threshold Threshoc includes, Obtain the optical center test image Zimg(x,y); Based on the optical center test image Zimg(x,y), the number of pixels Hist(m) for each gray value is counted, where m is 0, 1, 2, ..., 255; Solve To obtain mi, where Ratio is a preset proportion parameter, w is the width of the optical center test image, and h is the height of the optical center test image; The threshold Threshoc=mi.

6. The method for testing the optical center and principal point of a camera module according to claim 5, characterized in that, The histogram algorithm is used to count the number of pixels Hist(m) for each grayscale value; the ratio parameter Ratio ranges from 10% to 30%.

7. The method for testing the optical center and principal point of a camera module according to claim 1, characterized in that, The target image is reduced by a factor of N to obtain the image to be processed; the image to be processed is binarized to obtain the principal point test image.

8. The method for testing the optical center and principal point of a camera module according to claim 7, characterized in that, The threshold Thresh2 used for binarization includes: Obtain the grayscale value Reimg(x,y) of the image to be processed; Based on the grayscale value Reimg(x,y), calculate the minimum grayscale value minV2, the maximum grayscale value maxV2, and the average grayscale value meanV2 of the image to be processed; Calculate the threshold Thresh2. , where a2, b2 and c2 are proportional parameters, representing the proportions of the minimum gray value minV2, the maximum gray value maxV2 and the average gray value meanV2 in the threshold Thresh2, respectively.

9. The method for testing the optical center and principal point of a camera module according to claim 1, characterized in that, The principal point test also includes, Find the connected regions on the principal point test image; Calculate the area of ​​each of the connected regions. When the area of ​​a connected region is greater than the lower limit areaB and less than the upper limit areaT, the connected region is determined to be the color block graphic. Calculate the center coordinates of each of the color blocks, and use the center coordinates of the color blocks to calculate the coordinates of the midpoint between any two color blocks.

10. The method for testing the optical center and principal point of a camera module according to claim 1, characterized in that, Two color blocks symmetrically distributed relative to the main point on the label are divided into a group, and the coordinates of the midpoints between the color block graphics corresponding to each group of color blocks are calculated to obtain the set of midpoints.

11. The method for testing the optical center and principal point of a camera module according to claim 1 or 10, characterized in that, One of the midpoints in the midpoint set is designated as the target point, and the remaining midpoints are designated as undetermined points. The distance *dist* between the target point and each of the undetermined points is calculated. If the distance *dist* is less than a threshold, the target point is considered. When the point to be determined is a point that is the same as the target point, the point to be determined is determined to be the same point as the target point. Each of the midpoints in the midpoint set is taken as the target point, and the number of points in the undetermined points corresponding to each target point that are identified as the same point is counted and denoted as the statistical value Dnum. The maximum statistical value Dnum is indexed, and the midpoint corresponding to the maximum statistical value Dnum is used as the master point of the camera module.

12. The method for testing the optical center and principal point of a camera module according to claim 1 or 10, characterized in that, threshold The value ranges from 0.5 pixel coordinates to 1.5 pixel coordinates.

13. A testing device, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the optical center and principal point testing method of any one of claims 1-12 by executing the executable instructions.

14. A storage medium for storing a computer-readable program, characterized in that, The program is executed by the processor to implement the steps of the optical center and principal point testing method of the camera module according to any one of claims 1-12.

Citation Information

Patent Citations

  • Optical center positioning method and device of fish-eye lens and quality detection method of camera module

    CN109859261A

  • Method, device and equipment for aligning optical center of lens with center of light-sensitive surface, and medium

    CN117793333A