Phase focusing-based lens module field curvature defect detection method
Through the lens module field curve defect detection method based on phase focus, the traditional detection method is solved, and efficient, automated and quantifiable detection is achieved, suitable for large-scale production and optimized design.
Patent Information
- Application Number
- CN202510482048.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-08-05
AI Technical Summary
Traditional field curve defect detection methods are inefficient, poorly accurate and costly, making it difficult to meet the needs of large-scale lens module production.
The field curve defect detection method of lens module based on phase focus is adopted. By finely dividing the lens module framing area, the phase difference value is calculated, and the imaging surface model is constructed, and the spatial distribution characteristics of the off-focus are analyzed to achieve efficient, automated, and quantifiable detection.
It significantly improves the efficiency and accuracy of field curve defect detection, is suitable for large-scale lens module production and quality testing, and provides data support for optimized design.
Smart Images

Figure CN120431031A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical detection, and in particular to a method for detecting field curvature defects of a lens module based on phase focusing. Background Art
[0002] Field curvature in lens modules is a common aberration in optical systems. This defect causes the imaging plane to curve rather than be flat. This defect reduces image clarity at the edges, impacting image quality. Traditional methods for detecting field curvature defects typically rely on large, precision instruments, which are inefficient and costly, making them unsuitable for large-scale lens module production and quality inspection.
[0003] The existing technical challenge is that traditional methods for detecting field curvature defects suffer from low efficiency, poor accuracy, and high costs, making them difficult to meet the demands of large-scale production. Phase-detection focusing technology offers advantages in focusing speed and accuracy, but its application in field curvature detection is still immature. Large-scale production environments lack an efficient, automated, and quantifiable method for detecting field curvature defects. Summary of the Invention
[0004] In response to the above problems, the present invention aims to propose a method for detecting field curvature defects of lens modules based on phase focusing, so as to solve the problems of low efficiency and high cost of field curvature defect detection in the existing technology, and to realize efficient, automated and quantifiable large-scale detection of field curvature defects of lens modules.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A method for detecting field curvature defects in a lens module based on phase focusing comprises the following steps:
[0007] S1, finely dividing the framing area of the lens module into grids;
[0008] S2, calculates the phase difference value of each grid area based on the phase focusing technology;
[0009] S3, calculating the defocus degree and confidence level according to the phase difference value, the confidence coefficient and the defocus conversion coefficient;
[0010] S4, builds an imaging surface model based on the defocus, analyzes the spatial distribution characteristics of the defocus, and detects and quantifies the field curvature defects of the lens module.
[0011] In one possible implementation, in S1, the framing area is a high-resolution pixel distribution area, and a uniform grid division method is used to evenly divide the width and height of the framing area into several segments to form multiple grid areas of equal area to ensure sampling uniformity of each grid area.
[0012] In a possible implementation, in S2, the phase difference value is calculated based on output data of the phase focus sensor, and the confidence of each grid area is evaluated by a statistical method.
[0013] In one possible implementation, in S3, the defocus conversion coefficient is determined by a calibration experiment and is used to convert the phase difference value into a defocus degree, and the conversion formula is:
[0014] Defocus=PDValue*Dcc+Offset
[0015] Where Defocus is the defocus degree, PDValue is the phase difference value, Dcc is the defocus conversion coefficient, and Offset is the offset calibrated according to the grid area.
[0016] In a possible implementation manner, the defocus degree constructed by the defocus degree model is a defocus degree obtained after interpolation and smoothing.
[0017] The present invention has at least the following beneficial effects: it has high efficiency, high precision and strong applicability, and is particularly suitable for the production and quality testing scenarios of large-scale lens modules. It can significantly improve the efficiency and accuracy of field curvature defect detection, meet the detection needs of high-quality lens modules in the field of modern optical manufacturing, and provide clear direction and data support for the optimized design of lens modules. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flowchart of a method for detecting field curvature defects in a lens module based on phase focusing according to an embodiment of the present invention;
[0019] Figure 2 This is a flow chart of obtaining calibration values in this embodiment;
[0020] Figure 3 is a schematic diagram of a phase focusing image sensor according to this embodiment;
[0021] Figure 4 is a test image for phase focus detection in this embodiment;
[0022] Figure 5 It is the image plane model after phase focus detection and image processing in this embodiment. DETAILED DESCRIPTION
[0023] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.
[0024] See also Figure 1 , shown is a method for detecting field curvature defects of a lens module based on phase focusing according to an embodiment of the present invention, comprising the following steps:
[0025] S1, finely dividing the framing area of the lens module into grids;
[0026] S2, calculates the phase difference value of each grid area based on the phase focusing technology;
[0027] S3, calculating the defocus degree and confidence level according to the phase difference value, the confidence coefficient and the defocus conversion coefficient;
[0028] S4, builds an imaging surface model based on the defocus, analyzes the spatial distribution characteristics of the defocus, and detects and quantifies the field curvature defects of the lens module.
[0029] In the S1's implementation, a lens module typically consists of a housing, protective glass, optical lens assembly, image sensor, filter, focus motor, aperture blades, circuit board, and chip. Light flows from the lens to the aperture, filter, and finally to the image sensor, fundamentally determining image quality. Lens control is achieved by internally comparing the results obtained from the image sensor, controlling the motor and fine-tuning the aperture blades for dynamic optimization.
[0030] In one specific application example, the framing area is a 3840 x 2160 pixel distribution area, covering the entire imaging range of the lens module. This resolution framing area reflects the imaging characteristics of the lens module, preserving the original image information without sacrificing overall accuracy, improving inspection efficiency and ensuring comprehensive and accurate inspection results.
[0031] The division method adopts uniform grid division, and the width of the framing area is evenly divided into 16 segments, and the height is evenly divided into 12 segments, forming 16*12 grid areas, and the area of each grid area is equal. The uniform division method can ensure the uniformity of data sampling and avoid detection errors caused by inconsistent area sizes. By refining the grid division, the framing area is decomposed into multiple independent detection units, which is convenient for the calibration and phase difference calculation and defocus analysis of the subsequent steps. Each grid area acts as an independent detection unit, which can reflect the local imaging characteristics and provide a data basis for the quantitative detection of field curvature defects. In other embodiments, different grid division methods and densities can be used according to the characteristics of the lens module and the resolution of the image to obtain image information of different accuracies.
[0032] After determining the grid division method, it is also necessary to calibrate the gain (GainMap), defocus conversion coefficient (Defoucs Conversion Coefficient, Dcc), and PD offset (PD Offset) data used for phase focusing. Among them, GainMap is used to compensate for the light intensity of the PD pixel for calculating the PD value, so that the photosensitivity of the PD pixel for calculating the PD value is the same as that of the normal pixel, thereby obtaining the correct PD value and image quality. Among them, Dcc is used by the system to convert the PD Value into the defocus value Defocus Value, and the distance value required to push the lens motor can be deduced from the Defocus Value. Since the PD value of the entire camera is not always 0 at the quasi-focus, there is a deviation, called PD Offset, and the DefoucsValue can be calculated from the Offset and Dcc. Therefore, it is necessary to traverse the combination of the lens's zoom ratio and motor in the calibration environment and calibrate the three values of Dcc, Offset and GainMap that need to be used.
[0033] For the specific calibration process, see Figure 2 As shown, prepare the calibration environment: prepare the vertical stripe plate; adjust the distance between the stripe plate and the lens so that the current motor is in the middle position between MARCO and INF; configure the aperture information;
[0034] Confirm the motor position: call the function interface to return the motor position at the current object distance;
[0035] Calibrate Dcc and Offset: Call the function interface to calibrate a set of Dcc and Offset information based on the current aperture information;
[0036] Determine whether all aperture information has been traversed. If so, set Dcc and Offset; call the function interface to write a set of Dcc and Offset information to the calibration file. If not, continue to perform the steps of calibrating Dcc and Offset.
[0037] The GainMap calibration process involves preparing the calibration environment; using a light source board to provide a stable lighting environment; configuring aperture parameters to control the amount of light entering and depth of field; starting the media path, video input, and video processing subsystems, binding them to implement data streaming, and creating a data pipeline to cache the separated image data; calling a function interface to separate the left and right images, and returning a frame of data containing the left and right image metadata;
[0038] Calibrate GainMap, call the function interface, and calibrate a set of GainMap information based on the current aperture information;
[0039] Determine whether all aperture information has been traversed. If so, write the GainMap; call the function interface to write a set of GainMap information to the calibration file. If not, continue to perform the steps of calibrating the GainMap.
[0040] S2, see Figure 3 This is a schematic diagram of an image sensor in a specific application embodiment of the present invention. In this embodiment, the image sensor outputs image information in the RGGB RAW8 format. Each pixel is distributed with two photodiodes, which serve as independent pixels for phase detection autofocus (PDAF) and can detect the phase difference of the current pixel position in the smallest unit. In the RGGB format adopted, each pixel is covered with a color filter (red, green, green, blue) to ensure that each pixel can only transmit light of one color, and the filter of each pixel is further divided into four small blocks through the QUAD Bayer arrangement, thereby improving the image quality and focusing performance in dim and bright environments. In order to further improve the amount of light entering the pixel and the color quality, a microlens is added to the filter. The microlens can focus more light on the photodiode to ensure that the image quality is not lost. Based on the phase focusing technology, the phase information output by the image sensor can be used to calculate the phase difference value of each grid area. By comparing the offset difference of the light received by the left and right photodiodes in the spatial position, the phase offset of the light is determined, and then the phase difference value is calculated. The dual-photodiode design utilizes each pixel for phase focusing, reducing the light input variations and image quality loss associated with traditional PD pixels. This allows for rapid and accurate calculation of phase differences, providing reliable data for subsequent defocus calculations. During the phase difference calculation process, statistical methods are used to assess the confidence level of each grid area, screening for highly reliable phase difference data and providing a foundation for subsequent data screening and model building.
[0041] A specific application example, in S3, see further Figure 4 The test environment was set up as follows: a diamond-shaped test pattern was placed on a backlit panel with constant light intensity, a 2.0x optical zoom was used, and the focus distance between the lens module and the test image was fixed at 50 cm. During the test, after focusing was achieved using phase-detection focusing technology, the resulting black and white frame image was saved for subsequent analysis.
[0042] Among them, based on the phase difference value calculated in S2, combined with the defocus conversion coefficient and the offset value, the defocus degree of each grid area is calculated. The calculation formula is:
[0043] Defocus=PDValue*Dcc+Offset
[0044] Among them, the defocus degree Defocus indicates the offset of the current grid area from the ideal focus plane; the phase difference value PD Value indicates the phase offset of the light; the defocus conversion coefficient Dcc is determined through calibration experiments and is used to convert the phase difference into defocus; the PD offset Offset is determined through calibration experiments and is used to correct system errors.
[0045] By accurately quantifying the defocus degree, the imaging surface distribution model is generated in the next step. The confidence level based on the phase difference is introduced to screen the phase difference values within a certain confidence range, effectively improving the quality of the phase difference data and reducing the interference of noise on the detection results.
[0046] In a specific application example, in S4, an imaging surface model is constructed based on the defocus data calculated in S3, and according to the confidence distribution, defocus data with a confidence level (range: [0, 65535]) greater than 4096 is screened out as reliable defocus. Based on the screened defocus data, the discrete defocus data is converted into a continuous field curvature distribution model through interpolation and smoothing. The interpolation method used in this embodiment is bilinear interpolation, which increases the distribution of data points and ensures the continuity of the model. The smoothing process used is Gaussian filtering, which removes noise data, improves the accuracy of the model, and generates a high-precision field curvature distribution model, providing a reliable data basis for defect detection.
[0047] See also Figure 5 , through the analysis of the spatial distribution characteristics of the defocus degree in the imaging surface model, the lens module in this embodiment has obvious field curvature defects. Through the visualization analysis of the two-dimensional defocus degree distribution diagram and the three-dimensional surface diagram, it can be clearly observed that the defocus degree in the lower right corner of the lens module deviates significantly from the ideal value, indicating that there is a more obvious field curvature defect in this area. In contrast, the defocus degree difference between the other three corner areas and the central area is small and all within the allowable error range. Therefore, the potential defects in the other three corner areas can be ignored. This analysis result provides clear direction and data support for the optimization design of the lens module.
[0048] The phase-focus-based lens module field curvature defect detection method of the embodiment of the present invention accurately calculates the defocus degree of each grid area through the phase difference value obtained based on the phase-focus technology, combined with the defocus conversion coefficient and confidence calculation. Based on the defocus degree data, an imaging surface model is constructed and its spatial distribution characteristics are visualized and analyzed, which can quickly and accurately present the field curvature defect problem of the test lens module. This method not only facilitates production personnel to intuitively identify defect areas, but also accurately detects field curvature defects, and provides data support for the optimized design of the lens module by quantitatively analyzing the severity of the defects. It has high efficiency, high precision and strong applicability, and is particularly suitable for large-scale lens module production and quality testing scenarios. It can significantly improve the efficiency and accuracy of field curvature defect detection, meet the detection needs of high-quality lens modules in the field of modern optical manufacturing, and provide a clear direction and data support for the optimized design of lens modules.
[0049] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. These changes and modifications are intended to fall within the scope of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for detecting field curvature defects of a lens module based on phase focusing, characterized in that: The following steps are involved: S1, finely dividing the framing area of the lens module into grids; S2, calculates the phase difference value of each grid area based on the phase focusing technology; S3, calculating the defocus degree and confidence level according to the phase difference value, the confidence coefficient and the defocus conversion coefficient; S4, builds an imaging surface model based on the defocus, analyzes the spatial distribution characteristics of the defocus, and detects and quantifies the field curvature defects of the lens module.
2. The method for detecting field curvature defects of a lens module based on phase focusing according to claim 1, wherein: In S1, the framing area is a high-resolution pixel distribution area, and a uniform grid division method is adopted to evenly divide the width and height of the framing area into several segments, forming multiple grid areas of equal area to ensure sampling uniformity of each grid area.
3. The method for detecting field curvature defects of a lens module based on phase focusing according to claim 2, wherein: In S2, the phase difference value is calculated based on the output data of the phase focus sensor, and the confidence of each grid area is evaluated by a statistical method.
4. The method for detecting field curvature defects of a lens module based on phase focusing according to claim 1, wherein: In S3, the defocus conversion coefficient is determined by a calibration experiment and is used to convert the phase difference value into a defocus degree. The conversion formula is: Defocus=PDValue*Dcc+Offset Where Defocus is the defocus degree, PDValue is the phase difference value, Dcc is the defocus conversion coefficient, and Offset is the offset calibrated according to the grid area.
5. The method for detecting field curvature defects of a lens module based on phase focusing according to claim 1, wherein: The defocus degree constructed by the defocus degree model is the defocus degree obtained after interpolation and smoothing.