A highly efficient auto focus method and system
By selecting focus points at fixed intervals and processing the blur kernel matrix, the problem of low clear image generation rate in the imaging module of the autofocus system is solved, achieving efficient image detection and improving the detection efficiency of the focusing device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI I TEK OPTOELECTRONICS CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-01
AI Technical Summary
In high-speed detection scenarios, existing autofocus systems suffer from limitations in detection efficiency because the rate at which the imaging module generates a clear image is lower than the rate at which the autofocus module detects the defocusing amount. This is especially true in off-axis autofocus systems, where the lag in objective lens focus movement prevents real-time focusing on all measurement points, resulting in blurred images.
The height values of multiple measurement points are detected by the ranging module, and the focus points with fixed intervals are selected. The height of the objective lens focus is adjusted at a constant speed based on the height difference between adjacent focus points so that it coincides with the focus point position. The image is then deblurred using a blur kernel matrix to generate a clear image.
The detection efficiency of the autofocus device has been improved, making the rate of generating clear images basically consistent with the rate of height value detection, thus improving real-time focusing performance and ensuring that the image at each measurement point is clear.
Smart Images

Figure CN121603779B_ABST
Abstract
Description
A highly efficient autofocus method and system Technical Field
[0001] This invention belongs to the field of autofocus, and particularly relates to an efficient autofocus method and system. Background Technology
[0002] Based on the positional relationship between the autofocus optical path and the imaging optical path, autofocus systems are generally classified into coaxial and off-axis types, and are widely used in high-precision inspection scenarios such as wafer and panel manufacturing. Most existing autofocus systems achieve focusing by moving the objective lens using a focusing mechanism such as a motor drive or a piezoelectric ceramic displacement device.
[0003] Due to limitations such as the relaxation time of the motor and the hysteresis of the piezoelectric ceramic displacement device, the generation rate of clear images in the imaging module is often lower than the detection efficiency of defocusing in the autofocus module. In high-speed detection scenarios, the detection rate of defocusing in the autofocus module is relatively high. Even if the image generation rate is consistent with the detection rate of defocusing, some blurred images are unavoidable due to the hysteresis of focus movement in the objective lens, affecting the detection efficiency of the object under test.
[0004] For off-axis autofocus systems, the autofocus module detects the height information of multiple measurement points on the surface of the object in advance, and uses the height information after position mapping as the defocus amount to control the focusing mechanism to move the objective lens. When the measurement points of height information are densely distributed, due to the lag in the movement of the focal point in the objective lens, the focal point in the objective lens often cannot achieve real-time focus with all measurement points. The imaging module will output some blurry images, which limits the detection efficiency of the autofocus device. Summary of the Invention
[0005] This application proposes an efficient autofocus method and system to improve the detection efficiency of autofocus systems.
[0006] To achieve the above objectives, this application proposes the following technical solutions:
[0007] In a first aspect of this application, a highly efficient autofocus method is provided, applied to an off-axis autofocus device including a ranging module and an imaging module, comprising:
[0008] The height values of multiple measurement points are detected using a ranging module, and focus points with fixed intervals are selected from the multiple measurement points.
[0009] Based on the first height difference between adjacent focus points, the height of the objective lens focus in the imaging module is adjusted at a constant speed so that the objective lens focus and the focus point have the same height when their horizontal plane positions coincide.
[0010] When the objective lens focus and the focus point are aligned on the horizontal plane, the image generated by the image sensor in the imaging module is acquired as the image of the object under test.
[0011] When the objective lens focal point coincides with the horizontal plane position of any correction point, the height of the objective lens focal point is calculated based on the distance between the correction point and the adjacent focus point, as well as the height information of the adjacent focus points. The corresponding blur kernel matrix is determined based on the second height difference between the objective lens focal point and the correction point. The image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object under test. Here, the correction point represents the measurement point other than the focus point. The blur kernel matrix and the second height difference are in one-to-one correspondence.
[0012] Optionally, the ranging module refers to a device for detecting the height of the surface of the object being measured, including a spectral confocal sensor, a laser ranging sensor, and a triangulation rangefinder.
[0013] Optionally, the horizontal distance between adjacent measurement points is fixed, and the horizontal direction represents the direction of relative movement between the off-axis autofocus device and the object being measured.
[0014] The process of selecting focus points at fixed intervals includes:
[0015] In the horizontal direction, focus points are selected by filtering at fixed intervals; or, focus points are selected according to a fixed number of intervals.
[0016] Optionally, calculating the height of the objective lens focus based on the distance between the correction point and adjacent focus points, and the height information of adjacent focus points, includes:
[0017] Choose any one of the adjacent focus points as the calibration point;
[0018] Obtain the first horizontal distance between the correction point and the calibration point, and the second horizontal distance between adjacent focus points, and calculate the ratio between the first distance and the second distance;
[0019] Calculate the product of the ratio and the first height difference, and add the product to the height value of the calibration point to obtain the height of the objective lens focal point.
[0020] Optionally, determining the corresponding blur kernel matrix based on the second height difference between the objective lens focal point and the correction point includes:
[0021] The blur kernel matrix corresponding to different defocusing amounts of the imaging module is pre-calculated to obtain a set of blur matrices;
[0022] The second height difference between the objective lens focal point and the correction point is used as the defocus amount to obtain the corresponding blur kernel matrix under the current defocus amount.
[0023] Optionally, when applied to an off-axis autofocus device including a ranging module and an imaging module, if the height of the objective lens focal point in the imaging module remains constant, the autofocus method further includes:
[0024] The height values of multiple measurement points are detected using a ranging module. When the focal point of the objective lens coincides with the horizontal plane position of any measurement point, the corresponding fuzzy kernel matrix is determined based on the second height difference between the focal point of the objective lens and the measurement point. The image generated by the image sensor is then deblurred based on the fuzzy kernel matrix to obtain the image of the object being measured.
[0025] Optionally, in a coaxial autofocus device comprising a focusing module and an imaging module, the focusing module detects the defocus amount on the surface of the object being measured based on the principle of spectral confocality. In the coaxial optical path, a specific wavelength beam provided by the autofocus module is parallel to the beam in the imaging optical path, and the coaxial autofocus device adjusts the height of the objective lens focal point by moving the focusing module as a whole. The autofocus method further includes:
[0026] The actual wavelength corresponding to the surface of the object being measured is detected by the focusing module.
[0027] The corresponding blur kernel matrix is determined based on the actual wavelength; wherein, the blur kernel matrix corresponds one-to-one with the wavelength detected in the autofocus module;
[0028] The image generated by the image sensor is deblurred based on the fuzzy kernel matrix to obtain the image of the object being measured.
[0029] Optionally, if the coaxial autofocus device adjusts the height of the objective lens focal point by moving the objective lens individually, the autofocus method further includes:
[0030] The actual wavelength corresponding to the surface of the object under test is detected by the spectral confocal module, and the corresponding defocusing amount relationship is determined according to the current height of the objective lens. The defocusing amount relationship represents the defocusing amount between the actual wavelength detected by the spectral confocal module and the focal point corresponding to each specific wavelength. The defocusing amount relationship is obtained after pre-calibration and corresponds one-to-one with the height of the objective lens.
[0031] Based on the relationship between the actual wavelength and the defocus amount, determine the defocus amount at the current height of the objective lens;
[0032] The corresponding blur kernel matrix is determined based on the defocus amount;
[0033] The image generated by the image sensor is deblurred based on the fuzzy kernel matrix to obtain the image of the object being measured.
[0034] In a second aspect of this application, a high-efficiency autofocus system is provided, comprising:
[0035] An imaging module includes an image sensor and an objective lens, wherein the image sensor generates an image of the surface of the object being measured through the objective lens;
[0036] The ranging module is used to detect the height values of multiple measurement points on the surface of the object being measured, and there is no overlap between the ranging optical path of the ranging module and the ranging optical path of the imaging module.
[0037] Processor, the processor being configured to perform the following operations:
[0038] The height values of multiple measurement points are detected using a ranging module, and focus points with fixed intervals are selected from the multiple measurement points.
[0039] Based on the first height difference between adjacent focus points, the height of the objective lens focus in the imaging module is adjusted at a constant speed so that the objective lens focus and the focus point have the same height when their horizontal plane positions coincide.
[0040] When the objective lens focus and the focus point are aligned on the horizontal plane, the image generated by the image sensor in the imaging module is acquired as the image of the object under test.
[0041] When the objective lens focal point coincides with the horizontal plane position of any correction point, the height of the objective lens focal point is calculated based on the distance between the correction point and the adjacent focus point, as well as the height information of the adjacent focus points. The corresponding blur kernel matrix is determined based on the second height difference between the objective lens focal point and the correction point. The image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object under test. Here, the correction point represents the measurement point other than the focus point. The blur kernel matrix and the second height difference are in one-to-one correspondence.
[0042] Optionally, if the height of the objective lens focal point in the imaging module remains constant, the processor's execution operations further include:
[0043] The height values of multiple measurement points detected by the ranging module are obtained. When the focal point of the objective lens coincides with the horizontal plane position of any measurement point, the corresponding blur kernel matrix is determined based on the second height difference between the focal point of the objective lens and the measurement point. The image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object being measured.
[0044] The beneficial effects of this application are as follows:
[0045] This application provides a high-efficiency autofocus method applied to an off-axis autofocus device including a ranging module and an imaging module. The autofocus method includes:
[0046] The system uses a ranging module to detect the height values of multiple measurement points and selects focus points at fixed intervals from these points. Based on the first height difference between adjacent focus points, the height of the objective lens focus in the imaging module is adjusted at a constant speed so that the objective lens focus and the focus point have the same height when their horizontal planes coincide. When the objective lens focus and the focus point coincide on the horizontal plane, the image generated by the image sensor in the imaging module is acquired as the image of the object under test. When the objective lens focus coincides with the horizontal plane of any correction point, the height of the objective lens focus is calculated based on the distance between the correction point and the adjacent focus point, as well as the height information of the adjacent focus points. The corresponding blur kernel matrix is determined based on the second height difference between the objective lens focus and the correction point. The image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object under test. Here, the correction point represents the measurement point other than the focus point; the blur kernel matrix and the second height difference correspond one-to-one.
[0047] For off-axis autofocus devices, the ranging module along the scanning direction is located in front of the imaging module. Its operating characteristics are: the ranging module first performs height detection, and then the imaging module focuses and forms an image. Therefore, in the autofocus scheme provided in this application, a focus point is selected from multiple measurement points that have completed height detection at fixed intervals. The distance between adjacent focus points is used to ensure that the imaging module achieves focus at the focus point. Simultaneously, this application sets the objective lens focus in the imaging module to adjust at a constant rate between adjacent focus points. This allows the objective lens focus height corresponding to the correction point to be calculated based on the height values of adjacent focus points and the distance between the correction point and the focus point.
[0048] Based on the above processing, this application can obtain the objective lens focal height corresponding to any correction point. Therefore, the height difference between the objective lens focal height and the current correction point can be used as the defocusing amount, and the corresponding blur kernel matrix can be determined. Image quality compensation is then performed on the image generated by the image sensor to obtain a clear image. Thus, this application combines full focusing and image quality compensation, ensuring that the image corresponding to each measurement point is a clear image. This improves the image blurring problem caused by poor real-time focusing performance, and allows the generation rate of clear images to be basically consistent with the height value detection rate, thereby improving the detection rate of the autofocus device. Attached Figure Description
[0049] 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:
[0050] Figure 1 is a flowchart of an autofocus method provided in this application;
[0051] Figure 2 is a structural schematic diagram of an autofocus device provided in this application;
[0052] Figure 3 is a structural diagram of an autofocus device based on spectral confocal focusing provided in this application;
[0053] Figure 4 is a schematic diagram of a measurement point provided in this application;
[0054] Figure 5 is a schematic diagram of another measurement point provided in this application;
[0055] Figure 6 is a schematic diagram of another measurement point provided in this application;
[0056] Figure 7 is a structural diagram of a coaxial autofocus device provided in this application;
[0057] Figure 8 is a structural diagram of an autofocus system provided in this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0059] For autofocus devices, due to the lag in the focusing mechanism, in order to avoid the output of some blurry images by the imaging module, the generation rate of clear images in the imaging module of the autofocus device is often lower than the detection efficiency of the defocus amount in the autofocus module, which limits the detection efficiency of the autofocus device.
[0060] To improve the detection efficiency of autofocus devices, this application provides a high-efficiency autofocus method based on image quality compensation, applied to an off-axis autofocus device including a ranging module and an imaging module, as shown in Figure 1. The autofocus method includes the following steps:
[0061] S1. Detect the height values of multiple measurement points using a ranging module, and select focus points with fixed intervals from the multiple measurement points.
[0062] S2. Based on the first height difference between adjacent focus points, adjust the height of the objective lens focus in the imaging module at a constant speed so that the objective lens focus and the focus point have the same height when their horizontal plane positions coincide.
[0063] S3. When the objective lens focal point and the focus point coincide on the horizontal plane, acquire the image generated by the image sensor in the imaging module as the image of the object under test. When the objective lens focal point coincides with the horizontal plane of any correction point, calculate the height of the objective lens focal point based on the distance between the correction point and the adjacent focus point, as well as the height information of the adjacent focus points; determine the corresponding blur kernel matrix based on the second height difference between the objective lens focal point and the correction point; perform deblurring processing on the image generated by the image sensor based on the blur kernel matrix to obtain the image of the object under test.
[0064] Here, the correction point represents the measurement point other than the focus point; the fuzzy kernel matrix and the second height difference correspond one-to-one.
[0065] For off-axis autofocus devices, considering their operating characteristics—the ranging module first detects height, and then the imaging module focuses and forms an image—the autofocus scheme provided in this application selects a focus point from multiple measurement points that have completed height detection at fixed intervals. The distance between adjacent focus points is used to ensure that the imaging module achieves focus at the focus point. Simultaneously, this application sets the objective lens focus in the imaging module to adjust at a constant rate between adjacent focus points. Therefore, the objective lens focus height corresponding to the correction point can be calculated based on the height values of adjacent focus points and the distance between the correction point and the focus point.
[0066] Based on the above processing, this application can obtain the objective lens focal height corresponding to any correction point. Then, it can use the height difference between the objective lens focal height and the current correction point as the defocus amount and determine the corresponding blur kernel matrix to perform image quality compensation on the image generated by the image sensor, resulting in a clear image. Therefore, this application combines full focusing and image quality compensation to ensure that the image corresponding to each measurement point is a clear image, improving the image blurring problem caused by poor real-time focusing performance. It allows the generation rate of clear images to be basically consistent with the height value detection rate, thereby improving the detection rate of the autofocus device.
[0067] As shown in Figure 2, the off-axis autofocus device provided in this application includes an externally mounted ranging module and an imaging module, meaning there is no coaxial optical path between the two modules. The ranging module, also known as the focusing module, is used to detect the height of the object's surface; it generates the defocus amount by detecting the height information of the object's surface. The imaging module includes an image sensor and an objective lens; the image sensor generates an image of the object's surface through the objective lens.
[0068] In some embodiments, the ranging module provided in this application can be a spectral confocal sensor, a laser ranging sensor, or a triangulation rangefinder, etc., which can obtain the height information of the surface of the object being measured using various different detection methods. When the ranging module is a spectral confocal module, the height value of the surface of the object being measured can be measured by the wavelength detected in the spectrometer and the relationship between the wavelength and the height. For example, in the structural diagram of the autofocus device shown in Figure 3, the ranging module belongs to a point spectral confocal system, including a point light source, a dispersive lens, a probe pinhole, and a spectrometer. Based on the white polychromatic beam generated by the laser, the beam passes through the dispersive component and falls on the measurement point on the surface of the object being measured. After being reflected by the surface of the object being measured, it passes through the dispersive lens and the probe pinhole and enters the spectrometer, thereby obtaining the height information of the current measurement point on the surface of the object being measured.
[0069] Specifically, the light emitted by a white LED light source can be approximated as a point source after passing through an optical fiber coupler. After collimation and focusing by a dispersive lens, spectral dispersion occurs, forming continuous monochromatic light focal points along the optical axis, with each focal point at a different distance from the object being measured. When the object is located within the measurement range, only light of a specific wavelength focuses on its surface. This wavelength, satisfying the confocal condition, can be reflected from the object's surface and enter the spectrometer, while most other light rays cannot enter. The wavelength value at the point of maximum light intensity is obtained through spectrometer decoding, thus providing the distance value corresponding to the measurement point.
[0070] It should be noted that in this application, the measurement point refers to the point on the surface of the object being measured, where the height is determined by the ranging module. Taking a point spectral confocal module as an example, the measurement point represents the focal point of a certain wavelength of light in the polychromatic point beam on the surface of the object being measured.
[0071] In the autofocus device provided in this application, both the ranging module and the imaging module scan the surface of the object being measured at the same and constant rate. When the ranging module acquires height values from the surface of the object at a constant rate, the intervals between corresponding measurement points remain consistent. It is understood that the measurement points on the surface of the object are automatically generated or pre-set during the height measurement process of the ranging module. The distribution density of the measurement points is related to the measurement frequency of the ranging module; the higher the measurement frequency, the denser the distribution of measurement points, and the shorter the interval between adjacent measurement points. Correspondingly, the displacement trajectories of the ranging module and the imaging module relative to the surface of the object coincide and are parallel to the measurement point curves on the surface of the object.
[0072] In practical applications, the imaging module is typically a microscopic imaging module, which, in addition to an image sensor and objective lens, usually includes an illumination source, an eyepiece, and a collimator to achieve microscopic imaging. In this application, the method for adjusting the focal point of the imaging objective lens is to adjust its height using a focusing mechanism. Furthermore, when the height of the focal point in the imaging objective lens matches the height of the measurement point on the surface of the object being measured, it can be determined that the imaging module generates a clear image including that measurement point.
[0073] In the three-dimensional coordinate system involved in this application, the plane formed by the x-axis and y-axis serves as the horizontal plane where the object being measured is located. The x-axis is parallel to the relative movement direction between the off-axis autofocus device and the object being measured, which is the horizontal direction of this application. The z-axis is perpendicular to the horizontal plane, and its value corresponds to the height value of the measurement point, as shown in Figure 4.
[0074] In step S1, this application can set a fixed interval in the horizontal direction to select the focus point from multiple measurement points. Alternatively, considering that the moving speed of the ranging module relative to the surface of the object being measured in the horizontal direction is constant, the interval distance between adjacent measurement points is consistent, and the distance between measurement points is also fixed for the same number of points. Therefore, in this application, the focus point can also be selected from multiple measurement points according to a fixed number of intervals, as shown in Figures 5 and 6. The dashed lines represent the movement trajectory of the objective lens focus.
[0075] During the detection of the object under test, in order to ensure that the horizontal plane position of the objective lens focus in the imaging module coincides with that of any focus point, the height of the objective lens focus is consistent. Therefore, in this application, when the objective lens focus moves from one focus point to the next focus point, the maximum height difference that the objective lens focus can move in the vertical direction is not lower than the maximum height difference of the surface of the object under test within the adjacent focus point range.
[0076] In off-axis autofocus devices, compared to the imaging module, the ranging module can detect the height values of multiple measurement points in advance and select the focus point. For step S2, the first height difference h1 between adjacent focus points can be calculated first. Then, based on the moving speed of the imaging module relative to the object being measured, the moving time t of the imaging module between the aforementioned adjacent focus points is obtained. Finally, the ratio of the first height difference h1 to the moving time t is calculated to obtain the moving speed of the objective lens focus in the Z-axis direction. Therefore, between adjacent focus points, the objective lens focus of this application adjusts its height uniformly in the Z-axis direction, ensuring that the height of the objective lens focus is consistent with that of the focus points.
[0077] Taking Figure 5 as an example, if the first height difference between focus point 1 and focus point 2 is h1, and the time it takes for the imaging objective lens focus to move from focus point 1 to focus point 2 is t, then between focus point 1 and focus point 2, the objective lens focus moves at a constant speed v1 in the Z-axis direction, where v1 = h1 / t. This ensures that when the objective lens focus moves to focus point 2, the focus height is consistent with the height of focus point 2. Similarly, the other focus points are processed using the aforementioned technical means to ensure that when the horizontal plane positions of the objective lens focus and the focus points coincide, their heights are consistent. Here, the horizontal plane position in this application can be understood as the coordinates of the objective lens focus or measurement point on the horizontal plane (i.e., the plane where the x-axis and y-axis intersect).
[0078] Typically, the first measurement point detected by the ranging module is used as the focus point, and then focus points are sequentially selected at fixed intervals. If there are still some measurement points after the last focus point, the objective lens focal point remains unchanged at the same height as the last focus point when the imaging module images those measurement points.
[0079] Regarding step S3, when the objective lens focus and the focus point in the imaging module coincide, the objective lens focus height and the focus point height are the same. At this time, the focus point position on the surface of the object under test is within the depth of field range of the imaging objective lens, and the image generated by the image sensor in the imaging module is a clear image, which can be directly used as the image of the object under test.
[0080] When the objective lens focus in the imaging module coincides with the horizontal plane position of any correction point, the height of the objective lens focus adjusts uniformly between the two focus points, and the height of the objective lens focus is consistent with the heights of the two adjacent focus points. Therefore, based on the principle of similar triangles, and combining the distance between the correction point and the adjacent focus points on both sides, as well as the heights of the adjacent focus points, the rising or falling distance of the objective lens focus when moving from the previous focus point to the current correction point can be calculated. Then, adding the height value of the previous focus point, the height value of the objective lens focus at the correction point can be obtained.
[0081] Specifically, in step S3, the height of the objective lens focal point is calculated based on the distance between the correction point and the adjacent focal point, as well as the height information of each adjacent focal point, including the following steps:
[0082] S301. Select any one of the adjacent focus points as the calibration point.
[0083] S302. Obtain the first distance between the correction point and the calibration point, and the second distance between adjacent focus points in the horizontal direction, and calculate the ratio between the first distance and the second distance.
[0084] S303. Calculate the product of the ratio and the first height difference, and add the product to the height value of the calibration point to obtain the height of the objective lens focal point.
[0085] In practice, the focus point located before the correction point is generally chosen as the calibration point. Then, based on the timestamp of the image generated in the imaging module, the time taken for the objective lens focus to move from the previous focus point to the current correction point is obtained. Combined with the horizontal movement speed of the objective lens focus relative to the object being measured, the first distance is calculated. The second horizontal distance between adjacent focus points corresponds to the length of the fixed interval between adjacent focus points and can be obtained directly. Next, the ratio of the first distance to the second distance is calculated, and this ratio is multiplied by the first height difference between adjacent focus points. The product is the change in height of the objective lens focus as it moves from the previous focus point to the correction point.
[0086] Similarly, after obtaining the time it takes for the objective lens focus to move from the previous focus point to the current correction point, the height change of the objective lens focus when it moves from the previous focus point to the current correction point can be obtained by multiplying the objective lens focus's moving speed in the Z-axis direction.
[0087] Therefore, by adding the height change of the objective lens focal point to the height of the previous focal point, we can obtain the height of the objective lens focal point corresponding to the correction point.
[0088] Then, subtract the height of the correction point from the height of the objective lens focal point to obtain the second height difference. This second height difference represents the distance between the objective lens focal point and the surface of the object being measured, i.e., the defocusing amount.
[0089] Then, based on the second height difference, the corresponding fuzzy kernel matrix is determined, and the image generated by the image sensor is deblurred based on the fuzzy kernel matrix to obtain the image of the object under test.
[0090] In step S3, the corresponding blur kernel matrix is determined based on the height difference between the objective lens focal point and the correction point, including the following:
[0091] Step 1: Pre-calculate the blur kernel matrix corresponding to the imaging module under different defocusing amounts to obtain a set of blur matrices.
[0092] Step 2: Use the second height difference between the objective lens focus and the correction point as the defocus amount, and obtain the corresponding blur kernel matrix under the current defocus amount.
[0093] The defocus amount and the corresponding blur kernel matrix can be pre-calibrated and stored. In actual operation, the pre-stored blur kernel matrix is addressed according to the calculated defocus amount, and the blur kernel matrix at the corresponding address is directly read. If the address is not an integer, the upper and lower integers are taken to read the two blur kernel matrices, and the blur kernel matrix is calculated in real time through a weighted interpolation algorithm for blur correction of the image generated by the image sensor.
[0094] It should be noted that although Chinese patent CN117170083A also discloses an autofocus scheme that includes image quality compensation, its scheme is only applicable to coaxial autofocus devices based on laser spot.
[0095] Because the acquisition of the object's height value and the generation of the object's image in an off-axis autofocus device are not synchronized, the imaging module follows the focus based on the height information detected by the ranging module during autofocus. To address these characteristics, the autofocus method provided in this application combines following focus and image quality compensation techniques. During the following focus process, by selecting focus points and uniformly adjusting the height of the objective lens focus, precise control of the objective lens focus height is achieved by reducing a certain number of precise focus point positions, thereby realizing image quality compensation in the off-axis autofocus device.
[0096] Correspondingly, due to the structural characteristics of the coaxial autofocus device, it can simultaneously obtain the defocus amount and the image of the object being measured, without needing to and being able to set the corresponding focus point position. Therefore, based on the solution of patent CN117170083A, those skilled in the art lack the motivation to improve and adjust its original technical means or combine it with other technical means to obtain the autofocus solution of this application.
[0097] In some embodiments, when the autofocus method provided in this application is applied to an off-axis autofocus device, if the height of the objective lens focal point in the imaging module remains unchanged, the autofocus method includes the following:
[0098] The height values of multiple measurement points are detected using a ranging module. When the focal point of the objective lens coincides with the horizontal plane position of any measurement point, the corresponding fuzzy kernel matrix is determined based on the second height difference between the focal point of the objective lens and the measurement point. The image generated by the image sensor is then deblurred based on the fuzzy kernel matrix to obtain the image of the object being measured.
[0099] Since the height of the objective lens focal point in the imaging module remains constant, the height of the measurement point can be directly subtracted from the fixed height of the objective lens focal point to obtain the height difference between the objective lens focal point and the surface of the object being measured, i.e., the second height difference, which serves as the defocus amount. Then, the corresponding blur kernel matrix can be determined based on the defocus amount to deblur the image generated by the image sensor, thereby obtaining the image of the object being measured.
[0100] In some embodiments, the autofocus method provided in this application is applied to a coaxial autofocus device including a focusing module and an imaging module. The focusing module detects the defocus amount on the surface of the object being measured based on the principle of spectral confocality. In the coaxial optical path, a specific wavelength beam provided by the autofocus module is parallel to the beam in the imaging optical path, and the coaxial autofocus device adjusts the height of the objective lens focal point by moving the focusing module as a whole. The autofocus method provided in this application includes the following steps:
[0101] Step a1: Detect the actual wavelength corresponding to the surface of the object being tested based on the spectral confocal module.
[0102] Step b1: Determine the corresponding blur kernel matrix based on the actual wavelength. The blur kernel matrix corresponds one-to-one with the wavelength detected by the autofocus module.
[0103] Step c1: Deblur the image generated by the image sensor based on the fuzzy kernel matrix to obtain the image of the object under test.
[0104] The aforementioned coaxial autofocus device can be structured as the internal coaxial autofocus device based on spectral confocality provided by Chinese Patent CN114047203A, as shown in Figure 7. This coaxial autofocus device includes: a polychromatic point light source, a second beam splitter, a dispersive lens group, a collimating lens group (i.e., a negative lens group), a first beam splitter, and a microscope objective, arranged sequentially along the ranging optical path.
[0105] The system includes a dispersive lens group for splitting the ranging light beam; a collimating lens group for aligning the beam of the target wavelength; a microscope objective for focusing beams of different wavelengths at different positions on the optical axis and aligning the target wavelength beam with the focal plane of the imaging light entering the microscope eyepiece, collecting the ranging and imaging light reflected from the surface under test; a first beam splitter for coaxial coupling of the optical paths of the ranging and imaging light; and a focusing module that includes a spectrometer positioned between the polychromatic light source and the dispersive lens group for collecting spectral information of the ranging light focused on the surface under test. The focusing module adjusts the distance between the eyepiece and the objective lens based on the spectral information so that the surface under test is positioned on the focal plane of the beam of the target wavelength, thereby achieving microscopic focusing.
[0106] The aforementioned target wavelength is a specific wavelength parallel to the beam in the imaging optical path. When the coaxial autofocus device adjusts the height of the objective lens focus by moving the focusing module as a whole, the relationship between the wavelength with the highest light intensity entering the spectrometer and the focus position remains unchanged. Therefore, before and after the height of the objective lens focus changes, the height difference between the corresponding focus points of other wavelengths and the target wavelength remains unchanged. Thus, the actual wavelength detected by the spectrometer in the focusing module corresponds one-to-one with the defocus amount. In this application, the actual wavelength is the wavelength with the highest light intensity detected by the spectrometer, i.e., the peak wavelength in the spectrometer.
[0107] Based on the aforementioned autofocus scheme, it is known that during image quality compensation, the defocus amount corresponds one-to-one with the blur kernel matrix. Therefore, it can be determined that the actual wavelength also corresponds one-to-one with the blur kernel matrix. Consequently, in the autofocus method provided in this application, the corresponding blur kernel matrix can be determined using the actual wavelength in step b1, and the image generated by the image sensor can be deblurred to obtain the image of the object under test.
[0108] In some embodiments, for the aforementioned coaxial autofocus device, if the height of the objective lens focal point is adjusted by moving the objective lens individually during autofocus, it is known that the correspondence between wavelength and defocus amount in the focusing module will also change when the objective lens height changes. Therefore, the autofocus method provided in this application may further include the following steps:
[0109] Step a2: Based on the spectral confocal module, the actual wavelength corresponding to the surface of the object under test is detected, and the corresponding defocusing amount relationship is determined according to the current height of the objective lens. The defocusing amount relationship represents the defocusing amount between the actual wavelength detected by the spectral confocal module and the corresponding focal point of each specific wavelength; the defocusing amount relationship is obtained after pre-calibration and corresponds one-to-one with the height of the objective lens.
[0110] Step b2: Based on the relationship between the actual wavelength and the defocus amount, determine the defocus amount at the current height of the objective lens.
[0111] Step c2: Determine the corresponding blur kernel matrix based on the defocus amount. The blur kernel matrix corresponds one-to-one with the wavelengths detected in the autofocus module.
[0112] Step d2: Deblur the image generated by the image sensor based on the fuzzy kernel matrix to obtain the image of the object under test.
[0113] For step a2, this application pre-calibrates the defocusing relationship between the highest and lowest points of the object surface under different numbers of steps, using the step size during the objective lens height movement as the unit. Furthermore, the objective lens maintains the aforementioned fixed step size during the Z-axis height adjustment process. Therefore, during objective lens focusing, the corresponding defocusing relationship can be determined based on the number of steps required to move between its current and initial positions. Based on this defocusing relationship, the height difference of the focal point between the actual wavelength detected by the spectrometer and the target wavelength is determined, which is the defocusing amount of the coaxial autofocus device. Based on this defocusing amount, a corresponding blur kernel matrix is determined, and the image generated by the image sensor is deblurred to obtain the image of the object under test.
[0114] In some embodiments, as shown in FIG8, the high-efficiency autofocus system based on image quality compensation provided in this application includes:
[0115] An imaging module includes an image sensor and an objective lens, wherein the image sensor generates an image of the surface of the object being measured through the objective lens;
[0116] The ranging module is used to detect the height values of multiple measurement points on the surface of the object being measured, and there is no overlap between the ranging optical path of the ranging module and the ranging optical path of the imaging module.
[0117] A processor for performing the aforementioned autofocus method.
[0118] In the aforementioned autofocus system, if the height of the objective lens focal point in the imaging module remains constant, the processor's execution operations further include the following:
[0119] The height values of multiple measurement points detected by the ranging module are obtained. When the focal point of the objective lens coincides with the horizontal plane position of any measurement point, the corresponding blur kernel matrix is determined based on the second height difference between the focal point of the objective lens and the measurement point. The image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object being measured.
[0120] In another embodiment provided in this application, 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 method steps.
[0121] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the autofocus method steps described in the above embodiments.
[0122] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An autofocus method, characterized in that, An off-axis autofocus device comprising a ranging module and an imaging module includes: detecting the height of multiple measurement points using the ranging module, and selecting focus points at fixed intervals from the multiple measurement points; uniformly adjusting the height of the objective lens focus in the imaging module based on a first height difference between adjacent focus points, so that the objective lens focus and the focus points are at the same height when their horizontal plane positions coincide; wherein, the horizontal plane represents the plane formed by the x-axis and y-axis in a three-dimensional coordinate system; the x-axis is parallel to the relative movement direction of the off-axis autofocus device and the object being measured; the height represents the distance perpendicular to the horizontal plane; and the objective lens... When the horizontal plane positions of the focal point and the focus point coincide, the image generated by the image sensor in the imaging module is acquired as the image of the object under test. When the horizontal plane position of the objective lens focal point coincides with that of any correction point, the height of the objective lens focal point is calculated based on the distance between the correction point and the adjacent focus point, and the height of the adjacent focus point. The corresponding blur kernel matrix is determined based on the second height difference between the objective lens focal point and the correction point. The image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object under test. Here, the correction point represents the measurement point other than the focus point. The blur kernel matrix and the second height difference are in one-to-one correspondence.
2. The autofocus method according to claim 1, characterized in that, The ranging module refers to a device used to detect the height of the surface of the object being measured, specifically a spectral confocal sensor, a laser ranging sensor, or a triangulation rangefinder.
3. The autofocus method according to claim 1, characterized in that, The distance between adjacent measurement points in the horizontal direction is fixed, and the horizontal direction represents the direction of relative movement between the off-axis autofocus device and the object being measured; the selection of focus points at fixed intervals includes: selecting focus points in the horizontal direction by intervals of fixed length; or, selecting focus points according to a fixed number of intervals.
4. The autofocus method according to claim 3, characterized in that, The step of calculating the objective lens focal height based on the distance between the correction point and the adjacent focus points, and the height of the adjacent focus points, includes: based on the principle of similar triangles, combined with the horizontal distance between the correction point and the adjacent focus points on both sides, and the height of the adjacent focus points, calculating the distance the objective lens focal height rises or falls when moving from the previous focus point to the current correction point, and adding the height of the previous focus point to obtain the objective lens focal height at the current correction point.
5. The autofocus method according to claim 1, characterized in that, The step of determining the corresponding blur kernel matrix based on the second height difference between the objective lens focus and the correction point includes: pre-calculating the blur kernel matrix corresponding to the imaging module under different defocus amounts to obtain a set of blur matrices; and using the second height difference between the objective lens focus and the correction point as the defocus amount to obtain the blur kernel matrix corresponding to the current defocus amount.
6. The autofocus method according to claim 1, characterized in that, When applied to an off-axis autofocus device including a ranging module and an imaging module, if the height of the objective lens focal point in the imaging module remains unchanged, the autofocus method further includes: using the ranging module to detect the height of multiple measurement points; when the objective lens focal point coincides with the horizontal plane position of any measurement point, determining the corresponding blur kernel matrix based on the second height difference between the objective lens focal point and the measurement point; and performing deblurring processing on the image generated by the image sensor based on the blur kernel matrix to obtain the image of the object being measured.
7. An autofocus system, characterized in that, include: An imaging module includes an image sensor and an objective lens, wherein the image sensor generates an image of the surface of the object being measured through the objective lens; A ranging module is used to detect the height of multiple measurement points on the surface of the object being measured, and there is no overlap between the ranging optical path of the ranging module and the ranging optical path of the imaging module; a processor is used to perform the following operations: using the ranging module to detect the height of multiple measurement points, and selecting focus points at fixed intervals from the multiple measurement points; based on a first height difference between adjacent focus points, uniformly adjusting the height of the objective lens focus in the imaging module so that the objective lens focus and the focus point have the same height when their horizontal plane positions coincide; wherein, the horizontal plane represents the plane composed of the x-axis and y-axis in a three-dimensional coordinate system; the x-axis and the relative movement of the off-axis autofocus device and the object being measured. The directions of motion are parallel; height represents the distance perpendicular to the horizontal plane; when the objective lens focal point and the focus point coincide on the horizontal plane, the image generated by the image sensor in the imaging module is acquired as the image of the object under test; when the objective lens focal point coincides with the horizontal plane of any correction point, the height of the objective lens focal point is calculated based on the distance between the correction point and the adjacent focus point, and the height of the adjacent focus point; the corresponding blur kernel matrix is determined based on the second height difference between the objective lens focal point and the correction point; the image generated by the image sensor is deblurred based on the blur kernel matrix to obtain the image of the object under test; where the correction point represents the measurement point other than the focus point; the blur kernel matrix and the second height difference are in one-to-one correspondence.
8. The autofocus system according to claim 7, characterized in that, If the height of the objective lens focal point in the imaging module remains unchanged, the processor's execution operation further includes: acquiring the heights of multiple measurement points detected by the ranging module; when the objective lens focal point coincides with the horizontal plane position of any measurement point, determining the corresponding blur kernel matrix based on the second height difference between the objective lens focal point and the measurement point; and performing deblurring processing on the image generated by the image sensor based on the blur kernel matrix to obtain the image of the object under test.
Citation Information
Patent Citations
Inner coaxial type automatic focusing device, method and system based on spectral confocal
CN114047203A
Automatic focusing method and system for superposition dynamic image quality compensation, and storage medium
CN117170083A
Method for measuring non-contact type three-dimensional minute shape using optical window
KR1019990033518A
System and method for assessing virtual slide image quality
US20060007345A1