Method for judging focal length

By combining the grayscale variance and grayscale average function of the focal plane pixel point, the focus position is carefully judged, and the problem of large measurement error of a single function is solved, and the high accuracy and stability of focal length measurement is achieved. It is suitable for optical component manufacturing, imaging equipment calibration and high-precision optical system design.

CN120594039APending Publication Date: 2025-09-05WESTLAKE INSTITUTE FOR OPTOELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510690063.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In the existing focal length measurement methods, a single evaluation function is susceptible to fluctuations in ambient light intensity and has high local noise sensitivity, resulting in large high-precision measurement errors and cannot meet the measurement needs of micron or even nanometers.

Method used

The method of combining the grayscale variance and grayscale average function of pixel points in the focal plane is used to carefully judge the focus position by combining the point light source and the collimated light source, draw a two-function relationship diagram, and select the middle position of the peak value of the grayscale average value and the grayscale variance function as the focus.

Benefits of technology

It significantly reduces the focus judgment error, from ±0.2mm to ±0.05mm, improves the robustness and accuracy of measurement, adapts to complex optical environments, and meets the needs of high-precision measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120594039A_ABST
    Figure CN120594039A_ABST
Patent Text Reader

Abstract

The invention discloses a method for judging a focal length. The method comprises the following steps of: 1, preliminarily judging a focal position by adopting point light source imaging; 2, finely judging a focus position by adopting a collimated light source; step 3, obtaining a gray value of an imaging point; step 4, obtaining a gray value of the imaging point; 5, drawing an imaging point gray average value function and an imaging point gray variance function, and drawing a position relation with the sample on the same horizontal coordinate; and selecting peak values of the gray average value function and the gray variance function, selecting the two peak values to correspond to the middle of the position of the sample, and judging the position as a focus. According to the method, the specific error of a single evaluation function is eliminated or reduced, the accuracy of focus position judgment is improved, the focus position is judged by combining the focal plane pixel point gray variance and the focal plane pixel point gray average value function, and the actual use requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for determining focal length, which belongs to the field of optical measurement technology and is specifically applicable to accurate focal length measurement in scenarios such as optical element manufacturing, imaging equipment calibration, and high-precision optical system design. Background Art

[0002] Focal length is a key parameter in optical systems that measures the convergence or divergence of light. It refers to the distance from the optical center of a lens to the focal point where the light converges when parallel light is incident. Its measurement is crucial in the field of optics and related industries. From a technological perspective, with the increasing demand for precision in optical instruments (such as cameras, telescopes, and microscopes), accurate focal length measurement has become essential for ensuring image quality. Early optical research employed the relationship between object distance and image distance based on the principles of geometric optics. In modern optical systems, the application of laser technology and photodetectors has driven the development of non-contact measurement methods, such as autocollimation and the dual-image method, improving measurement accuracy and efficiency. Focal length measurement is widely used in optical component manufacturing (ensuring that components such as lenses and prisms meet design standards), imaging equipment calibration (such as camera lens focal length calibration), and scientific research (such as optical system design and optimization). Furthermore, with the advancement of high-precision fields such as semiconductor lithography and laser processing, the demand for micrometer- and even nanometer-level focal length measurement is becoming increasingly urgent, driving the evolution of measurement technology towards higher precision and greater automation.

[0003] Automated measurement methods offer advantages such as high efficiency and minimal error in focal length measurement. Determining focal position is crucial in automated testing, requiring automated equipment to quickly and accurately determine the focal position. Typically, the grayscale value of the image point on the focal plane is selected as a parameter, input into a computer, and a given algorithm is used to determine the focal position. Some existing methods calculate the gradient energy accumulation of focal plane pixels and use the grayscale value as an evaluation function. Others use the focal plane grayscale variance function to calculate and determine the focal length position of the lens without mechanical movement. Overall, existing automated focus determination methods have significant limitations due to their single evaluation function: using grayscale energy accumulation as the evaluation function is susceptible to fluctuations in ambient light intensity, while using only the grayscale variance function is highly sensitive to local noise. For example, in a camera lens calibration experiment, the grayscale variance method alone resulted in a focus determination error of up to ±0.3mm when the lens surface contained minor scratches. However, the grayscale energy method exhibited an error exceeding ±0.25mm when the light source power fluctuated by 5%, clearly failing to meet the requirements of high-precision scenarios. Therefore, there is an urgent need for a focus judgment method that integrates multi-dimensional evaluation indicators to eliminate the systematic errors of a single function. Summary of the Invention

[0004] The present invention addresses the shortcomings of the above-mentioned technical solutions by eliminating or reducing the specific errors of a single evaluation function, thereby improving the accuracy of focus position determination. A method combining the grayscale variance of focal plane pixels and the grayscale mean value of focal plane pixels is used to determine focus position, meeting practical application requirements.

[0005] In order to solve the above problems, the technical solutions adopted by the present invention are as follows:

[0006] A method for determining focal length comprises the following steps:

[0007] Step 1: Use point light source imaging to preliminarily determine the focus position

[0008] Place the light source, the sample to be tested, and the CCD detector in sequence. Move the sample position within a large moving step to obtain different clarity images on the imaging CCD. Use the observation method to determine the focus position range.

[0009] Step 2: Use a collimated light source to precisely determine the focus position

[0010] Place the collimated light source, the sample to be tested, and the CCD detector in sequence, and use a stepper motor to finely move the sample position within the focus position interval determined in step (1) to obtain imaging points of different clarity;

[0011] Step 3: Get the grayscale value of the imaging point

[0012] Formula (1) is used to calculate the relationship between the grayscale average function value of the imaging point and the position of the sample, and a function relationship diagram is drawn, as shown in Figure 1 As shown, in formula (1), i, j are the positions of the coordinate plane, and I(i, j) is the grayscale value at the position of the coordinate plane;

[0013]

[0014] Step 4: Get the grayscale value of the imaging point

[0015] Formula (2) is used to calculate the relationship between the grayscale variance function value of the imaging point and the position of the sample, and a function relationship diagram is drawn, as shown in Figure 2 I(i,j) is the grayscale value at the position in the coordinate plane, and I(i+1,j), I(i-1,j), I(i,j+1), and I(i,j-1) are the grayscale values ​​of adjacent positions respectively;

[0016]

[0017] Step 5: Draw the grayscale mean function value and the grayscale variance function value of the imaging point. Draw these two functions on the same coordinate graph, as shown in Figure (3). Select the peak values ​​of the grayscale mean function and the grayscale variance function, and select the middle position between the two peak values, which is the focus position.

[0018] Compared with the prior art, the present invention has the following advantages:

[0019] The present invention eliminates or reduces the specific errors of a single evaluation function, improving the accuracy of focus position judgment. It combines the grayscale variance of focal plane pixels with the grayscale average function of focal plane pixels to determine the focus position, meeting practical application requirements.

[0020] Through a dual-function fusion strategy, the present invention reduces the focus judgment error from the ±0.2mm level of a single function to ±0.05mm in a microscope objective focal length measurement experiment, and the standard deviation of repeated measurements is less than 0.03mm, significantly improving the measurement robustness in complex optical environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The relationship between the grayscale average value function of the imaging point and the position of the sample in the present invention;

[0022] Figure 2 The relationship between the grayscale variance function of the imaging point and the position of the sample in the present invention;

[0023] Figure 3 The focal position of the present invention is selected as the middle position between the two peaks. DETAILED DESCRIPTION

[0024] The present invention will be described below with reference to specific embodiments.

[0025] like Figures 1 to 3 A method for determining focal length includes the following steps:

[0026] Step 1: Use point light source imaging to preliminarily determine the focus position

[0027] Place the light source, the sample to be tested, and the CCD detector in sequence. Move the sample position within a large moving step to obtain different clarity images on the imaging CCD. Use the observation method to determine the focus position range.

[0028] Step 2: Use a collimated light source to precisely determine the focus position

[0029] Place the collimated light source, the sample to be tested, and the CCD detector in sequence, and use a stepper motor to finely move the sample position within the focus position interval determined in step (1) to obtain imaging points of different clarity;

[0030] Step 3: Get the grayscale value of the imaging point

[0031] Formula (1) is used to calculate the relationship between the grayscale average function value of the imaging point and the position of the sample, and a function relationship diagram is drawn, as shown in Figure 1As shown, in formula (1), i, j are the positions of the coordinate plane, and I(i, j) is the grayscale value at the position of the coordinate plane;

[0032]

[0033] Step 4: Get the grayscale value of the imaging point

[0034] Formula (2) is used to calculate the relationship between the grayscale variance function value of the imaging point and the position of the sample, and a function relationship diagram is drawn, as shown in Figure 2 I(i,j) is the grayscale value at the position in the coordinate plane, and I(i+1,j), I(i-1,j), I(i,j+1), and I(i,j-1) are the grayscale values ​​of adjacent positions respectively;

[0035]

[0036] Step 5: Draw the grayscale mean function value and the grayscale variance function value of the imaging point. Draw these two functions on the same coordinate graph, as shown in Figure (3). Select the peak values ​​of the grayscale mean function and the grayscale variance function, and select the middle position between the two peak values, which is the focus position.

[0037] The point light source is 2000mm away from the sample to be tested. The sample to be tested and the CCD detector are placed in sequence. The sample position is moved within a 0.3mm movement step. Different clarity images are obtained on the imaging CCD. The focus position range is determined by observation.

[0038] Use a collimated light source to precisely determine the focal position. Place the collimated laser light source, the sample to be measured, and the CCD detector in sequence. Within the focal position range determined by observation, use a stepper motor to precisely move the sample in 0.1mm increments to obtain images of varying clarity.

[0039] Obtain the grayscale value of the imaging point for precise judgment of the focus position. Use formula (1) to calculate the relationship between the grayscale mean value function of the imaging point and the position of the sample. Use formula (2) to calculate the relationship between the grayscale variance function of the imaging point and the position of the sample.

[0040] On the same horizontal axis, plot the grayscale mean function and grayscale variance function of the imaging point. Select the peaks of the grayscale mean function and grayscale variance function, corresponding to positions 6 and 7, respectively. Select the position between these two peaks, and the position between positions 6 and 7 is determined to be the focus.

[0041] The details are as follows:

[0042] Example 1: Conventional optical lens focal length measurement

[0043] Experimental conditions

[0044] Samples to be tested: Convex lens, nominal focal length 50mm

[0045] Light source configuration: point light source (λ=635nm) placed 3000mm away, collimated light source divergence angle <0.1mrad

[0046] Testing equipment: 12-megapixel CCD (pixel size 4.4μm×4.4μm), stepper motor accuracy 0.05mm

[0047] Implementation steps

[0048] Coarse positioning stage

[0049] Move the sample in 0.5mm steps and observe the image clarity on the CCD. When the sample position is in the range of 5.0-7.0mm, the imaging spot gradually shrinks from the circle of confusion. By visual observation, it is determined that the focus is roughly in the range of 6.0-6.5mm (such as Figure 1 Initial scan curve shown).

[0050] Precision positioning stage

[0051] Switch to a collimated light source and scan within the 6.0-6.5 mm range with a 0.05 mm step size. Each scan captures a 512 × 512 pixel image area and records the corresponding grayscale data.

[0052] Dual function calculation

[0053] Grayscale average value calculation: Taking the sample position of 6.25mm as an example, the total grayscale value of the imaging area is 3276800, the number of pixels is 512×512=262144, and F=3276800 / 262144=125.

[0054] Grayscale variance calculation: For a pixel at the position (100, 100), its grayscale value I = 120, and the adjacent pixel values ​​are 118, 122, 119, and 121, respectively. The single-pixel variance contribution is |120-118|+|120-122|+|120-119|+|120-121|=2+2+1+1=6. After accumulation over the entire area, PL = 163840.

[0055] Focus determination

[0056] Draw a dual function curve ( Figure 3 ), the grayscale average peak appears at 6.30mm (F=132), the grayscale variance peak appears at 6.35mm (P_L=184320), and the middle position 6.325mm is taken as the focus. Compared with the theoretical position 6.30mm after converting the actual focal length of 50mm, the error is only 0.025mm.

[0057] Example 2: High-precision laser lens focus detection

[0058] Experimental conditions

[0059] Sample to be tested: Femtosecond laser focusing lens, nominal focal length 100mm (wavelength 800nm)

[0060] Light source configuration: point light source (λ=800nm) placed 5000mm away, collimated light source wavefront error <λ / 10

[0061] Testing equipment: 2048×2048 pixel scientific-grade CCD, stepper motor accuracy 0.01mm

[0062] Implementation steps

[0063] Coarse positioning stage

[0064] Scanning with a step length of 0.3mm, within the sample position range of 10.0-12.0mm, it was found through CCD real-time monitoring that when the position was 11.2-11.5mm, the laser spot diameter shrank from 50μm to less than 10μm, and the coarse positioning range was determined to be 11.2-11.5mm.

[0065] Precision positioning stage

[0066] The scanning was performed in the range of 11.2-11.5 mm with a step size of 0.01 mm, and a 1024 × 1024 pixel area was acquired each time, and the grayscale data was recorded simultaneously.

[0067] Dual-function computing and data support

[0068] Grayscale average function: When the sample position is 11.35mm, the total grayscale value of the imaging area is 52428800, the number of pixels is 1024×1024=1048576, and F=52428800 / 1048576=50( Figure 1 This point corresponds to the peak of the curve).

[0069] Grayscale variance function: For the position 11.36mm, the grayscale value of a certain pixel (200,200) is I=55, and the adjacent pixel values ​​are 53, 57, 54, and 56. The single pixel variance contribution is 4+2+1+1=8, and the total area accumulation is PL=8388608 ( Figure 2 This point corresponds to the peak of the curve).

[0070] Focus determination

[0071] The peaks of the dual function are located at 11.35mm (F=50) and 11.36mm (P_L=8388608), respectively, with the focal point located in the middle at 11.355mm. Interferometer calibration determined the actual focal position of the lens to be 11.350mm, with an error of only 0.005mm, meeting the nanometer-level precision requirements of femtosecond laser processing.

[0072] Example 3: Focus calibration of complex optical systems

[0073] Experimental conditions

[0074] System under test: A zoom lens system consisting of three lenses with a working focal length range of 80-120mm

[0075] Light source configuration: White light point light source (color temperature 5500K) placed 4000mm away, collimated light source transmittance > 90%

[0076] Testing equipment: Color CCD (RGB three channels), stepper motor accuracy 0.1mm

[0077] Implementation steps

[0078] Coarse positioning stage

[0079] Scanning with a step length of 0.5mm, within the sample position range of 8.5-10.5mm, through observation of the RGB three-channel image, it was found that the interval with the clearest green channel imaging was 9.0-9.5mm, and the coarse positioning range was determined.

[0080] Precision positioning stage

[0081] Scanning was performed in the range of 9.0-9.5 mm with a step length of 0.08 mm, and a 2048 × 1536 pixel area was acquired each time. The grayscale mean and variance of the RGB channels were calculated respectively.

[0082] Multi-channel dual function fusion

[0083] Green channel grayscale average: at position 9.24mm, F=118 (peak)

[0084] Green channel grayscale variance: At position 9.28mm, P_L=256000 (peak value)

[0085] The red and blue channel data are used as auxiliary criteria to verify the peak consistency.

[0086] Focus determination

[0087] The focus is taken at 9.26mm, the middle position of the double peak of the green channel. After actual imaging testing, the MTF50 value of the full-frame image clarity at this position reaches 0.85 (theoretical value 0.88), proving that the focus positioning accuracy meets the calibration requirements of the zoom system.

[0088] Technical effect analysis

[0089] Error comparison experimental data

[0090] Evaluation Method Single grayscale average Single grayscale variance Dual function method of the present invention Standard lens test error ±0.18mm ±0.15mm ±0.04mm Laser lens test error ±0.12mm ±0.10mm ±0.02mm Complex system testing errors ±0.25mm ±0.22mm ±0.06mm

[0091] Robustness Verification

[0092] Light source fluctuation experiment: When the power of the collimated light source fluctuates by ±10%, the focus offset of the method of the present invention is less than 0.03mm, while the maximum offset of the single function method is 0.15mm.

[0093] Noise interference experiment: After adding Gaussian noise (σ=10) to the CCD, the error of the method of the present invention is still maintained at <0.05mm, while the error of the single function method exceeds 0.2mm.

[0094] Temperature drift experiment: When the ambient temperature rises from 20°C to 30°C, the focus position drift of the method of the present invention is 0.08mm, which is significantly better than the 0.3mm drift of the single function method.

[0095] Summary of technical advantages

[0096] The present invention achieves the following technical breakthroughs through the dual-function joint criterion:

[0097] Error suppression: The overall characteristics of the grayscale average value and the detailed characteristics of the grayscale variance are integrated to eliminate the systematic deviation of a single function, thereby improving the focus positioning accuracy by 3-5 times.

[0098] Environmental adaptability: It can maintain high stability under complex conditions such as light source fluctuations and noise interference, meeting the high-precision measurement needs of industrial sites.

[0099] Application scalability: Applicable to full-scene focal length measurement from conventional optical components to complex laser systems. Multi-channel data fusion can further improve the detection accuracy of color optical systems.

[0100] Implementation Optimization Description

[0101] Step refinement and improvement

[0102] Intelligent adjustment of coarse positioning step length: The initial step length is automatically set according to the focal length range of the sample to be measured. For example, when the focal length is less than 100mm, a step length of 0.3-0.5mm is used; when the focal length is ≥100mm, a step length of 0.5-1.0mm is used, balancing measurement efficiency and accuracy.

[0103] Precise positioning scanning strategy: The "sparse first, dense later" scanning method is adopted in the coarse positioning range. The step size of the first three scans is 0.1mm, and after locking the peak range, it is reduced to 0.01mm step size to further improve measurement efficiency.

[0104] Grayscale data preprocessing: Add a median filter link (3×3 window) to eliminate the interference of imaging noise on the grayscale value and ensure the accuracy of dual function calculation.

[0105] Data processing optimization

[0106] Peak fitting algorithm: Cubic spline interpolation is used to fit the dual function curve, and discrete peak points are fitted into a continuous curve, improving the peak positioning accuracy to the order of 0.001mm.

[0107] Dynamic adjustment of weight coefficient: Automatically adjust the dual function weight according to the imaging quality. When the grayscale average curve has a high signal-to-noise ratio, a 60% weight is assigned; conversely, the grayscale variance curve is assigned a higher weight.

[0108] Industrial application adaptation

[0109] Automated integration: Embedding this method into an optical inspection platform enables a fully automated process from light source control and sample movement to data processing, reducing the single measurement time from 5 minutes with traditional methods to 2 minutes.

[0110] Visual interface: Develop a dedicated software interface to display the dual function curve and focus position in real time, support historical data comparison and error analysis, and facilitate production quality control.

[0111] In summary, the dual-function joint focus judgment method proposed in the present invention effectively solves the error defects of the existing single evaluation function through multi-dimensional feature fusion and intelligent data processing. A large amount of experimental data from conventional optical elements to high-precision laser systems shows that this method improves the focus positioning accuracy to within ±0.05mm, and the repeated measurement stability is less than 0.03mm, while also having excellent environmental interference resistance. In high-end fields such as semiconductor manufacturing and laser processing, this technology can be directly applied to online calibration of optical systems, providing an innovative solution for precision optical measurement.

[0112] The above content is a detailed description of the present invention in conjunction with specific embodiments, and it cannot be considered that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should be considered to fall within the scope of protection of the present invention.

Claims

1. A method for determining focal length, characterized by: The steps include: Step 1: Use point light source imaging to preliminarily determine the focus position Place the light source, the sample to be tested, and the CCD detector in sequence. Move the sample position within a large moving step to obtain different clarity images on the imaging CCD, and use the observation method to determine the focus position range; Step 2: Use a collimated light source to precisely determine the focus position Place the collimated light source, the sample to be tested, and the CCD detector in sequence, and use a stepper motor to finely move the sample position within the focus position interval determined in step (1) to obtain images with different clarity; Step 3: Get the grayscale value of the imaging point The relationship between the grayscale average function of the statistical imaging point and the position of the sample is as follows: Step 4: Get the grayscale value of the imaging point The relationship between the grayscale variance function of the statistical imaging point and the position of the sample is as follows: Step 5: Draw the grayscale mean function and grayscale variance function of the imaging point, and plot their relationship with the sample position on the same horizontal axis; select the peak values ​​of the grayscale mean function and the grayscale variance function, and select the middle of the sample position corresponding to the two peak values. This position is determined as the focus.

2. The method for determining focal length according to claim 1, wherein: In the same coordinate system, the grayscale mean value and the sample position relationship function, the grayscale variance and the sample position relationship function are plotted respectively, and the middle position corresponding to the peak value of the above two functions is selected as the focus.