An auto-focusing detection method, system and medium

By segmenting the light spot image and fitting the tilt angle, adjusting the objective lens position and rotation angle, the problem of focusing failure on tilted surfaces in laser autofocus technology was solved, achieving higher imaging quality and focusing reliability.

CN121541356BActive Publication Date: 2026-05-01HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEFEI I TEK OPTOELECTRONICS CO LTD
Filing Date
2026-01-21
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing laser autofocus technology cannot accurately determine the focus position when facing inclined surfaces, resulting in poor image quality and a high focus failure rate, which cannot meet the application needs of complex industrial scenarios.

Method used

By processing the spot image, dividing it into several segments, calculating the defocus amount of each segment, fitting the curve of the surface of the object to be measured, determining the tilt angle, and adjusting the objective lens position and rotation angle according to the tilt angle, the focusing distance caused by the tilt is compensated, thereby improving focusing accuracy and reliability.

Benefits of technology

It effectively identifies the focus point on the surface of the object under test, reduces focusing interference caused by tilt, improves the accuracy and precision of focusing, and adapts to the surface of the object under test with different tilt degrees.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121541356B_ABST
    Figure CN121541356B_ABST
Patent Text Reader

Abstract

The application discloses a kind of detection method, system and medium of automatic focusing, the detection method comprises: obtaining light spot image, along light spot length direction;Calculate the defocus amount corresponding to light spot image in each subsection area, analyze the defocus amount variation in adjacent two subsection areas, fit the surface curve of the object to be measured covered by light spot length;Construct the straight line with the minimum standard deviation of the surface curve of the object to be measured, determine the inclination angle of the surface covered by current light spot;Based on inclination angle, position transformation is carried out to objective lens center, judge whether to rotate adjustment is carried out to automatic focusing equipment according to the inclination angle of the surface of the object to be measured.The application analyzes the defocus amount variation of adjacent two subsection areas in light spot length direction, to fit the curve of the surface of the object to be measured, to facilitate the determination of the inclination angle of the surface of the object to be measured covered by light spot, and then according to the inclination angle, the objective lens is rotated and adjusted, to meet the focusing detection needs of different inclination degrees of the surface of the object to be measured.
Need to check novelty before this filing date? Find Prior Art

Description

An autofocus detection method, system, and medium Technical Field

[0001] This invention belongs to the field of autofocus technology and relates to an autofocus detection method, system and medium. Background Technology

[0002] Laser autofocus technology calculates the current defocus level of the objective lens through feedback signals and converts this into motion signals for a motor. The motor then moves the objective lens to achieve focusing. Depending on the type of feedback signal, autofocus technology can be divided into image autofocus and laser autofocus. Image autofocus analyzes the sharpness of the current image using an image sharpness evaluation function, determining the current defocus level based on a quantified sharpness value. Laser autofocus, on the other hand, projects a laser beam directly onto the surface of the sample and determines the objective lens's defocus level by observing the state of the laser beam reflected back from the sample surface.

[0003] In fields such as industrial inspection, semiconductor packaging, and precision manufacturing, laser autofocus technology is crucial for ensuring image quality and measurement accuracy. Laser autofocus is widely used due to its advantages such as fast response speed and high precision. When a laser beam is incident on an inclined surface, the reflected light path changes, causing severe distortion of the spot image acquired by the image sensor, resulting in a shift in the spot's centroid along its length.

[0004] Existing technologies use the overall defocus amount as an indicator of focus. However, for tilted test surfaces, using this overall defocus amount as the criterion for focusing results in the superposition of defocus amounts from near-focus and far-focus spot images, causing the overall defocus amount to approach a near-focus state. However, the test surface is not actually in true focus; the entire image is blurry. This distorted defocus data severely misleads the autofocus technology's focus recognition, leading to focus failure and deviation from the true focus. Therefore, existing laser autofocus technology experiences a significantly higher focus failure rate when dealing with tilted test surfaces, making it difficult to obtain clear and accurate images, greatly limiting its application effectiveness and reliability in complex industrial scenarios. Summary of the Invention

[0005] The purpose of this invention is to overcome the above-mentioned problems in the prior art and to provide an automatic focusing detection method, system and medium.

[0006] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution:

[0007] An autofocus detection method is used to process a light spot image to adjust the autofocus device according to the tilt of the surface of the object to be measured, so as to meet the focusing requirements, including:

[0008] Obtain the light spot image and divide it into several segments evenly along the length of the light spot;

[0009] Calculate the defocus amount corresponding to the spot image in each segment region, analyze the change in defocus amount between two adjacent segment regions, and fit the surface curve of the test object covered by the spot length.

[0010] Construct a straight line with the minimum standard deviation of the surface curve of the object under test, and determine the tilt angle of the surface covered by the current spot.

[0011] Based on the tilt angle, the position of the objective lens center is transformed, and it is determined whether the absolute value of the defocus amount corresponding to the spot image of each segment region after the position transformation is less than the set defocus amount threshold.

[0012] If all values ​​are less than the set defocus threshold, the rotation angle of the autofocus device is adjusted according to the tilt angle of the straight line. If there is a value not less than the set defocus threshold, the weight of each segment region is determined based on the number of segment regions that are less than or not less than the set defocus threshold and the total number of segment regions. The overall defocus of the spot image is calculated, and the rotation angle of the autofocus device is adjusted based on the overall defocus.

[0013] Furthermore, a polynomial is used to fit the surface curve of the object under test covered by the spot length, and based on the fitted surface curve, the straight line with the smallest standard deviation from the surface curve of the object under test is selected to determine the tilt angle and the amount of movement along the z-axis of the straight line.

[0014] Furthermore, based on the defocus amount of each segmented region in the spot image on the surface of the object under test, the absolute value of the defocus amount of each segmented region and the absolute value of the sum of the defocus amounts of two adjacent segmented regions are compared with the set defocus amount threshold, and the segmented region or two adjacent segmented regions corresponding to the minimum defocus amount are selected to determine the focus point of the objective lens at the current position.

[0015] Furthermore, by using the focus point position of the rotating objective lens and the tilt angle of the straight line that matches the surface curve of the object under test, the amount of movement required to adjust the objective lens along the optical axis after rotation is calculated to compensate for the focusing distance caused by tilting.

[0016] Furthermore, the method for changing the position of the objective lens center includes: rotating the autofocus device at an angle of inclination, and adjusting the amount of movement of the objective lens along the optical axis of the rotated objective lens and the offset ΔL of the objective lens on a straight line that matches the surface curve of the object to be measured, so as to obtain the position coordinates of the objective lens center after the position change adjustment.

[0017] The offset is determined based on the tilt angle of the straight line, the vertical distance from the rotation point of the autofocus device to the plane of the objective lens, and the distance from the plane of the objective lens to the focal plane.

[0018] Furthermore, using the position coordinates of the objective lens center after position transformation, the first distance corresponding to the position coordinates of each segment region is calculated. The absolute value of the difference between the first distance corresponding to the position coordinates of each segment region and the distance from the objective lens center to the focal plane is used to determine whether to adjust the rotation angle of the autofocus device by tilting it at a straight line.

[0019] Furthermore, when the absolute value of the defocus amount in segmented regions exceeds a set defocus threshold, the rotation angle is adjusted based on the overall defocus amount of the rotated spot image. Specific methods include:

[0020] The weight of each segment region is determined by the number of segment regions that are less than or not less than the set defocus threshold after the objective lens is rotated, and the total number of segment regions.

[0021] Calculate the overall defocus amount of the spot image based on the determined weights;

[0022] Determine whether the overall defocus amount of the light spot image is less than a set upper limit for defocus amount, wherein the set upper limit for defocus amount is greater than a set threshold for defocus amount;

[0023] If it is less than the set upper limit of defocus amount, extract the defocus amount of the segmented region that is not less than the set defocus amount threshold and the corresponding position of the segmented region, and calculate the change in defocus amount.

[0024] The rotation angle compensation amount of the autofocus equipment is determined based on the change in defocus amount.

[0025] Furthermore, the weight corresponding to the segment regions with a defocus amount less than or not less than the set defocus threshold is determined by using the ratio between the number of segment regions with a defocus amount less than or not less than the set defocus threshold and the total number of segment regions.

[0026] An autofocus detection system, comprising:

[0027] The image preprocessing module is used to obtain the light spot image and divide it into several segments evenly along the length of the light spot;

[0028] The surface curve fitting module is used to calculate the defocus amount corresponding to the spot image in each segment region, analyze the change in defocus amount in two adjacent segment regions, and fit the surface curve of the test object covered by the spot length.

[0029] The tilt analysis module is used to construct a straight line with the smallest standard deviation relative to the surface curve of the object under test, and to determine the tilt angle of the surface currently covered by the light spot.

[0030] The focus rotation adjustment module, based on the tilt angle, changes the position of the objective lens center and determines whether the absolute value of the defocus amount corresponding to the spot image of each segment area after the position change is less than the set defocus amount threshold.

[0031] If all values ​​are less than the set defocus threshold, the rotation angle of the autofocus device is adjusted according to the tilt angle of the straight line. If there is a value not less than the set defocus threshold, the weight of each segment region is determined based on the number of segment regions that are less than or not less than the set defocus threshold and the total number of segment regions. The overall defocus of the spot image is calculated, and the rotation angle of the autofocus device is adjusted based on the overall defocus.

[0032] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the autofocus detection method described in any of the preceding claims.

[0033] The beneficial effects of this invention are:

[0034] The autofocus detection method provided by this invention analyzes the change in defocus amount between two adjacent segmented regions along the length of the light spot to fit the curve of the surface of the object under test, which facilitates the determination of the tilt angle of the surface of the object under test covered by the light spot. Then, the objective lens is rotated and adjusted according to the tilt angle to meet the focusing detection requirements of different tilt degrees of the surface of the object under test, thereby improving the reliability of focusing.

[0035] This invention rotates the objective lens position based on the tilt angle of the object under test. By comparing the absolute value of the defocus amount corresponding to the spot image of each segment after rotation with a set defocus amount threshold, it determines whether the rotation based on the tilt angle of the object under test meets the current actual focusing requirements. If the tilt angle does not meet the current actual focusing requirements, the rotation angle of the autofocus device is compensated by the overall defocus amount to meet the application scenarios where the object under test is tilted and uneven.

[0036] This invention identifies the focus point of the objective lens by measuring the defocus amount of each segmented region in the spot image and combining the sum of the defocus amounts of two adjacent segmented regions. This helps determine the focus position of the objective lens in the current position along the length of the spot, facilitating the analysis of the position coordinates of the objective lens center after rotation.

[0037] This invention, based on the focus point of the objective lens before rotation and the tilt angle of the surface of the object under test, analyzes the amount of movement of the objective lens along the optical axis after rotation and the amount of offset in the straight line direction matching the curve of the surface of the object under test. This is used to compensate for the center position of the laser spot, which can eliminate the degree of offset of the center position of the laser spot in the optical axis direction and the straight line matching the curve of the surface of the object under test caused by rotation. It can accurately obtain the defocus amount corresponding to each segment area after rotation, improve the focusing accuracy, and reduce the focusing interference caused by the tilt of the surface of the object under test.

[0038] This invention compares the absolute value of the defocus amount of each segmented region after rotation with a set defocus amount threshold to determine the number of segmented regions that are less than or not less than the set defocus amount threshold, thereby determining the corresponding weights to calculate the overall defocus amount of the spot image. Based on the comparison between the overall defocus amount and the set upper limit of defocus amount, the rotation angle compensation amount can be determined according to the change in defocus amount, which improves the accuracy of autofocus and effectively balances the interference of the tilt degree and surface unevenness of the test object. Attached Figure Description

[0039] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0040] Figure 1 is a flowchart of the autofocus detection method in this invention;

[0041] Figure 2 is a schematic diagram of the light spot image with the surface of the object under test tilted in this invention;

[0042] Figure 3 is a schematic diagram of the objective lens before and after rotation in this invention;

[0043] Figure 4 is a flowchart of the objective lens rotation adjustment method in this invention where the defocus amount in segmented regions is greater than a set defocus amount threshold.

[0044] Figure 5 is a schematic diagram of the autofocus detection system in this invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] When the surface of the object under test is in an ideal condition (the surface is not tilted), a laser beam illuminates the surface, and the reflected light spot is imaged on the sensor. When the surface of the object under test is on the focal plane of the autofocus system, it is in a near-focus state. At this time, the light spot is the smallest, the energy is most concentrated, and it is in a straight line with a fixed centroid position. When the object is out of focus (the surface of the object under test is above or below the focal plane), the light spot becomes larger and more diffuse, and its centroid position shifts. That is, when the surface of the object under test is above the focal plane, the laser spot is above the laser spot in the near-focus state; conversely, when the surface of the object under test is below the focal plane, the laser spot is below the laser spot in the near-focus state.

[0047] In practical applications, due to the tilt of the platform or surface of the object under test, when focusing on the tilted surface, the light beam incident on the tilted surface is reflected by the surface of the object under test, resulting in a stretched and asymmetrically blurred spot image captured by the image sensor along the vertical length of the spot. To address this blurred spot, existing technologies employ a multi-segment centroid calculation method, calculating the centroid of each region separately and then calculating the overall defocusing amount of the spot. However, when applied to the aforementioned tilted surface, the portion of the spot image located above (corresponding to the near end of the tilted surface) may exhibit forward (or backward) defocusing characteristics, while the portion located below (corresponding to the far end of the tilted surface) exhibits the opposite defocusing characteristics. When performing multi-segment centroid calculation and synthesis, the two opposing defocus information cancel each other out, causing the final calculated comprehensive defocus amount to approach zero or even equal to zero, and it does not truly achieve a state of accurate focus. This seriously misleads the judgment of the focusing system, causes the defocus amount calculation to be distorted, affects the focusing operation, and makes the autofocus system have a high focusing failure rate when facing a test object with a tilted surface, and cannot obtain a clear image point.

[0048] To address the aforementioned technical problems, as shown in Figure 1, this application specifically provides an autofocus detection method for processing a light spot image to adjust the autofocus device according to the tilt of the surface of the object under test, thereby meeting focusing requirements. The method includes:

[0049] Obtain the light spot image, and divide it into several segments evenly along the length of the light spot, with no less than 3 segments;

[0050] Calculate the defocus amount corresponding to the spot image in each segment region, analyze the change in defocus amount between two adjacent segment regions, and fit the surface curve of the test object covered by the spot length.

[0051] Construct a straight line with the minimum standard deviation of the surface curve of the object under test, and determine the tilt angle of the surface covered by the current spot.

[0052] Based on the tilt angle, the position of the objective lens center is transformed, and it is determined whether the absolute value of the defocus amount corresponding to the spot image of each segment region after the position transformation is less than the set defocus amount threshold.

[0053] If all values ​​are less than the set defocus threshold, the rotation angle of the autofocus device is adjusted according to the tilt angle of the straight line. If there is a value not less than the set defocus threshold, the weight of each segment region is determined based on the number of segment regions that are less than or not less than the set defocus threshold and the total number of segment regions. The overall defocus of the spot image is calculated, and the rotation angle of the autofocus device is adjusted based on the overall defocus.

[0054] The set defocus threshold is an empirical value used to measure the absolute value of the allowable defocus amount, which is determined during the focusing process based on the allowable defocus amount.

[0055] For a test object with a tilted surface, the laser from the autofocus system illuminates the surface of the test object. After reflection from the surface, the image sensor receives a blurred spot with dispersed energy. As shown in Figure 2, the spot is uniformly divided into several segmented regions along its length. The centroid of the spot image in each segmented region is calculated to obtain the centroid coordinates yi of each segmented region, i=1,2,...,n, where n represents the total number of segmented regions, and n≥3.

[0056] For the defocus amount of each segment region, it is necessary to compare the centroid position coordinate yi of each segment region with the centroid position coordinate y0 in the accurate focus state to obtain the offset △yi=yi-y0 of the centroid position coordinate of each segment region in the spot image relative to the centroid position coordinate in the accurate focus state. △yi represents the offset of the centroid position coordinate yi of the i-th segment region, and the offset of the centroid position coordinate is relative to the relative position in the spot image.

[0057] When the surface of the object under test is above the focal plane, the offset Δyi of the centroid position coordinates of the segmented area above the focal plane relative to the centroid position coordinates in the quasi-focused state is greater than 0. Conversely, when the surface of the object under test is below the focal plane, the offset Δyi of the centroid position coordinates of the segmented area below the focal plane relative to the centroid position coordinates in the quasi-focused state is less than 0. When the surface of the object under test is on the focal plane, the spot image is in the quasi-focused state, and the offset Δyi is equal to 0.

[0058] Because the surface of the object under test is tilted, when the focal plane at the position of the objective lens is located within the height area covered by the laser on the surface of the object under test, there are both near-focus and far-focus spots in the spot image at the same time. It is not possible to use the overall spot to calculate the defocus amount. If the overall spot is used to calculate the defocus amount, the defocus amount will be close to the defocus amount in the quasi-focus state, thus failing to reflect the current actual focusing situation.

[0059] Based on the above, a defocusing amount calculation model is adopted to transform the offset of the centroid position coordinates corresponding to the spot image of each segment region relative to the centroid position coordinates in the quasi-focus state, so as to obtain the defocusing amount of each segment region.

[0060] Among them, the defocus calculation model k is the conversion factor between the offset of the centroid position coordinates relative to the in-focus state and the defocus amount, and d represents the defocus amount.

[0061] The defocus amount is analyzed using the defocus amount between two adjacent segmented regions to obtain the defocus amount change Δdi, where Δdi = di - d(i-1), di represents the defocus amount of the i-th segmented region, d(i-1) represents the defocus amount of the (i-1)-th segmented region, and Δdi represents the defocus amount change between the i-th and (i-1)-th segmented regions. Similarly, the offset of the centroid position coordinates between two adjacent segmented regions can also be analyzed to obtain the offset relative to the centroid position. Using the conversion coefficient k between the offset of the centroid position coordinates relative to the in-focus state and the defocus amount, the defocus amount change Δdi = k(Δyi - Δy(i-1)) is obtained. Based on whether the defocus amount change Δdi is greater than 0, the height change trend and height change amount of the test object surface corresponding to the two adjacent segmented regions can be determined.

[0062] Establish a spatial coordinate system x0z. In the collimated state, the direction of the light spot length in the focal plane is taken as the x-axis, and the direction perpendicular to the light spot length is taken as the z-axis (the z-axis is parallel to the optical axis corresponding to the objective lens of the initial autofocus device, i.e., the direction of objective lens movement). Based on the defocus amount of the first segment region and the change in defocus amount corresponding to two adjacent segment regions, combined with the actual light spot length corresponding to each segment region, obtain the position coordinates (xi, zi) corresponding to each segment region. Here, zi in each segment region is equal to the defocus amount corresponding to that segment region, xi = x(i-1) + Δx, Δx is equal to the change in position between two adjacent segment regions on the light spot length covering the surface of the object under test, i.e., the ratio between the light spot length covering the surface of the object under test and the total number of segments N divided by the light spot image, and x0 is equal to 0.

[0063] The surface curve of the object under test covered by the spot length is fitted using a polynomial. Based on the fitted surface curve, the straight line with the smallest standard deviation from the surface curve of the object under test is selected to determine the tilt angle and the amount of movement along the z-axis of the straight line.

[0064] Based on the position coordinates of each segmented region in the spot image in the spatial coordinate system x0z, a straight line with the minimum standard deviation relative to the surface curve of the object under test is constructed. The inclination angle of the straight line is θ = arctan(f). When the standard deviation between the constructed straight line and the surface curve of the object to be measured is minimized, the straight line matches the surface curve of the object to be measured. , To minimize the standard deviation between the curves corresponding to the distances of the constructed straight line from the coordinates of each position on the surface covered by the light spot, coefficients f and L can be determined. f represents the inclination of the straight line matching the surface of the object, and L represents the distance from the intersection of the straight line matching the surface of the object and the z-axis to the origin of the spatial coordinate system x0z. The coordinates represent the position of the i-th segment region on the straight line that minimizes the standard deviation of the curve on the surface of the object to be tested, and n represents the total number of segment regions.

[0065] Based on the determined coefficient f and the formula for the inclination angle of a straight line, the inclination angle of a straight line that matches the surface curve of the object to be measured can be obtained.

[0066] Based on the defocus amount of each segment region in the spot image on the surface of the object under test, the absolute value of the defocus amount of each segment region and the absolute value of the sum of the defocus amounts of two adjacent segment regions are compared with the set defocus amount threshold, and the segment region or two adjacent segment regions corresponding to the minimum defocus amount are selected to determine the focus point of the objective lens at the current position.

[0067] This embodiment specifically discloses a method for identifying the focus point of the objective lens at a current position based on the defocus amount of each segmented region in the light spot image on the surface of the object under test. The method includes:

[0068] Step 1: Determine whether the entire light spot image is located on the same side of the focal plane;

[0069] By determining whether the defocus amount of each segment region is greater than 0 or less than 0, if it exists, it indicates that the area covered by the light spot on the surface of the object under test is located on one side of the focal plane; otherwise, proceed to step 2.

[0070] When the defocus amount of each segment region is greater than 0, it indicates that the area covered by the light spot on the surface of the object under test is above the focal plane; when the defocus amount of each segment region is less than 0, it indicates that the area covered by the light spot on the surface of the object under test is below the focal plane. Based on this, when there is at least one segment region with a defocus amount greater than 0 and at least one segment region with a defocus amount less than 0 in the light spot image at the same time, it indicates that the focal plane at the location of the objective lens is located within the height region of the laser coverage on the surface of the object under test.

[0071] Step 2: If not, select the segment region with the smallest defocus amount corresponding to the segment region whose absolute value of the defocus amount is not greater than the set defocus amount threshold.

[0072] Step 3: Calculate the sum of the defocus amount of two adjacent segments respectively, and filter the adjacent segments with the smallest sum of defocus amount corresponding to the two adjacent segments whose absolute value of the sum of the defocus amount of the two adjacent segments is not greater than the set defocus amount threshold.

[0073] Step 4: Compare the minimum defocus amount corresponding to the selected segmented region with the minimum sum of defocus amounts corresponding to the sum of defocus amounts of the two adjacent segmented regions, and extract the segmented region or the two adjacent segmented regions corresponding to the minimum defocus amount.

[0074] Step 5: Based on the selected segmented region or two adjacent segmented regions, determine the focus point of the objective lens at the current position. The focus point is the intersection of the focal plane of the objective lens at the current position and the spot coverage area on the surface of the object to be tested, located at a certain spot position on the surface of the object to be tested.

[0075] The focus point of the objective lens at the current position: When the segmented region corresponding to the minimum defocus amount is b, then the focus point of the objective lens at the current position is... If the segmented region corresponding to the minimum defocus amount is two adjacent segmented regions b and b+1, then the focus point of the objective lens at the current position is... R represents the actual length of the laser spot on the surface of the object under test along the x-axis, s represents the actual length of the focal point on the x-axis from the endpoint of the spot region, and n represents the total number of segmented regions.

[0076] Based on the focus point of the objective lens at its current position and the tilt angle of the straight line, analyze the autofocus device's rotation around its fixed installation position in a plane parallel to x0z, with a rotation angle A. Based on the autofocus device after rotation, determine the amount of movement required to adjust the objective lens along the current optical axis. This movement is used to adjust the focal plane rotation caused by the autofocus device's rotation, thus changing the distance between the focal plane and the surface of the object being measured.

[0077] By using the focus point position of the rotating objective lens and the tilt angle of the straight line that matches the surface curve of the object under test, the amount of adjustment required by the objective lens along the optical axis after rotation is calculated to compensate for the focusing distance caused by tilt.

[0078] Figure 3 illustrates the change in the detection position before and after objective lens rotation. Based on the objective lens's focus point position before rotation, the autofocus device after rotation is determined, and the required adjustment amount H of the objective lens's movement along the optical axis after rotation is determined.

[0079] Wherein, the amount of movement H required for the objective lens to move along the rotated optical axis is: D1 represents the vertical distance from the rotation point of the autofocus device to the plane of the objective lens, D2 represents the distance from the plane of the objective lens to the focal plane before rotation, D2 is affected by the magnification of the objective lens, and θ represents the tilt angle of the line.

[0080] By adjusting the tilt angle of the object's surface, the autofocus device is rotated and adjusted. Combined with the position of the focus point in the light spot image, the amount of movement of the objective lens along its optical axis after rotation is determined. This allows for pre-adjustment of the focus position, thereby narrowing the focus range and improving focusing efficiency and accuracy.

[0081] Before and after rotation, the center of the laser spot shifts along the length of the laser spot on a straight line that matches the surface curve of the object under test. The shift amount ΔL can be calculated using the following formula: .

[0082] By using an offset ΔL to compensate for the center position of the laser spot before and after rotation, the degree of offset of the center position of the laser spot caused by rotation on the straight line that matches the curve of the surface of the object under test can be eliminated, so as to obtain the position of the surface of the object under test that is actually detected by the laser.

[0083] Furthermore, in order to determine whether the tilt angle determined by the straight line matching the surface curve of the object under test is sufficient to meet the focusing requirements after rotation, it is necessary to determine whether the absolute value of the defocusing amount in each segment area is less than the set defocusing amount threshold after the autofocus device is rotated according to the tilt angle of the surface of the object under test. Once the absolute value of the defocusing amount in each segment area is less than the set defocusing amount threshold, it indicates that the autofocus device after rotation can meet the focusing requirements.

[0084] Based on the tilt angle corresponding to the straight line that matches the surface curve of the test object, the position of each point on the surface curve of the test object is transformed, and the absolute value of the defocus amount corresponding to the spot image of each segment region after transformation is calculated. The amount of movement H required by the objective lens along the current optical axis after rotation and the offset ΔL on the straight line that matches the surface curve of the test object are used to compensate for the defocus amount corresponding to the spot image of each segment region, so as to obtain the defocus amount corresponding to each segment region in the spot image acquired by the objective lens after rotation.

[0085] The method for changing the position of the objective lens center includes: rotating the autofocus device at an angle and adjusting the amount of movement H of the objective lens along the optical axis of the rotated objective lens and the amount of offset ΔL of the objective lens on a straight line that matches the surface curve of the object to be measured, so as to obtain the position coordinates of the objective lens center after the position change adjustment.

[0086] Based on the position coordinates of the objective lens center before rotation, the position coordinates of the objective lens center after adjustment are obtained after rotation and movement. Wherein, the position coordinates of the objective lens center before rotation are (xk, zk), and the distance from the objective lens center to the objective lens focal plane before rotation is equal to the distance D2.

[0087] The offset ΔL of the objective lens on the straight line that matches the surface curve of the object under test is equal to the offset of the center of the laser spot on the straight line that matches the surface curve of the object under test before and after rotation, along the length direction of the laser spot.

[0088] Based on the rotation angle of the autofocus device, the amount of movement of the objective lens along the optical axis after rotation, and the offset along a straight line that matches the curve of the object surface, the position coordinates of the objective lens center after the position change can be determined. Based on the position coordinates of the objective lens center after the position change, it can be determined whether the absolute value of the defocus amount corresponding to the spot image of each segment region after the position change is less than the set defocus amount threshold. If they are all less than the set defocus amount threshold, it indicates that the autofocus device is rotated according to the current tilt angle to meet the focusing requirements. Then, the tilt angle of the autofocus device is adjusted according to the tilt angle of the straight line.

[0089] Using the position coordinates of the objective lens center after position transformation, the first distance corresponding to the position coordinates of each segment region is calculated. The absolute value of the difference between the first distance corresponding to the position coordinates of each segment region and the distance from the objective lens center to the focal plane is used to determine whether to adjust the rotation angle of the autofocus device by a straight line tilt angle.

[0090] Given the position coordinates of the objective lens center after the position transformation, the distance between the position coordinates of the objective lens center and the position coordinates of each segment region can be obtained according to the distance calculation formula, and used as the first distance. The first distance corresponding to each segment region to the objective lens center is adopted (the number of the first distances is determined by the number of segment regions).

[0091] With the magnification of the objective lens remaining constant, the distance from the center of the objective lens to the focal plane is fixed. The difference between the first distance corresponding to each segment region and the distance from the center of the objective lens to the focal plane is then calculated. This difference represents the defocus amount corresponding to each segment region when the objective lens is rotated. By comparing the absolute value of the defocus amount corresponding to each segment region when the objective lens is rotated with a set defocus amount threshold, it is determined whether the absolute value of the defocus amount of each segment region is less than the set defocus amount threshold, thereby determining the rotation angle of the autofocus device.

[0092] To ensure the tilt angle of the straight line that matches the surface curve of the object under test, the autofocus device is rotated. After the autofocus device rotates and moves, the absolute value of the defocus amount corresponding to the spot image of each segment area is less than the set defocus amount threshold, so as to meet the autofocus requirements and reduce the focusing interference caused by the tilt of the object under test surface.

[0093] By calculating the distance between the objective lens center and the positions of each segmented region after the objective lens is rotated, it can be determined whether the absolute value of the defocus amount corresponding to the spot image of each segmented region is less than the set defocus amount threshold. This allows it to determine whether the absolute value of the defocus amount of the spot image of each segmented region exceeds the set defocus amount threshold. This is used to determine whether the autofocus device, after rotating at a tilt angle along a straight line, meets the focusing requirements of the surface tilt of the object under test. This enables the early prediction of the rotation angle of the autofocus device, so that the rotation angle of the autofocus device can be determined based on the prediction results. This expands the focusing requirements of different tilt degrees of the object under test and improves the focusing accuracy.

[0094] In addition, due to the unevenness of the surface of the object under test, if the tilt angle of the autofocus device is adjusted according to the tilt angle of the straight line, there will still be some segments where the absolute value of the defocus amount is greater than the set defocus amount threshold after the autofocus device is rotated. In this case, if the autofocus device is rotated and adjusted according to the tilt angle of the straight line that matches the surface curve of the object under test, the focusing accuracy will be poor.

[0095] Based on this, as shown in Figure 4, when the absolute value of the defocus amount in a segmented region is greater than the set defocus amount threshold, the rotation angle is adjusted based on the overall defocus amount of the rotated spot image. Specific methods include:

[0096] Step 1: Determine the weight of each segment region based on the number of segment regions that are less than or not less than the set defocus threshold and the total number of segment regions after the objective lens is rotated.

[0097] The weight of each segment region corresponding to the segment region with a defocus amount less than or not less than the set defocus amount threshold is determined by the ratio between the number of segment regions with a defocus amount less than or not less than the set defocus amount threshold and the total number of segment regions.

[0098] The number of segment regions in each segment that are less than the set defocus threshold or the number of segment regions that are not less than the set defocus threshold are counted. The weights of the segment regions that are less than and not less than the set defocus threshold in each segment region are calculated. Specifically, the weight of the segment regions that are less than the set defocus threshold is determined by the ratio between the number of segment regions that are less than the set defocus threshold and the total number of segment regions. The weight of the segment regions that are not less than the set defocus threshold is determined by the ratio between the number of segment regions that are not less than the set defocus threshold and the total number of segment regions.

[0099] The sum of the weights corresponding to the segment regions in each determined segment region that are less than the set defocus threshold and the weights corresponding to the segment regions in each segment region that are not less than the set defocus threshold is equal to 1.

[0100] Step 2: Calculate the overall defocus amount of the spot image based on the determined weights. ;

[0101] , This represents the sum of the defocus amounts of segmented regions that are less than the set defocus amount threshold. This represents the sum of the defocus amounts of segmented regions that are not less than the set defocus amount threshold. and These represent the weights of the segmented regions that are less than the set defocus threshold and the weights of the segmented regions that are not less than the set defocus threshold, respectively. It is equal to the ratio between the number of segmented regions that are less than the set defocus threshold and the total number of segmented regions. It is equal to the ratio between the number of segmented regions that are not less than the set defocus threshold and the total number of segmented regions.

[0102] Step 3: Determine whether the overall defocus amount of the spot image is less than the set upper limit of defocus amount. The set upper limit of defocus amount is greater than the set defocus amount threshold. The set upper limit of defocus amount is used to judge the overall defocus amount of the spot image to determine the degree to which the overall defocus amount deviates from the set upper limit of defocus amount.

[0103] Step 4: If it is less than the set upper limit of defocus amount, extract the defocus amount of the segmented region that is not less than the set defocus amount threshold and the corresponding position of the segmented region, and calculate the change in defocus amount.

[0104] Step 5: Determine the rotation angle compensation amount of the autofocus device based on the change in defocus amount.

[0105] Rotation angle compensation of the autofocus device It is the tilt angle relative to the previously determined straight line, and thus the amount of rotation angle compensation for the autofocus device. ,in, This represents the change in defocus amount between two adjacent segmented regions that are not less than a set defocus amount threshold. This represents the distance between two adjacent segmented regions that are not less than the set defocus threshold.

[0106] If the overall defocus amount of the spot image is not less than the set upper limit of defocus amount, the rotation angle of the autofocus device is adjusted by using the tilt angle of a straight line that matches the surface curve of the object to be measured.

[0107] By determining the weights of the number of segmented regions that are less than or not less than a set defocus threshold in each segmented region, the overall defocus amount of the spot image is calculated. The overall defocus amount is compared with the set upper limit of defocus amount to extract the defocus amount of the segmented regions that are not less than the set defocus threshold after the autofocus device rotates at a tilt angle along a straight line. Then, the compensation amount of the rotation angle of the autofocus device required to meet the focusing requirements is further calculated. The rotation angle compensation amount can be determined based on the change in defocus amount, which improves the accuracy of autofocus and effectively balances the tilt degree of the object surface and the accuracy of autofocus calculation.

[0108] In view of the above-mentioned technical problems, the present invention also discloses a method in which the objective lens is rotated at a tilt angle in a straight line, and the rotation angle of the autofocus device is adjusted according to the overall defocus amount. When the overall defocus amount of the spot image is less than the set upper limit of defocus amount, the change in defocus amount of two adjacent segment regions can be calculated, and the change in average defocus amount can be statistically analyzed. Based on the change in average defocus amount and the distance between two adjacent segment regions, the rotation angle compensation amount of the autofocus device can be obtained.

[0109] Using the above method, the autofocus device can be rotated and adjusted according to the tilt of the surface of the object to be measured, so as to meet the focusing requirements under different tilt levels of the object surface and realize the focusing detection and adjustment of the autofocus device under different tilt levels.

[0110] As shown in Figure 5, a second aspect of the present invention also provides an autofocus detection system for processing a spot image to adjust the autofocus device according to the tilt of the surface of the object to be measured, thereby meeting focusing requirements, including:

[0111] The image preprocessing module is used to obtain the light spot image and divide it into several segments evenly along the length of the light spot;

[0112] The surface curve fitting module is used to calculate the defocus amount corresponding to the spot image in each segment region, analyze the change in defocus amount in two adjacent segment regions, and fit the surface curve of the test object covered by the spot length.

[0113] The tilt analysis module is used to construct a straight line with the smallest standard deviation relative to the surface curve of the object under test, and to determine the tilt angle of the surface currently covered by the light spot.

[0114] The focus rotation adjustment module, based on the tilt angle, changes the position of the objective lens center and determines whether the absolute value of the defocus amount corresponding to the spot image of each segment area after the position change is less than the set defocus amount threshold.

[0115] If all values ​​are less than the set defocus threshold, the rotation angle of the autofocus device is adjusted according to the tilt angle of the straight line. If there is a value not less than the set defocus threshold, the weight of each segment region is determined based on the number of segment regions that are less than or not less than the set defocus threshold and the total number of segment regions. The overall defocus of the spot image is calculated, and the rotation angle of the autofocus device is adjusted based on the overall defocus.

[0116] The specific implementation method of the autofocus detection system provided in this application can be referred to the above-described autofocus detection method, and will not be repeated here.

[0117] In another embodiment, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the above-described autofocus detection methods.

[0118] In the description of this specification, references to terms such as "an embodiment," "example," and "specific example" indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0119] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.

Claims

1. An autofocus detection method, used to process a light spot image to adjust the autofocus device according to the tilt of the surface of the object to be measured, so as to meet the focusing requirements, characterized in that, include: Obtain a spot image and divide it into several segments along the length of the spot; calculate the defocus amount corresponding to the spot image in each segment region, analyze the change in defocus amount between two adjacent segments, fit the surface curve of the object under test covered by the spot length; construct the straight line with the smallest standard deviation from the surface curve of the object under test, and determine the tilt angle of the surface covered by the current spot. Based on the tilt angle, the position of the objective lens center is transformed. It is then determined whether the absolute value of the defocus amount corresponding to the spot image of each segment region after the position transformation is less than the set defocus amount threshold. If they are all less than the set defocus amount threshold, the rotation angle of the autofocus device is adjusted according to the tilt angle of the straight line. If there is a segment region that is not less than the set defocus amount threshold, the weight of each segment region is determined according to the number of segment regions that are less than or not less than the set defocus amount threshold and the total number of segment regions. The overall defocus amount of the spot image is calculated, and the rotation angle of the autofocus device is adjusted based on the overall defocus amount.

2. The autofocus detection method according to claim 1, characterized in that, The surface curve of the object under test covered by the spot length is fitted using a polynomial. Based on the fitted surface curve, the straight line with the smallest standard deviation from the surface curve of the object under test is selected to determine the tilt angle and the amount of movement along the z-axis of the straight line.

3. The autofocus detection method according to claim 1, characterized in that, Based on the defocus amount of each segment region in the spot image on the surface of the object under test, the absolute value of the defocus amount of each segment region and the absolute value of the sum of the defocus amounts of two adjacent segment regions are compared with the set defocus amount threshold, and the segment region or two adjacent segment regions corresponding to the minimum defocus amount are selected to determine the focus point of the objective lens at the current position.

4. The autofocus detection method according to claim 1, characterized in that, By using the focus point position of the rotating objective lens and the tilt angle of the straight line that matches the surface curve of the object under test, the amount of adjustment required by the objective lens along the optical axis after rotation is calculated to compensate for the focusing distance caused by tilt.

5. The autofocus detection method according to claim 4, characterized in that, The method for changing the position of the objective lens center includes: rotating the autofocus device at an angle and adjusting the amount of movement of the objective lens along the rotated objective lens optical axis and the offset ΔL of the objective lens on a straight line that matches the surface curve of the object to be measured, to obtain the position coordinates of the objective lens center after the position change adjustment; wherein, the offset is determined based on the angle of inclination of the straight line, the vertical distance from the rotation point of the autofocus device to the plane where the objective lens is located, and the distance from the plane where the objective lens is located to the focal plane.

6. The autofocus detection method according to claim 5, characterized in that, Using the position coordinates of the objective lens center after position transformation, the first distance corresponding to the position coordinates of each segment region is calculated. The absolute value of the difference between the first distance corresponding to the position coordinates of each segment region and the distance from the objective lens center to the focal plane is used to determine whether to adjust the rotation angle of the autofocus device by a straight line tilt angle.

7. The autofocus detection method according to claim 1, characterized in that, When the absolute value of the defocus amount in a segmented region exceeds a set defocus threshold, the rotation angle is adjusted based on the overall defocus amount of the rotated spot image. Specifically, the method includes: determining the weight of each segmented region based on the number of segmented regions that are less than or not less than the set defocus threshold and the total number of segmented regions after objective lens rotation; calculating the overall defocus amount of the spot image based on the determined weights; determining whether the overall defocus amount of the spot image is less than a set upper limit for defocus, wherein the set upper limit for defocus is greater than the set defocus threshold; if it is less than the set upper limit for defocus, extracting the defocus amount of the segmented regions that are not less than the set defocus threshold and their corresponding positions, and calculating the change in defocus amount; and determining the rotation angle compensation amount of the autofocus device based on the change in defocus amount.

8. The autofocus detection method according to claim 1, characterized in that, The weight of each segment region corresponding to the segment region with a defocus amount less than or not less than the set defocus amount threshold is determined by the ratio between the number of segment regions with a defocus amount less than or not less than the set defocus amount threshold and the total number of segment regions.

9. An autofocus detection system, applied to the method described in any one of claims 1-8, characterized in that, include: The image preprocessing module is used to obtain the spot image and divide it into several segments evenly along the length of the spot; the surface curve fitting module is used to calculate the defocus amount corresponding to the spot image in each segment region, analyze the change in defocus amount in adjacent two segment regions, and fit the surface curve of the test object covered by the spot length. The tilt analysis module constructs a straight line with the minimum standard deviation of the surface curve of the object under test, determining the tilt angle of the surface covered by the current spot. The focus rotation adjustment module, based on the tilt angle, performs a position change on the objective lens center, determining whether the absolute value of the defocus amount corresponding to the spot image of each segment region after the position change is less than a set defocus amount threshold. If they are all less than the set defocus amount threshold, the rotation angle of the autofocus device is adjusted according to the tilt angle of the straight line. If there is a defocus amount not less than the set defocus amount threshold, the weight of each segment region is determined based on the number of segment regions that are less than or not less than the set defocus amount threshold and the total number of segment regions. The overall defocus amount of the spot image is calculated, and the rotation angle of the autofocus device is adjusted based on the overall defocus amount.

10. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program that, when executed by a processor, implements the autofocus detection method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Auto-focus system and method and optical imaging inspection apparatus

    CN107782732A

  • Light spot position detection method, automatic focusing method, related system and storage medium

    CN120428416A