Automatic focusing control method and control system thereof
By optimizing the movement strategy of the focus lens and image clarity detection algorithm, the problems of slow response speed and insufficient focus accuracy of the traditional automatic focusing method are solved, and fast and accurate automatic focusing is achieved, adapting to changes in complex environments, ensuring timely focus Sex and stability.
Patent Information
- Application Number
- CN202411497418.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-10-25
AI Technical Summary
The traditional automatic focusing method has slow response speed, insufficient focus accuracy, and poor adaptability to environmental changes. Especially in low-light environments or complex scenes, it is easy to lead to misjudgment and too long focus time, and miss important shooting opportunities.
By optimizing the movement strategy of the focus lens and the image definition detection algorithm, the initial direction is determined using bidirectional movement, the movement speed is dynamically adjusted using the change rate of image definition, reducing the movement step length when approaching the optimal focus position, and in the detection Record the optimal focus position when the image sharpness decreases to ensure the accuracy and timeliness of focus.
Fast and accurate automatic focus is achieved, focusing accuracy and stability is improved, ensuring that the best focus position can be found under complex conditions, reducing focus time and improving user experience.
Smart Images

Figure CN119012010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of focusing technology, and in particular to an automatic focusing control method and a control system thereof. Background Art
[0002] As digital imaging and photography technologies become increasingly mature, the autofocus system is one of the key technologies to improve image quality and shooting experience. Its performance and efficiency are directly related to the clarity of the final image and user satisfaction. Traditional autofocus methods often rely on complex algorithms or preset focusing strategies, but in actual applications, these methods often have problems such as slow response speed, insufficient focusing accuracy, or poor adaptability to environmental changes.
[0003] First, traditional autofocus control methods usually require extensive searches throughout the entire focusing range to find the optimal focus position. Although this "coarse adjustment + fine adjustment" strategy improves the focusing accuracy to a certain extent, it also significantly increases the focusing time, especially in low-light environments or complex scenes. Longer focusing time may cause users to miss important shooting opportunities.
[0004] Secondly, some existing autofocus methods rely on algorithms such as image feature recognition or contrast detection to determine the focus position. However, in practical applications, these algorithms are often affected by multiple factors such as image noise, lighting changes, and object motion, resulting in unstable focusing accuracy and even misjudgment.
[0005] Therefore, it is necessary to provide an automatic focusing control method and a control system thereof to solve the above technical problems. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides an automatic focusing control method and a control system thereof, which realize fast and accurate automatic focusing by optimizing the movement strategy of the focusing lens and the image clarity detection algorithm. The present invention provides an automatic focusing control method, the control method comprising the following steps: At the initial position of the focusing lens, the focusing lens is moved bidirectionally according to a preset distance, and the initial moving direction of the focusing lens is determined according to the image clarity obtained after the bidirectional movement; Adjusting the focus lens along the initial moving direction at a preset moving speed, and regularly calculating the image definition change rate; adjusting the moving speed based on the image definition change rate, and moving the focus lens at the adjusted moving speed, wherein the image definition change rate is inversely proportional to the moving speed; When the image definition change rate is less than a preset threshold, reducing the moving speed of the focus lens, and continuing to move the focus lens along the initial moving direction; During the movement of the focus lens, when a decrease in image clarity is detected for the first time, the position at the previous moment is recorded as the best focus position, and the focus lens is moved to the best focus position.
[0007] Preferably, at the initial position of the focusing lens, bidirectional movement is performed according to a preset distance, and the initial movement direction of the focusing lens is determined according to the image clarity obtained after the bidirectional movement, including: At an initial position of the focusing lens, the focusing lens is moved in a first direction by a first distance, and a clarity of a first image after the movement is calculated; Moving in a second direction according to a first distance, and calculating the definition of a second image after the movement, wherein the first direction is opposite to the second direction; Compare the values of the first image clarity and the second image clarity, specifically: If the first image definition is greater than the second image definition, determining that the initial moving direction of the focus lens is the first direction; If the second image definition is greater than the first image definition, determining the initial moving direction of the focus lens to be the second direction; If the second image definition is equal to the first image definition, the calculation steps of the first image definition and the second image definition are performed again according to a second distance, wherein the second distance is smaller than the first distance, until the initial moving direction of the focus lens is determined.
[0008] Preferably, the step of adjusting the focus lens at a preset moving speed along the initial moving direction and periodically calculating the image definition change rate comprises: After determining the initial moving direction of the focus lens, starting a preset moving speed to make the focus lens move at a uniform speed along the initial moving direction; At the beginning and end of each preset time interval, capturing and calculating the image clarity of the image at the focus lens position; The image definition change rate is calculated according to the image definition captured within each preset time interval.
[0009] Preferably, the calculation formula for the image definition change rate is: in, Indicates the rate of change of image clarity, Indicates the current time The image clarity at Indicates the last time Image clarity, Indicates the preset time interval.
[0010] Preferably, in the step of adjusting the moving speed based on the image definition change rate, the moving speed adjustment formula is: in, Indicates the adjusted movement speed. Indicates the initial moving speed, Indicates the preset adjustment factor.
[0011] Preferably, when the image definition change rate is less than a preset threshold, reducing the moving speed of the focus lens and continuing to move the focus lens along the initial moving direction comprises: When the image definition change rate calculated at each preset time interval is less than a preset threshold, it is determined that the current focusing lens is close to the optimal focus position; According to the image definition change rate less than a preset threshold, the moving speed is adjusted again by the adjustment formula to reduce the moving speed; The focus lens is moved at the re-adjusted moving speed, and the image definition change rate is kept calculated.
[0012] Preferably, during the movement of the focus lens, when a decrease in image clarity is detected for the first time, recording the position at the previous moment as the optimal focus position, and moving the focus lens to the optimal focus position comprises: Comparing the image clarity at the previous and next moments, if the image clarity at the next moment is less than that at the previous moment, it is determined that the image clarity has decreased; When the image clarity is first detected to be reduced, the focus lens position at the previous moment is recorded as the optimal focus position; The current movement of the focus lens is stopped, and the focus lens is moved in the reverse direction according to the recorded best focus position, so as to move the focus lens to the best focus position.
[0013] The present invention also provides an automatic focusing control system for executing an automatic focusing control method, the control system comprising: An initial movement direction determination module is used to perform bidirectional movement of the focusing lens at an initial position according to a preset distance, and determine the initial movement direction of the focusing lens according to the image clarity obtained after the bidirectional movement; A change rate calculation module, used for adjusting the focus lens along the initial moving direction at a preset moving speed, and periodically calculating the image definition change rate; a position adjustment module, configured to adjust the moving speed based on the image definition change rate, and move the focus lens at the adjusted moving speed, wherein the image definition change rate is inversely proportional to the moving speed; A deceleration module, used for reducing the moving speed of the focus lens when the image definition change rate is less than a preset threshold value, and continuing to move the focus lens along the initial moving direction; The focus alignment module is used to record the position at the previous moment as the best focus position and move the focus lens to the best focus position when the image clarity drops for the first time during the movement of the focus lens.
[0014] Compared with the related art, the automatic focusing control method and control system provided by the present invention have the following beneficial effects: The present invention realizes fast and accurate automatic focusing by optimizing the movement strategy of the focus lens and the image clarity detection algorithm. The method firstly determines the focusing direction by bidirectionally moving the focus lens and comparing the image clarity, and then dynamically adjusts the movement speed of the focus lens by using the image clarity change rate, so as to reduce the movement step length when approaching the optimal focus position and improve the focusing accuracy. At the same time, when it is detected that the image clarity decreases, the movement is immediately stopped and the optimal focus position is recorded to ensure the accuracy and timeliness of focusing. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flow chart of an automatic focusing control method provided by the present invention; Figure 2 The present invention provides a schematic structural diagram of an automatic focusing control system. DETAILED DESCRIPTION
[0016] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.
[0017] It should also be noted that, for ease of description, only the parts related to the present invention, but not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations (or steps) as being processed sequentially, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the various operations can be rearranged. The processing can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0018] Embodiment 1 The present invention provides an automatic focusing control method, the control method comprising the following steps: S1: At the initial position of the focusing lens, bidirectional movement is performed according to a preset distance, and the initial movement direction of the focusing lens is determined according to the image clarity obtained after the bidirectional movement.
[0019] This step can quickly determine the initial moving direction of the focusing lens through two-way comparison, avoiding blindly moving too far in one direction and missing the optimal focus position. At the same time, a more fine-grained search strategy is adopted when the clarity values are equal to ensure that the best moving direction can be found in any case.
[0020] In addition, due to the adoption of a two-way comparison and step-by-step refinement strategy, the stability and accuracy of the focusing process can be guaranteed even under complex conditions such as light changes and target object movement.
[0021] In this embodiment, step S1 specifically includes the following steps: S11: At an initial position of the focus lens, move the focus lens in a first direction according to a first distance, and calculate a first image clarity after the movement.
[0022] In this embodiment, the focusing lens is used in the camera to adjust the focus so that the captured image is clearest. In the automatic focusing system, the focusing lens needs to start from the initial position and find the best focus position. In order to efficiently and accurately determine the initial movement direction, it is necessary to try in different directions based on the initial position.
[0023] The specific steps of the trial are: First, initialize the parameters: set the initial position of the focusing lens to zero, define the first direction to be positive (for example, moving forward), and the first distance to be a pre-set small distance value, which should be sufficient to observe the change in image clarity but not too large to miss the best focus.
[0024] Secondly, perform forward movement: based on the initial position, drive the focus lens to move a first distance in the forward direction.
[0025] Next, image capture and processing is performed: an image of the target area is captured at a new position, and an image processing algorithm (including but not limited to edge detection and Laplace operator) is used to calculate the clarity value of the image, which is the first image clarity.
[0026] Finally, record the data: save the current position and the corresponding image clarity value for later comparison.
[0027] S12: moving in a second direction according to a first distance, and calculating the clarity of a second image after the movement, wherein the first direction is opposite to the second direction.
[0028] In this embodiment, in order to compare the image clarity in different directions, it is necessary to repeat similar operations in the opposite direction, specifically: First, a reverse movement is performed: based on the initial position, the focus lens is driven to move along a direction opposite to the first direction by the same first distance.
[0029] Secondly, image capture and processing are also performed: at the new position, an image of the target area is captured, and the same image processing algorithm as in step S11 is used to calculate the clarity value of the image, which is the second image clarity.
[0030] Finally, record the data as well: save the current position and the corresponding image clarity value for later comparison.
[0031] S13: Compare the values of the first image definition and the second image definition, specifically: If the first image definition is greater than the second image definition, determining that the initial moving direction of the focus lens is the first direction; If the second image definition is greater than the first image definition, determining the initial moving direction of the focus lens to be the second direction; If the second image definition is equal to the first image definition, the calculation steps of the first image definition and the second image definition are performed again according to a second distance, wherein the second distance is smaller than the first distance, until the initial moving direction of the focus lens is determined.
[0032] In this embodiment, the initial moving direction of the focus lens can be determined by comparing the image clarity in two directions, specifically: First, compare sharpness: compare the sharpness values of images captured at two different locations.
[0033] Next, determine the direction: If the first image definition is greater than the second image definition, it is determined that the focus lens should be moved in the first direction (positive direction).
[0034] If the second image definition is greater than the first image definition, it is determined that the focus lens should be moved in the second direction (reverse direction).
[0035] If the two clarity values are equal, it means that it is impossible to distinguish which direction is better under the current large step size, and the step size needs to be reduced for more detailed detection.
[0036] Secondly, a fine detection is performed: if the two clarity values are equal, steps S11 and S12 are executed again with a smaller second distance until it is possible to distinguish which direction can make the image clearer.
[0037] Finally, record the direction choice: Once you have determined the initial direction of movement, record it as a basis for subsequent steps.
[0038] S2: adjusting the focus lens along the initial moving direction at a preset moving speed, and periodically calculating the image definition change rate.
[0039] This step can monitor the focusing process in real time by periodically calculating the image clarity change rate, ensuring that the focusing lens does not fluctuate significantly when approaching the optimal focus position; at the same time, the clarity change rate is used to guide the moving speed of the focusing lens, which can gradually slow down when approaching the optimal focus position, thereby improving the focusing accuracy; the selection of preset time intervals and moving speeds can optimize the focusing speed, which is neither too fast nor too slow, ensuring that the focusing process is both quick and accurate.
[0040] In this embodiment, step S2 specifically includes the following steps: S21: After determining the initial moving direction of the focus lens, start a preset moving speed to make the focus lens move at a uniform speed along the initial moving direction.
[0041] In this embodiment, after the initial moving direction of the focus lens is determined, the next step is to move the focus lens along this direction and adjust it at a certain speed. This step is to get closer to the optimal focus position.
[0042] First, the initial moving direction has been determined in step S13, and now a preset moving speed needs to be set. This speed should be fast enough to reduce the focusing time, but not too fast to avoid missing the optimal focal position. After the initial moving direction is determined, the control system starts the focusing lens to move uniformly along the direction at a preset speed.
[0043] In addition, during the movement, the position of the focus lens needs to be continuously monitored to ensure that it moves at a predetermined speed and is ready to enter the next step of timing calculation of the image clarity change rate.
[0044] The steps for setting the preset moving speed are as follows: a. Initial settings: According to the maximum moving speed of the focusing lens and the system response time, a reasonable moving speed range is preliminarily determined. The specification of the focusing lens can be referred to to understand its maximum moving speed and recommended moving speed range.
[0045] b. Experimental test: Conduct multiple experiments in a laboratory environment to test the effects of different movement speeds on focusing accuracy. Select several typical test scenarios, including different lighting conditions and target objects, to ensure that the preset movement speeds perform well under a variety of conditions. Record the focusing time, focusing accuracy, and other key indicators at each movement speed.
[0046] c. Data analysis: Analyze the experimental data to find out the moving speed that can maintain high focusing accuracy under different conditions, compare the focusing time under different speeds, and select a speed that can ensure focusing accuracy and complete the focusing process quickly.
[0047] d. Optimization and adjustment: According to the analysis results, the preset movement speed is optimized to ensure fast and accurate focusing in actual applications. A default preset movement speed can be set, and the movement speed can be dynamically adjusted under certain specific conditions (such as large light changes, target object movement, etc.).
[0048] e. Speed integration: The determined preset moving speed is integrated into the automatic focus control system to ensure that the focus lens can move at the set speed.
[0049] S22: At the beginning and end of each preset time interval, capturing and calculating the image clarity of the image at the focus lens position.
[0050] In this embodiment, in order to evaluate the change of image clarity in real time, it is necessary to capture images and calculate the clarity within a preset time interval.
[0051] According to the application requirements, set a reasonable time interval, such as once per second or once every half second. This time interval should be short enough to capture the change of clarity, but not too frequent to avoid unnecessary computational burden.
[0052] At the beginning and end of each preset time interval, an image of the target area is captured, which can be accomplished by a camera or other image acquisition device.
[0053] The image processing algorithm determined in step S11 is used to calculate the definition value of each captured image, and the definition value is recorded so as to calculate the definition change rate later.
[0054] S23: Calculate the image definition change rate according to the image definition captured in each preset time interval.
[0055] The calculation formula of the image definition change rate is: in, Indicates the rate of change of image clarity, Indicates the current time The image clarity at Indicates the last time Image clarity, Indicates the preset time interval.
[0056] In this embodiment, by comparing the image clarity values at adjacent time points, the clarity change rate can be calculated, thereby understanding whether the focusing lens is close to the optimal focus position.
[0057] The image definition change rate is calculated according to the above formula, and the calculated definition change rate is recorded so as to be compared with the preset threshold and decide the next action.
[0058] S3: adjusting the moving speed based on the image definition change rate, and moving the focus lens at the adjusted moving speed, wherein the image definition change rate is inversely proportional to the moving speed.
[0059] The adjustment formula of the moving speed is: in, Indicates the adjusted movement speed. Indicates the initial moving speed, Indicates the preset adjustment factor.
[0060] Step S2 has monitored the focusing process by regularly calculating the image definition change rate. Next, the moving speed of the focus lens needs to be adjusted according to these change rates to ensure more precise adjustment when approaching the optimal focus position.
[0061] In step S3, a preset adjustment coefficient is set This is an empirical value, usually between 0 and 1, used to adjust the movement speed and preset adjustment coefficient The selection should ensure that the movement speed gradually decreases when approaching the best focus position; set the initial movement speed , which is the preset moving speed determined in step S21.
[0062] Use the above adjustment formula to calculate the adjusted moving speed, update the moving speed of the focusing lens according to the calculated moving speed, so that the focusing lens continues to move at a uniform speed along the initial moving direction at the new moving speed, monitor the position and speed of the focusing lens to ensure that it moves at the adjusted speed, continue to execute steps S22 and S23, continuously calculate the image clarity change rate, and adjust the moving speed according to the change rate, repeat the above process until the image clarity change rate is less than the preset threshold, and enter step S4.
[0063] S4: When the image definition change rate is less than a preset threshold, reducing the moving speed of the focus lens, and continuing to move the focus lens along the initial moving direction.
[0064] This step can significantly improve the focusing accuracy by reducing the moving speed when approaching the optimal focus position. The reduced moving speed ensures that the focus lens can be positioned more accurately at the optimal focus position, thereby obtaining a clearer image.
[0065] At the same time, reducing the movement speed can reduce fluctuations when approaching the optimal focus position, making the focusing process more stable. Even when the light changes or the target object moves, the focusing stability can be maintained by reducing the movement speed.
[0066] The initial moving speed is fast, which can quickly approach the optimal focus position; as it approaches the optimal focus position, the moving speed gradually decreases to ensure the final focusing accuracy. This strategy ensures both focusing speed and focusing accuracy.
[0067] In this embodiment, step S4 specifically includes the following steps: S41: When the image definition change rate calculated at each preset time interval is less than a preset threshold, it is determined that the current focus lens is close to the optimal focus position.
[0068] In this embodiment, when the image definition change rate is less than a preset threshold, it means that the focus lens has approached the optimal focus position. At this time, the moving speed needs to be further reduced to ensure the accuracy of the final positioning.
[0069] Set a preset threshold: According to experimental data and application requirements, set an appropriate preset threshold. This threshold is used to determine whether the focusing lens is close to the optimal focus position.
[0070] Compare change rate: In each preset time interval, calculate the image clarity change rate and compare it with the preset threshold.
[0071] Determine whether the focus lens is close to the optimal focus position: If the image definition change rate is less than a preset threshold, it is determined that the focus lens is close to the optimal focus position.
[0072] S42: According to the image definition change rate that is less than a preset threshold, the moving speed is adjusted again by the adjustment formula to reduce the moving speed.
[0073] In this embodiment, once it is determined that the focus lens is close to the optimal focus position, the moving speed needs to be further reduced to ensure the final focusing accuracy.
[0074] Specifically, the moving speed is calculated according to the adjustment formula in step S3 to further reduce the moving speed.
[0075] S43: moving the focus lens at the re-adjusted moving speed, and keeping calculating the image definition change rate.
[0076] In this embodiment, the focus lens continues to be moved at the new moving speed, and the image definition change rate is kept calculated to ensure the accuracy of the final focus.
[0077] Specifically: Continue moving: Make the focusing lens continue to move at a constant speed along the initial moving direction at a new moving speed.
[0078] Continuous Monitoring: Continues to capture images and calculates the rate of change of sharpness at each preset time interval to ensure the focus lens can accurately approach the optimal focus position.
[0079] Loop iteration: Repeat the above process until the focusing lens reaches the optimal focus position or the image clarity change rate no longer meets the reduction condition.
[0080] S5: During the movement of the focus lens, when it is detected for the first time that the image clarity decreases, the position at the previous moment is recorded as the best focus position, and the focus lens is moved to the best focus position.
[0081] This step can accurately determine the optimal focus position by monitoring changes in image clarity in real time, ensuring that the focusing lens can accurately focus on the optimal focus; when a drop in clarity is first detected, the position of the previous moment is immediately recorded to avoid missing the optimal focus position due to excessive movement.
[0082] At the same time, when approaching the optimal focus position, by reducing the movement speed, the optimal focus position can be found more quickly, reducing the number of unnecessary movements. Once the optimal focus position is determined, the movement is stopped immediately and moved in the opposite direction, reducing the focusing time.
[0083] In this embodiment, step S5 specifically includes the following steps: S51: Compare the image clarity at the previous and next moments. If the image clarity at the next moment is smaller than the image clarity at the previous moment, it is determined that the image clarity has decreased.
[0084] During the movement of the focus lens, it is necessary to monitor the change of image clarity in real time to determine when the focus lens has approached or exceeded the optimal focus position.
[0085] At each preset time interval, an image is captured and the image clarity is calculated, and the image clarity at the current moment is compared with the image clarity at the previous moment.
[0086] If the image clarity at the current moment is less than the image clarity at the previous moment, it is determined that the image clarity has decreased; otherwise, the change in image clarity continues to be monitored.
[0087] S52: When the image clarity decreases for the first time, the focus lens position at the previous moment is recorded as the optimal focus position.
[0088] In this embodiment, when the image definition degradation is detected for the first time, the current position of the focus lens needs to be recorded as the optimal focus position.
[0089] Once it is detected that the image clarity has dropped, the position of the focus lens at the previous moment is immediately recorded. This position is the optimal focus position, and the recorded optimal focus position is stored in the system for subsequent operations.
[0090] S53: Stop the current movement of the focus lens, and move the focus lens in the reverse direction according to the recorded best focus position, so as to move the focus lens to the best focus position.
[0091] In this embodiment, after the best focus position is recorded, it is necessary to stop the current movement and move the focus lens in the reverse direction to the best focus position.
[0092] Immediately stop the current movement of the focus lens, and according to the recorded optimal focus position, move the focus lens in the reverse direction to return it to the optimal focus position. During the entire reverse movement process, continue to monitor the position of the focus lens to ensure that it moves accurately to the optimal focus position. When the focus lens reaches the optimal focus position, confirm its position and end the automatic focusing process.
[0093] The working principle of an automatic focusing control method provided by the present invention is as follows: In the initial stage of automatic focusing, the focus lens is first located at a preset starting position, and then the focus lens is controlled to move a short distance in two opposite directions (a first direction and a second direction) according to a preset distance (a first distance).
[0094] Movement in the first direction: the focusing lens moves a first distance in the first direction, and the system captures and calculates the image clarity at this time (first image clarity).
[0095] Movement in the second direction: Subsequently, the focus lens is moved in the opposite second direction by the same distance, and the image clarity at this time (second image clarity) is calculated.
[0096] By comparing the image clarity in the two directions, the initial moving direction of the focus lens is determined. If the first image clarity is higher, the first direction is selected; otherwise, the second direction is selected. If the two are equal, the moving distance (the second distance) is reduced, and the above steps are repeated until the initial moving direction is determined.
[0097] After determining the initial moving direction, the focusing lens is started at a preset moving speed to move uniformly along the direction. At the same time, the clarity of the image is captured and calculated at each preset time interval to monitor the change in clarity.
[0098] At the beginning and end of each time interval, images are captured and their sharpness is calculated.
[0099] The image clarity data at the above time points are used to calculate the rate of change of image clarity. This indicator reflects the changing trend of image clarity during the movement of the focusing lens.
[0100] The moving speed of the focusing lens is dynamically adjusted according to the rate of change of image clarity. This step is intended to optimize the focusing process and improve the focusing speed and accuracy.
[0101] Among them, the size of the image clarity change rate reflects the degree to which the focusing lens is close to the optimal focus position. When the change rate is large, it indicates that the current position of the focusing lens is far away from the optimal focus position, and the moving speed needs to be increased to quickly approach the focus; when the change rate is small, it indicates that the focusing lens is already close to the optimal focus position. At this time, the moving speed should be reduced for more precise adjustments to ensure accurate focusing.
[0102] Based on the preset adjustment coefficient and initial movement speed, combined with the current image clarity change rate, the new movement speed is dynamically calculated. This dynamic adjustment ensures that the focusing process is both fast and accurate.
[0103] During the movement of the focusing lens, the image clarity is continuously monitored. When the image clarity drops for the first time, it is considered that the current position has exceeded the optimal focus position. At this time, the position at the previous moment is recorded as the optimal focus position, and the focusing lens is controlled to move in the opposite direction to this position. By comparing the image clarity at the previous and next moments, it is determined whether the clarity drops. Once the optimal focus position is determined, the current movement is stopped immediately, and the focusing lens is moved in the opposite direction to this position, thereby completing the automatic focusing process.
[0104] Embodiment 2 The present invention also provides an automatic focusing control system for executing an automatic focusing control method, referring to Figure 2 As shown, the control system includes: The initial movement direction determining module 100 is used to perform bidirectional movement according to a preset distance at the initial position of the focus lens, and determine the initial movement direction of the focus lens according to the image clarity obtained after the bidirectional movement.
[0105] The change rate calculation module 200 is used to adjust the focus lens along the initial moving direction at a preset moving speed and to periodically calculate the image definition change rate.
[0106] The position adjustment module 300 is used to adjust the moving speed based on the image definition change rate, and move the focus lens at the adjusted moving speed, wherein the image definition change rate is inversely proportional to the moving speed.
[0107] The deceleration module 400 is used to reduce the moving speed of the focus lens when the image definition change rate is less than a preset threshold value, and continue to move the focus lens along the initial moving direction.
[0108] The focus alignment module 500 is used to record the position at the previous moment as the best focus position and move the focus lens to the best focus position when the image clarity drops for the first time during the movement of the focus lens.
[0109] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0110] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, the storage medium including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0111] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or includes elements that are inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.
Claims
1. An automatic focusing control method, characterized in that: The control method comprises the following steps: At the initial position of the focusing lens, the focusing lens is moved bidirectionally according to a preset distance, and the initial moving direction of the focusing lens is determined according to the image clarity obtained after the bidirectional movement; Adjusting the focus lens along the initial moving direction at a preset moving speed, and regularly calculating the image definition change rate; adjusting the moving speed based on the image definition change rate, and moving the focus lens at the adjusted moving speed, wherein the image definition change rate is inversely proportional to the moving speed; When the image definition change rate is less than a preset threshold, reducing the moving speed of the focus lens, and continuing to move the focus lens along the initial moving direction; During the movement of the focus lens, when a decrease in image clarity is detected for the first time, the position at the previous moment is recorded as the best focus position, and the focus lens is moved to the best focus position.
2. The automatic focusing control method according to claim 1, characterized in that: The method of moving the focusing lens bidirectionally according to a preset distance at the initial position of the focusing lens and determining the initial moving direction of the focusing lens according to the image clarity obtained after the bidirectional movement comprises: At an initial position of the focusing lens, the focusing lens is moved in a first direction by a first distance, and a clarity of a first image after the movement is calculated; Moving in a second direction according to a first distance, and calculating the definition of a second image after the movement, wherein the first direction is opposite to the second direction; Compare the values of the first image clarity and the second image clarity, specifically: If the first image definition is greater than the second image definition, determining that the initial moving direction of the focus lens is the first direction; If the second image definition is greater than the first image definition, determining the initial moving direction of the focus lens to be the second direction; If the second image definition is equal to the first image definition, the calculation steps of the first image definition and the second image definition are performed again according to a second distance, wherein the second distance is smaller than the first distance, until the initial moving direction of the focus lens is determined.
3. The automatic focusing control method according to claim 2, characterized in that: The step of adjusting the focus lens at a preset moving speed along the initial moving direction and periodically calculating the image definition change rate comprises: After determining the initial moving direction of the focus lens, starting a preset moving speed to make the focus lens move at a uniform speed along the initial moving direction; At the beginning and end of each preset time interval, capturing and calculating the image clarity of the image at the focus lens position; The image definition change rate is calculated according to the image definition captured within each preset time interval.
4. The automatic focusing control method according to claim 3, characterized in that: The calculation formula of the image definition change rate is: in, Indicates the rate of change of image clarity, Indicates the current time The image clarity at Indicates the last time Image clarity, Indicates the preset time interval.
5. The automatic focusing control method according to claim 4, characterized in that: In the step of adjusting the moving speed based on the image definition change rate, the moving speed adjustment formula is: in, Indicates the adjusted movement speed. Indicates the initial moving speed, Indicates the preset adjustment factor.
6. The automatic focusing control method according to claim 5, characterized in that: When the image definition change rate is less than a preset threshold, reducing the moving speed of the focus lens and continuing to move the focus lens along the initial moving direction, comprises: When the image definition change rate calculated at each preset time interval is less than a preset threshold, it is determined that the current focusing lens is close to the optimal focus position; According to the image definition change rate less than a preset threshold, the moving speed is adjusted again by the adjustment formula to reduce the moving speed; The focus lens is moved at the re-adjusted moving speed, and the image definition change rate is kept calculated.
7. The automatic focusing control method according to claim 6, characterized in that: In the process of moving the focus lens, when it is detected for the first time that the image clarity decreases, the position at the previous moment is recorded as the best focus position, and the focus lens is moved to the best focus position, including: Comparing the image clarity at the previous and next moments, if the image clarity at the next moment is less than that at the previous moment, it is determined that the image clarity has decreased; When the image clarity is first detected to be reduced, the focus lens position at the previous moment is recorded as the optimal focus position; The current movement of the focus lens is stopped, and the focus lens is moved in the reverse direction according to the recorded best focus position, so as to move the focus lens to the best focus position.
8. An automatic focusing control system, used to execute an automatic focusing control method according to any one of claims 1 to 7, characterized in that: The control system comprises: An initial movement direction determination module is used to perform bidirectional movement of the focusing lens at an initial position according to a preset distance, and determine the initial movement direction of the focusing lens according to the image clarity obtained after the bidirectional movement; A change rate calculation module, used for adjusting the focus lens along the initial moving direction at a preset moving speed, and periodically calculating the image definition change rate; a position adjustment module, configured to adjust the moving speed based on the image definition change rate, and move the focus lens at the adjusted moving speed, wherein the image definition change rate is inversely proportional to the moving speed; A deceleration module, used for reducing the moving speed of the focus lens when the image definition change rate is less than a preset threshold value, and continuing to move the focus lens along the initial moving direction; The focus alignment module is used to record the position at the previous moment as the best focus position and move the focus lens to the best focus position when the image clarity drops for the first time during the movement of the focus lens.
Citation Information
Patent Citations
Tracking focusing method and apparatus
CN105657238A
Method, device and system for adjusting camera back focus
CN106375647A
Focusing method, device and projection equipment
CN107942474A
Contrast detection autofocus using adaptive step size
CN112312018A
Stepping step length control method and method for determining stepping step length of stepping motor
CN113747042A
Cited By
Objective lens adjusting method and overlay measuring method
CN121325356A
