An autofocus objective lens driving method, system and medium
By dynamically adjusting the objective lens movement speed, combined with the defocusing rate and threshold, the problem of balancing focusing speed, computational load, and image quality in dynamic scenes was solved, achieving efficient and accurate focusing results.
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
Existing autofocus systems struggle to balance focusing speed, computational load, and image quality in dynamic scenes. High sampling frequencies increase computational burden, while low sampling frequencies result in image blurring, making them unsuitable for complex and ever-changing scene requirements.
By calculating the offset of the defocusing rate and dynamically adjusting the objective lens movement speed, combined with the defocusing threshold and speed adjustment model, the objective lens movement speed along the z-axis is dynamically adjusted to balance focusing speed and computational resource consumption, thus avoiding image blurring.
It achieves high efficiency and accuracy in the focusing process in dynamic scenes, reduces the data processing burden, ensures image quality without ghosting, and improves focusing efficiency and accuracy.
Smart Images

Figure CN121541359B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of autofocus technology and relates to an autofocus objective lens driving method, system and medium. Background Technology
[0002] The autofocus system uses sensors to capture images of the light spot and calculates the defocus amount based on these images, which then drives the objective lens to achieve focus. In dynamic scenes, rapid response to changes in the scene is required to ensure image sharpness; therefore, sampling frequency is a crucial factor affecting system performance. A higher sampling frequency can more accurately capture rapidly changing signals, improving focusing speed and accuracy, especially in continuous autofocus mode where the system needs to track moving objects in real time, thus demanding even higher sampling frequencies. However, a high sampling frequency significantly increases the system's computational burden, leading to resource constraints and increased power consumption.
[0003] On the other hand, to reduce the sampling frequency, the system needs to extend the time for a single focus calculation to obtain an image with a sufficient signal-to-noise ratio to determine the focus status. This is achieved by increasing the exposure time to ensure the quality of the bokeh image. However, long exposure times introduce motion blur, especially in dynamic scenes, where the bokeh image is prone to ghosting, thus affecting the accuracy of the defocus calculation. This presents an challenge for autofocus systems in balancing dynamic response and image quality: while a high sampling frequency improves response speed, it increases computational cost, whereas a low sampling frequency reduces computational burden but leads to image blurring and reduced focus reliability.
[0004] Current autofocus systems often use fixed sampling frequencies or exposure parameters, making it difficult to adapt to complex and ever-changing scene requirements and simultaneously balance focusing speed, computational load, and image quality. Therefore, there is an urgent need to solve the problem of balancing focusing speed and computational load while ensuring image quality. 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 autofocus objective lens driving 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 objective lens driving method, comprising:
[0008] Obtain the defocus amount at the current and previous objective lens positions, and calculate the rate of change of defocus amount between two adjacent time points.
[0009] Based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, the corresponding defocus amount change rate threshold is selected, and the offset of the defocus amount change rate between two adjacent moments is calculated. The offset of the defocus amount change rate is the difference between the defocus amount change rate between two adjacent moments and the set defocus amount change rate threshold.
[0010] Extract the current objective lens's moving speed along the z-axis. Using the offset of the defocusing rate of change, the objective lens moving speed, and the defocusing rate of change threshold, dynamically adjust the objective lens moving speed for the next moment to balance the consumption of focusing speed and defocusing calculation.
[0011] Furthermore, if the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, the objective lens moving speed is adjusted to increase; if the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, the objective lens moving speed is adjusted to decrease.
[0012] Furthermore, the defocus change rate threshold includes a first threshold and a second threshold. The first threshold is greater than the second threshold. The defocus change rate corresponding to the objective lens moving along the z-axis at an initial first moving speed is used as the first threshold, and the defocus change rate corresponding to the objective lens moving along the z-axis at an initial second moving speed is used as the second threshold.
[0013] The initial first moving speed is greater than the initial second moving speed.
[0014] Furthermore, based on whether the direction of the change in the position of the light spot on the sensor caused by the movement of the objective lens along the z-axis is the same as the direction of the movement of the object under test along the x-axis, the maximum allowable movement speed of the objective lens is selected by the sum of the change in the position of the light spot on the sensor caused by the movement of the objective lens along the z-axis and the change in the position of the object under test on the sensor caused by the movement of the object under test along the x-axis. The maximum allowable movement speed of the objective lens is greater than the initial first movement speed.
[0015] Furthermore, based on the defocus amount at the current objective lens position, the corresponding defocus amount change rate threshold is selected. Combining the relationship between the absolute value of the current defocus amount and the set defocus amount threshold, as well as the offset of the defocus amount change rate, the speed adjustment model is used to calculate the adjusted speed of the objective lens along the z-axis at the next moment, according to the current moving speed of the objective lens along the z-axis.
[0016] Furthermore, the moving speed of the objective lens along the z-axis is dynamically controlled. The dynamic control method for the moving speed of the objective lens includes:
[0017] Extract the rate of defocus change corresponding to the movement of the objective lens along the z-axis between two adjacent time points, and calculate the offset of the rate of defocus change.
[0018] Analyze the rate of change of defocusing at different positions of the test object as it moves along the x-axis;
[0019] Based on the rate of defocus change at different positions of the object under test in two adjacent time intervals, the rate of defocus change at the position of the objective lens is corrected, and the moving speed of the objective lens in the next two adjacent time intervals is analyzed using the corrected rate of defocus change.
[0020] Based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, the corresponding range of the defocus amount change rate is determined, and it is judged whether the predicted defocus amount change rate in the next two adjacent moments is within the corresponding range of the defocus amount change rate.
[0021] If the defocusing rate is not within the corresponding range, focus is performed at the current objective lens moving speed; if it is within the corresponding range, the predicted defocusing rate of change is calculated, and the objective lens moving speed at the next moment is calculated by combining the current objective lens moving speed and the defocusing rate of change threshold.
[0022] The speed adjustment model is determined by the objective lens moving speed at the current moment, the offset of the defocus change rate between two adjacent moments, and the defocus change rate threshold corresponding to the defocus change rate.
[0023] Furthermore, based on the set displacement threshold, the horizontal moving speed of the object under test, the magnification of the objective lens, and the exposure time of the sensor, a relationship is established between the moving speed of the objective lens along the z-axis and the horizontal moving speed of the object under test, and the maximum allowable moving speed of the objective lens along the z-axis is determined.
[0024] Furthermore, based on the position of the objective lens on the z-axis at different times, the distance the objective lens moves along the z-axis at two adjacent times is obtained. Combined with the rate of change of defocusing of the objective lens along the z-axis at two adjacent times at the same time, the change in height of the object surface at two adjacent times is obtained.
[0025] An autofocus objective lens driving system, applied to any of the methods described above, comprising:
[0026] The data processing module is used to obtain the defocus amount of the objective lens at the current and previous time points, and to calculate the rate of change of defocus amount between two adjacent time points.
[0027] The offset data analysis module, based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, filters the corresponding defocus amount change rate threshold, and calculates the offset of the defocus amount change rate between two adjacent moments. The offset of the defocus amount change rate is the difference between the defocus amount change rate between two adjacent moments and the set defocus amount change rate threshold.
[0028] The drive speed adjustment module is used to extract the current objective lens movement speed along the z-axis. It uses the offset of the defocus change rate, the objective lens movement speed, and the defocus change rate threshold to dynamically adjust the objective lens movement speed at the next moment, so as to balance the consumption of focusing speed and defocus calculation.
[0029] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the autofocus objective lens driving method described in any of the preceding claims.
[0030] The beneficial effects of this invention are:
[0031] This invention filters the corresponding defocus rate change threshold by comparing the absolute value of the defocus amount at the current moment with a set defocus amount threshold. It then calculates the offset of the defocus rate change between two adjacent moments and combines this with the objective lens movement speed to obtain the objective lens movement speed at the next moment. This allows the objective lens movement speed to be adjusted according to the objective lens's position, thereby obtaining the sampling interval of the objective lens along the Z-axis between two adjacent moments. This reduces the data processing burden, balances focusing requirements with the consumption of computing resources, and improves the efficiency and accuracy of the focusing process.
[0032] This invention, by setting a defocus threshold, can distinguish between two cases: those greater than the set defocus threshold and those less than the set defocus threshold. It then selects the corresponding speed adjustment strategy, so that when the current defocus is greater than the set defocus threshold, the objective lens moves at a high speed, and conversely, when it is less than the set defocus threshold, the objective lens moves at a low speed. This achieves real-time dynamic adjustment of the movement speed, thereby improving the focusing efficiency of the moving test object.
[0033] This invention determines the speed adjustment coefficient by analyzing the relationship between the rate of defocus change and the threshold of the rate of defocus change between two adjacent moments, and the relationship between the absolute value of the defocus at the current moment and the set defocus threshold. This allows for control of the adjustment range of the objective lens movement speed at the next moment based on the objective lens movement speed at the current moment. It enables real-time dynamic adjustment based on the distance between the focal plane of the objective lens and the surface of the object under test, thus meeting the speed adjustment requirements.
[0034] This invention uses a set displacement threshold corresponding to the absence of blurring in the spot image to constrain the sum of the positional changes of the spot on the sensor caused by the movement of the objective lens along the z-axis and the movement of the test object along the x-axis. This limits the relationship between the movement speed of the objective lens along the z-axis and the movement speed of the test object along the x-axis, and limits the maximum allowable movement speed of the objective lens along the z-axis. Under these constraints, while satisfying the adjustment of different movement speeds of the test object, it can ensure that the quality of the spot image does not suffer from ghosting.
[0035] This invention analyzes the rate of defocus change of a test object moving along the x-axis using a stationary objective lens. This allows the determination of the height change of the test object's surface between two adjacent moments. By employing polynomial fitting, the height change at different positions on the test object's surface is determined. The offset of the corrected rate of defocus change is calculated, and the objective lens movement speed is then corrected for the next moment. This improves the accuracy of speed adjustment and reduces the impact of changes in the test object's surface height on speed adjustment. Attached Figure Description
[0036] 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:
[0037] Figure 1 This is a flowchart of the autofocus objective lens driving method in this invention;
[0038] Figure 2 This is a flowchart of the dynamic control method for the objective lens movement speed in this invention;
[0039] Figure 3 This is a schematic diagram of the height change of the surface of the object under test at two adjacent moments in this invention;
[0040] Figure 4 This is a schematic diagram of the autofocus objective lens drive system of the present invention. Detailed Implementation
[0041] 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.
[0042] In a laser autofocus system, a sensor acquires a spot image, calculates the defocus amount based on the spot image, and then drives the objective lens to move along the Z-axis to achieve focusing. The sampling frequency of the sensor acquiring the spot image is affected by the exposure time. To ensure the quality of the spot image, a long exposure time is required at a low sampling frequency, but a long exposure time increases the image ghosting phenomenon. Currently, the amount of movement of the objective lens along the Z-axis is the same in each sampling cycle, making it impossible to dynamically adjust the sampling interval according to the defocus amount.
[0043] With the sensor's sampling frequency and exposure time remaining constant, the sampling interval can be dynamically adjusted by changing the moving speed of the objective lens along the Z-axis. This allows for the adjustment of the sampling interval between two adjacent light spot images along the Z-axis, reducing the data processing burden and balancing the focusing requirements with the consumption of computing resources, thus ensuring the efficiency and accuracy of the focusing process.
[0044] To address the aforementioned technical issues, such as Figure 1 As shown, this application specifically provides an autofocus objective lens driving method for dynamically driving and controlling the movement speed of the objective lens along the z-axis to balance the consumption of focusing speed and defocus calculation. The autofocus objective lens driving method includes:
[0045] Obtain the defocus amount at the current and previous objective lens positions, and calculate the rate of change of defocus amount between two adjacent time points.
[0046] Based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, the corresponding defocus amount change rate threshold is selected, and the offset of the defocus amount change rate between two adjacent moments is calculated. The offset of the defocus amount change rate is the difference between the defocus amount change rate between two adjacent moments and the set defocus amount change rate threshold. The defocus amount change rate is the amount of defocus amount change per unit time.
[0047] Extract the current objective lens's moving speed along the z-axis. Using the offset of the defocusing rate of change, the objective lens moving speed, and the defocusing rate of change threshold, dynamically adjust the objective lens moving speed for the next moment to balance the consumption of focusing speed and defocusing calculation.
[0048] The rate of change of defocus reflects how quickly the defocus changes per unit time. As the rate of change of defocus changes, the rate of change of the objective lens position along the z-axis also changes. A larger rate of change of defocus indicates a faster movement of the objective lens along the z-axis, and vice versa. To balance the focusing speed of the objective lens with the computational cost of defocus calculation, based on the relationship between the current defocus of the objective lens and a set defocus threshold, the sampling interval between adjacent frames of spot images is controlled while keeping the sampling frequency constant. When the defocus is greater than the set defocus threshold, a larger sampling interval is used to shorten the focusing time and reduce the computational cost of defocus. When the defocus is less than the set defocus threshold, a smaller sampling interval is used to avoid focusing failure due to a large sampling interval, thereby improving focusing accuracy.
[0049] The offset of the defocus change rate can reflect whether the sampling interval along the z-axis between two adjacent moments during the objective lens's movement along the z-axis is less than the sampling interval corresponding to the defocus change rate threshold. This allows for adjustment of the objective lens's movement speed at the next moment based on the offset of the defocus change rate and the current objective lens movement speed, thus balancing the computational workload of focusing speed and defocus amount.
[0050] In this application, the defocus change rate threshold includes a first threshold and a second threshold. The first threshold is greater than the second threshold. The defocus change rate corresponding to the objective lens moving along the z-axis at an initial first moving speed is used as the first threshold, and the defocus change rate corresponding to the objective lens moving along the z-axis at an initial second moving speed is used as the second threshold. The initial first moving speed is greater than the second moving speed.
[0051] The initial first moving speed is the minimum moving speed of the objective lens along the z-axis when the defocus amount is greater than the set defocus amount threshold, and the second moving speed is the maximum moving speed of the objective lens along the z-axis when the defocus amount is not greater than the set defocus amount threshold.
[0052] If the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, and the rate of change of the defocus amount between two adjacent moments is less than the first threshold, the offset of the rate of change of the defocus amount is less than 0. The moving speed of the objective lens needs to be adjusted so that the adjusted moving speed of the objective lens is greater than the current moving speed of the objective lens along the z-axis, thereby increasing the sampling interval between two adjacent moments when the objective lens moves along the z-axis.
[0053] If the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, and the rate of change of the defocus amount is greater than the second threshold, the offset of the rate of change of the defocus amount is greater than 0. The moving speed of the objective lens needs to be adjusted so that the adjusted moving speed of the objective lens is less than the moving speed of the objective lens along the z-axis at the current moment, thereby increasing the sampling interval between two adjacent moments when the objective lens moves along the z-axis.
[0054] To achieve dynamic adjustment of the objective lens's movement speed, based on the current defocus amount, a corresponding defocus amount change rate threshold is selected. If the absolute value of the current defocus amount is greater than the set defocus amount threshold, the first threshold among the defocus amount change rate thresholds is selected; if the absolute value of the current defocus amount is not greater than the set defocus amount threshold, the second threshold among the defocus amount change rate thresholds is selected.
[0055] Based on the selected defocus change rate threshold, the offset of the defocus change rate corresponding to the current defocus amount is calculated. Using the offset of the defocus change rate and the defocus change rate threshold, the moving speed of the current objective lens is dynamically adjusted.
[0056] If the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, the objective lens movement speed is increased; if the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, the objective lens movement speed is decreased.
[0057] Based on the defocus amount at the current objective lens position, a corresponding defocus amount change rate threshold is selected. Combining the relationship between the absolute value of the current defocus amount and the set defocus amount threshold, as well as the offset of the defocus amount change rate, and according to the current objective lens moving speed along the z-axis, a speed adjustment model is used to calculate the adjusted objective lens moving speed along the z-axis at the next moment. The speed adjustment model is determined by the objective lens moving speed at the current moment, the offset of the defocus amount change rate between the two adjacent moments, and the defocus amount change rate threshold corresponding to the defocus amount change rate.
[0058] Among them, the speed adjustment model for the objective lens moving along the z-axis is as follows: ;
[0059] This represents the speed at which the objective lens moves along the z-axis at the next moment after adjustment. p represents the current velocity of the objective lens along the z-axis. v The offset representing the rate of change of the defocus amount. The defocus rate change threshold corresponding to the defocus amount at the current objective lens position is represented. The value of coefficient K is determined based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus threshold, as well as the relationship between the defocus rate change at two adjacent moments and the first and second thresholds.
[0060] If the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, then if the rate of change of the defocus amount between two adjacent moments is less than the first threshold, then K is -1; if the rate of change of the defocus amount between two adjacent moments is greater than the first threshold, then K is 0. If the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, then if the rate of change of the defocus amount between two adjacent moments is greater than the second threshold, then K is -1; if the rate of change of the defocus amount between two adjacent moments is less than the second threshold, then K is 0.
[0061] By using the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, and by employing the offset of the defocus amount change rate and the corresponding defocus amount change rate threshold, the objective lens movement speed at the next moment can be adjusted according to the objective lens movement speed at the current moment. This allows for control over the adjustment range of the movement speed at the next moment based on the current position of the objective lens. Furthermore, it enables real-time dynamic adjustment based on the distance between the focal plane of the objective lens and the surface of the object under test, thus meeting the speed adjustment requirements.
[0062] As the objective lens moves along the z-axis, the sensor acquires the spot image of the object under test moving along the x-axis. Both the movement of the objective lens along the z-axis and the movement of the object under test along the x-axis will cause the spot to shift on the sensor. If the deviation of the spot on the sensor is greater than the set displacement threshold, it will affect the quality of the spot image and cause a ghosting phenomenon.
[0063] The set displacement threshold is determined by the focusing accuracy allowed by the autofocus system. It can be selected as 2 pixels, 1 pixel, or 0.5 pixels in length. The higher the focusing accuracy requirement, the smaller the set displacement threshold should be. The specific setting should be based on the accuracy requirements.
[0064] Based on whether the direction of the change in the position of the light spot on the sensor caused by the movement of the objective lens along the z-axis is the same as the direction of the movement of the object under test along the x-axis, the maximum allowable movement speed of the objective lens is selected by the sum of the change in the position of the light spot on the sensor caused by the movement of the objective lens along the z-axis and the change in the position of the object under test on the sensor caused by the movement of the object under test along the x-axis. The maximum allowable movement speed of the objective lens is greater than the initial first movement speed.
[0065] Based on the direction and speed of the objective lens moving along the z-axis, the displacement change and direction of the light spot on the sensor caused by the objective lens's moving speed and direction can be determined. Furthermore, assuming the objective lens remains in a fixed position, the displacement change and direction of the light spot on the sensor caused by the object's moving speed and direction along the x-axis can be determined.
[0066] If the direction of the change in position of the light spot on the sensor caused by the movement of the objective lens along the z-axis is the same as the direction of the change in position of the light spot on the sensor caused by the movement of the object under test along the x-axis, then the sum of the position changes caused by the movement of the objective lens along the z-axis and the movement of the object under test along the x-axis must be less than a set displacement threshold. If the direction of the change in position of the light spot on the sensor caused by the movement of the objective lens along the z-axis is opposite to the direction of the change in position of the light spot on the sensor caused by the movement of the object under test along the x-axis, then the absolute value of the difference between the position changes caused by the movement of the objective lens along the z-axis and the movement of the object under test along the x-axis must be less than a set displacement threshold to avoid image trailing.
[0067] Based on the set displacement threshold, the horizontal movement speed of the test object, the magnification of the objective lens, and the exposure time of the sensor, the relationship between the movement speed of the objective lens along the z-axis and the horizontal movement speed of the test object is established, and the maximum allowable movement speed of the objective lens along the z-axis is determined.
[0068] For an object moving along the x-axis, the objective lens moves along the z-axis to focus, achieving focus tracking. During this process, the relationship between the objective lens's z-axis moving speed and the object's horizontal (x-axis) moving speed is determined by the influence of the objective lens's z-axis moving speed and the object's horizontal moving speed:
[0069] Vx represents the velocity of the object being measured along the x-axis, and Vz represents the velocity of the objective lens along the z-axis. max Let d represent the distance from a point on the object at the edge of the field of view to the Z-axis, and let d represent the distance from the objective lens to the surface of the object along the z-axis. img The set displacement threshold is the maximum allowable spot displacement when the spot image does not exhibit motion blur. M represents the magnification of the objective lens, and T represents the single exposure time of the sensor.
[0070] The relationship between the objective lens's movement speed along the z-axis and the object's movement speed along the x-axis is such that if the direction of the change in the position of the light spot on the sensor caused by the objective lens's movement along the z-axis is the same as the direction of the change in the position of the light spot on the sensor caused by the object's movement along the x-axis, then based on the object's movement speed along the x-axis, the maximum movement speed Vz1 of the objective lens within the minimum range of its movement speed along the z-axis can be determined. max .
[0071] Similarly, if the direction of the change in position of the light spot on the sensor caused by the movement of the objective lens along the z-axis is opposite to the direction of the change in position of the light spot on the sensor caused by the movement of the object under test along the x-axis, then the maximum moving speed Vz2 of the objective lens moving along the z-axis within its maximum range can be determined. max The maximum moving speed Vz2 within the maximum range max The maximum moving speed Vz1 is greater than the minimum range. max .
[0072] Maximum movement speed Vz1 within the minimum range max : ;
[0073] Maximum displacement velocity Vz2 within the maximum range max : .
[0074] Based on the relationship between the objective lens’s moving speed along the z-axis and the object under test’s moving speed along the horizontal direction, when the object under test’s moving speed and direction along the horizontal direction are fixed, the range of the objective lens’s moving speed along the z-axis can be determined according to the objective lens’s moving direction. Once the objective lens’s moving speed along the z-axis exceeds the maximum displacement speed within the current range, there will be a ghosting effect in the spot image.
[0075] By determining the moving speed of the object under test and whether the direction of the change in the position of the light spot on the sensor caused by the moving direction of the objective lens along the z-axis is the same as or opposite to that of the moving direction of the object under test, the maximum moving speed within the allowable speed range of the objective lens can be determined. This is to prevent the moving speed of the objective lens in the moving direction from exceeding the maximum allowable moving speed and to ensure the quality of the light spot image.
[0076] As the objective lens moves along the z-axis, all light spots on the entire image sensor plane simultaneously increase or decrease in size, and the energy center of the light spots should remain in place or move in the same direction. During this process, in order to ensure the consistency of image quality and avoid image ghosting, the maximum moving speed is selected when the direction of the objective lens's movement along the z-axis is the same as the direction of the change in the position of the light spots on the sensor caused by the movement of the object under test. This moving speed limits the moving speed of the objective lens along the z-axis.
[0077] To ensure the quality of the light spot image, the objective lens's movement speed along the z-axis at the next moment, as adjusted in the speed adjustment model, must be less than the maximum allowable movement speed Vz1 of the objective lens in the movement direction. max When using a speed adjustment model, based on the current objective lens movement speed along the z-axis, the adjusted objective lens movement speed along the z-axis at the next moment is determined to be greater than the maximum allowable movement speed Vz1 of the objective lens in the direction of movement. max At the maximum moving speed Vz1 max This refers to the objective lens movement speed at the next moment.
[0078] Based on the relationship between the absolute value of the current defocus amount and the set defocus amount threshold, the objective lens movement speed can be dynamically controlled in real time according to the offset of the current defocus amount change rate. Alternatively, the objective lens movement speed can be increased only when the absolute value of the current defocus amount is greater than the set defocus amount threshold, and vice versa.
[0079] When the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, the second threshold among the corresponding defocus amount change rate thresholds is selected, and the offset of the defocus change rate at the current moment is calculated. When the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, the first threshold among the corresponding defocus amount change rate thresholds is selected, and the offset of the defocus change rate at the current moment is calculated. Based on this, the moving speed of the objective lens along the z-axis is dynamically controlled, such as... Figure 2 As shown, the dynamic control method for the objective lens movement speed includes:
[0080] Step 1: Extract the rate of defocus change corresponding to the objective lens movement along the z-axis at two adjacent time points, and calculate the offset of the rate of defocus change.
[0081] Step 2: Analyze the rate of change of defocus at different positions of the test object as it moves along the x-axis.
[0082] This embodiment is used to exclude the rate of defocus change caused by the movement of the objective lens along the z-axis, and to limit the objective lens to a relatively stationary state in order to analyze the rate of defocus change caused by the movement of the test object only along the x-axis.
[0083] With the objective lens kept relatively stationary (i.e., the z-axis position coordinate of the objective lens remains unchanged), only the object under test moves along the x-axis. The change in defocus at different times is analyzed, and the rate of change of defocus is calculated based on the change in defocus between the current time and the previous time when the object under test moves along the x-axis.
[0084] In this process, taking a certain position of the object under test as the starting point, the object under test moves along the x-axis at a fixed moving speed. By combining the defocus amount corresponding to the objective lens at different times, the change in defocus amount of the object under test at the corresponding position at two adjacent times can be obtained. Then, the rate of change of defocus amount of the object under test at different positions can be obtained. In this process, based on the moving speed of the object under test and the duration corresponding to two adjacent times, the distance that the object under test moves along the x-axis at two adjacent times can be determined.
[0085] Since the objective lens is in a relatively stationary state, polynomial fitting is used to obtain the defocusing rate curve between different positions on the surface of the object under test at two adjacent times based on the rate of defocusing change at different positions. The relative change of the height of the object under test can be reflected by the rate of defocusing change between different positions on the surface of the object under test, thereby obtaining the relative height of the object under test surface.
[0086] Since the moving speed of the object under test is fixed (uniform movement), the moving speed of the object under test and the duration between two adjacent moments are used to obtain the amount of movement X of the object under test along the x-axis between two adjacent moments. Combined with the rate of change of defocus at two adjacent positions, the change in the height of the object under test surface under the amount of movement X along the x-axis can be determined.
[0087] Step 3: Based on the rate of defocus change at different positions of the object under test in two adjacent time intervals, correct the rate of defocus change at the position of the objective lens, and use the corrected rate of defocus change to analyze the moving speed of the objective lens in the next two adjacent time intervals.
[0088] Based on the moving speed of the objective lens along the z-axis, and combined with the defocusing rate curves at different positions on the surface of the object under test when the objective lens is relatively stationary, the defocusing rate corresponding to the objective lens movement in the next two adjacent moments can be predicted. This can eliminate the influence of the change in the height of the object under test on the defocusing rate caused by the objective lens movement along the z-axis in the next two adjacent moments.
[0089] Step 4: Based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, determine the corresponding range of the defocus amount change rate, and judge whether the predicted defocus amount change rate in the next two adjacent moments is within the corresponding range of the defocus amount change rate.
[0090] Step 5: If the defocusing rate is not within the corresponding range, focus is performed using the objective lens moving speed at the current moment; if it is within the corresponding range, the predicted defocusing rate of change is calculated, and the objective lens moving speed at the next moment is calculated by combining the objective lens moving speed at the current moment and the defocusing rate of change threshold.
[0091] The lower limit of the defocus change rate is the defocus change rate corresponding to the minimum allowable movement speed of the objective lens along the z-axis; the upper limit of the defocus change rate is the defocus change rate corresponding to the maximum allowable movement speed of the objective lens along the z-axis.
[0092] The defocus amount change rate range includes a first range and a second range. Specifically, if the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, the defocus amount change rate range corresponding to the absolute value of the defocus amount being greater than the set defocus amount threshold is determined by the defocus amount change rate threshold and the upper limit of the defocus amount change rate, and this range is taken as the first range. If the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, the defocus amount change rate range corresponding to the absolute value of the defocus amount not being greater than the set defocus amount threshold is determined by the lower limit of the defocus amount change rate and the defocus amount change rate threshold, and this range is taken as the second range.
[0093] Among them, the upper limit of the defocus change rate > the threshold of the defocus change rate > the lower limit of the defocus change rate.
[0094] The threshold for the rate of change of defocus amount corresponding to the first range is the first threshold, and the threshold for the rate of change of defocus amount corresponding to the second range is the second threshold.
[0095] If the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, determine whether the predicted rate of change of defocus amount in the next two adjacent moments is within the first range. If it is within the first range, calculate the offset of the predicted rate of change of defocus amount based on the predicted rate of change of defocus amount in the next two adjacent moments, and use the speed adjustment model to calculate the objective lens movement speed at the next moment. If it is not within the first range, continue to focus at the current objective lens movement speed along the z-axis.
[0096] If the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, determine whether the predicted rate of change of defocus amount in the next two adjacent moments is within the second range. If it is within the second range, calculate the offset of the predicted rate of change of defocus amount based on the predicted rate of change of defocus amount in the next two adjacent moments, and use the speed adjustment model to calculate the objective lens movement speed at the next moment. If it is not within the second range, continue focusing at the current objective lens movement speed along the z-axis.
[0097] By determining the range of the defocus rate of change by comparing the absolute value of the current defocus amount with the set defocus threshold, and combining this with the relationship between the predicted defocus rate of change in the next two adjacent moments and the corresponding range of defocus rate of change, the objective lens's moving speed during focusing is further determined. This enables dynamic adjustment of the objective lens's moving speed. By combining the current defocus amount and the defocus rate of change with the upper and lower limits of speed adjustment, the problem of continuously adjusting the moving speed based on the predicted defocus rate of change in the next moment, which could lead to the objective lens moving too slowly or too slowly along the z-axis, is avoided. This balances focusing efficiency and the computational complexity of defocus amount calculation.
[0098] Since the rate of change of defocus is affected by both the moving speed of the objective lens and the distance between the objective lens and the surface of the object under test, it is difficult to effectively identify whether the rate of change of defocus exceeds the threshold simply by relying on the relationship between the rate of change of defocus and the threshold.
[0099] For a stationary object, the objective lens moves at a constant speed V along the z-axis. The defocus amount at the objective lens position at two different times is extracted, the change in defocus amount is calculated, and the rate of change of defocus amount during the objective lens movement is calculated based on the change in defocus amount.
[0100] For a stationary object, the rate of defocus change corresponding to the objective lens moving along the z-axis is:
[0101] , ,
[0102] According to the above formula, we can know that Where V represents the velocity corresponding to the objective lens moving uniformly along the z-axis. Δd represents the rate of defocus change when the objective lens moves at a speed of V along the z-axis. Δd represents the change in defocus at the objective lens position at two times (t1 and t2). d1 and d2 represent the defocus at the objective lens position at times t1 and t2, respectively.
[0103] A stationary object is focused by selecting an objective lens to move along the z-axis at a certain speed. The moving speed of the objective lens along the z-axis is used as the defocusing rate threshold at that moving speed. At this time, the defocusing rate threshold is not affected by the height change of the surface of the object.
[0104] In this embodiment, for a stationary test object, since the focal plane position is fixed, the change in distance between the objective lens and the focal plane is only caused by the movement of the objective lens. Therefore, for a stationary test object, during the focusing process of the objective lens moving along the z-axis, the rate of change of defocus is equal to the moving speed of the objective lens. However, for a moving test object, since the test object moves along the x-axis, the z-axis position corresponding to the surface of the test object changes, so the rate of change of defocus is not necessarily equal to the moving speed of the objective lens.
[0105] For a moving object under test, the rate of change of defocus corresponding to the objective lens moving along the z-axis is as follows:
[0106] ;
[0107] According to the above formula, we can know that , This represents the rate of change of defocus along the z-axis for a moving object under test. Δd1 represents the change of defocus at the objective lens position from time t3 to t4, Δd2 represents the change of the object's surface height along the z-axis from time t3 to t4, d11 and d12 represent the defocus at the objective lens position at time t3 and t4 respectively, and d21 and d22 represent the z-axis height of the object's surface at time t3 and t4 respectively. V S This represents the rate of change of the height of the object under test along the z-axis from time t3 to time t4.
[0108] The objective lens focuses on the moving object under test. The direction and speed of the object's movement affect the change in the z-axis height of the object's surface, thus making the rate of defocus change greater or less than the speed at which the objective lens moves along the z-axis.
[0109] When the object under test moves, the change in the surface of the object under test causes a change in the focal plane. The autofocus system needs to track the position of the surface of the object under test in real time to ensure that the objective lens is always aligned with the focal plane. Therefore, based on the offset of the defocus change rate of the objective lens at two adjacent moments, the system adjusts the moving speed of the objective lens along the z-axis at the current defocus change rate to achieve dynamic adjustment of the objective lens moving speed.
[0110] In this embodiment, based on the position of the objective lens on the z-axis at different times, the distance the objective lens moves along the z-axis at two adjacent times can be obtained. Combined with the rate of change of defocusing amount of the objective lens moving along the z-axis at two adjacent times at the same time, the change in height of the object surface under test at two adjacent times can be obtained.
[0111] like Figure 3 As shown, the change in height of the object's surface at two consecutive time points: ;
[0112] △T represents the time difference between any two adjacent moments, △z represents the distance the objective lens moves along the z-axis between two adjacent moments, and △h represents the height difference of the surface of the object under test along the z-axis between two adjacent moments.
[0113] Based on the height change of the test surface at two adjacent moments, the relative height change of the test surface determined by the rate of defocus change between different positions on the test surface is corrected.
[0114] Based on the height change at different positions on the surface of the object under test, the defocus amount during the movement of the objective lens along the z-axis is corrected to obtain the corrected rate of change of defocus amount, and then the offset of the corrected rate of change of defocus amount is obtained. Using the speed adjustment model of the objective lens moving along the z-axis, the objective lens movement speed at the next moment after correction is obtained.
[0115] like Figure 4 As shown, a second aspect of the present invention also provides an autofocus objective lens driving system, comprising:
[0116] The data processing module is used to obtain the defocus amount of the objective lens at the current and previous time points, and to calculate the rate of change of defocus amount between two adjacent time points.
[0117] The offset data analysis module, based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, filters the corresponding defocus amount change rate threshold, and calculates the offset of the defocus amount change rate between two adjacent moments. The offset of the defocus amount change rate is the difference between the defocus amount change rate between two adjacent moments and the set defocus amount change rate threshold.
[0118] The drive speed adjustment module is used to extract the current objective lens movement speed along the z-axis. It uses the offset of the defocus change rate, the objective lens movement speed, and the defocus change rate threshold to dynamically adjust the objective lens movement speed at the next moment, so as to balance the consumption of focusing speed and defocus calculation.
[0119] The specific implementation of the autofocus objective lens driving system provided in this application can be referred to the above-described autofocus objective lens driving method, and will not be repeated here.
[0120] 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 objective lens driving methods.
[0121] 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.
[0122] 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. A method for driving an autofocus objective lens, characterized in that, include: Obtain the defocus amount at the current and previous objective lens positions, and calculate the rate of change of defocus amount between two adjacent time points. Based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, the corresponding defocus amount change rate threshold is selected, and the offset of the defocus amount change rate between two adjacent moments is calculated. The offset of the defocus amount change rate is the difference between the defocus amount change rate between two adjacent moments and the set defocus amount change rate threshold. Extract the current objective lens's moving speed along the z-axis. Using the offset of the defocusing rate of change, the objective lens moving speed, and the defocusing rate of change threshold, dynamically adjust the objective lens moving speed for the next moment to balance the consumption of focusing speed and defocusing calculation.
2. The method for driving an autofocus objective lens according to claim 1, characterized in that, If the absolute value of the defocus amount at the current moment is greater than the set defocus amount threshold, the objective lens movement speed is increased; if the absolute value of the defocus amount at the current moment is not greater than the set defocus amount threshold, the objective lens movement speed is decreased.
3. The method for driving an autofocus objective lens according to claim 1, characterized in that, The defocus change rate threshold includes a first threshold and a second threshold. The first threshold is greater than the second threshold. The defocus change rate corresponding to the objective lens moving along the z-axis at an initial first moving speed is used as the first threshold, and the defocus change rate corresponding to the objective lens moving along the z-axis at an initial second moving speed is used as the second threshold. The initial first moving speed is greater than the initial second moving speed.
4. The method for driving an autofocus objective lens according to claim 3, characterized in that, Based on whether the direction of the change in the position of the light spot on the sensor caused by the movement of the objective lens along the z-axis is the same as the direction of the movement of the object under test along the x-axis, the maximum allowable movement speed of the objective lens is selected by the sum of the change in the position of the light spot on the sensor caused by the movement of the objective lens along the z-axis and the change in the position of the object under test on the sensor caused by the movement of the object under test along the x-axis. The maximum allowable movement speed of the objective lens is greater than the initial first movement speed.
5. The method for driving an autofocus objective lens according to claim 3, characterized in that, Based on the defocus amount at the current objective lens position, the corresponding defocus amount change rate threshold is selected. Combining the relationship between the absolute value of the current defocus amount and the set defocus amount threshold, as well as the offset of the defocus amount change rate, the speed adjustment model is used to calculate the adjusted speed of the objective lens along the z-axis at the next moment, according to the current moving speed of the objective lens along the z-axis. The speed adjustment model is determined by the objective lens moving speed at the current moment, the offset of the defocus change rate between two adjacent moments, and the defocus change rate threshold corresponding to the defocus change rate.
6. The method for driving an autofocus objective lens according to claim 5, characterized in that, The method for dynamically controlling the movement speed of the objective lens along the z-axis includes: Extract the rate of defocus change corresponding to the movement of the objective lens along the z-axis between two adjacent time points, and calculate the offset of the rate of defocus change. Analyze the rate of change of defocusing at different positions of the test object as it moves along the x-axis; Based on the rate of defocus change at different positions of the object under test in two adjacent time intervals, the rate of defocus change at the position of the objective lens is corrected, and the moving speed of the objective lens in the next two adjacent time intervals is analyzed using the corrected rate of defocus change. Based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, the corresponding range of the defocus amount change rate is determined, and it is judged whether the predicted defocus amount change rate in the next two adjacent moments is within the corresponding range of the defocus amount change rate. If the defocusing rate is not within the corresponding range, focus is performed using the objective lens moving speed at the current moment; if it is within the corresponding range, the predicted defocusing rate of change is calculated, and combined with the objective lens moving speed at the current moment and the defocusing rate of change threshold, the objective lens moving speed at the next moment is calculated.
7. The method for driving an autofocus objective lens according to claim 4, characterized in that, Based on the set displacement threshold, the horizontal movement speed of the object under test, the magnification of the objective lens, and the exposure time of the sensor, a relationship is established between the movement speed of the objective lens along the z-axis and the horizontal movement speed of the object under test, and the maximum allowable movement speed of the objective lens along the z-axis is determined.
8. The method for driving an autofocus objective lens according to claim 1, characterized in that, Based on the position of the objective lens on the z-axis at different times, the distance the objective lens moves along the z-axis at two adjacent times is obtained. Combined with the rate of change of defocusing of the objective lens along the z-axis at two adjacent times at the same time, the change in height of the object surface at two adjacent times is obtained.
9. An autofocus objective lens driving system, applied to the method described in any one of claims 1-8, characterized in that, include: The data processing module is used to obtain the defocus amount of the objective lens at the current and previous time points, and to calculate the rate of change of defocus amount between two adjacent time points. The offset data analysis module, based on the relationship between the absolute value of the defocus amount at the current moment and the set defocus amount threshold, filters the corresponding defocus amount change rate threshold, and calculates the offset of the defocus amount change rate between two adjacent moments. The offset of the defocus amount change rate is the difference between the defocus amount change rate between two adjacent moments and the set defocus amount change rate threshold. The drive speed adjustment module is used to extract the current objective lens movement speed along the z-axis. It uses the offset of the defocus change rate, the objective lens movement speed, and the defocus change rate threshold to dynamically adjust the objective lens movement speed at the next moment, so as to balance the consumption of focusing speed and defocus calculation.
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 objective lens driving method according to any one of claims 1-8.
Citation Information
Patent Citations
Imaging apparatus, control method thereof, and storage medium
CN112153277A
AI-based mobile focusing method and device
CN116095474A