Automatic focusing control method and control system thereof
By optimizing the movement strategy of the focusing lens and the image clarity detection algorithm, the problems of slow response speed and insufficient focusing accuracy in traditional autofocus methods are solved, achieving fast and accurate autofocus and maintaining stability when the environment changes.
Patent Information
- Application Number
- CN202411497418.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-25
AI Technical Summary
The traditional automatic focus control method has the problems of slow response speed, insufficient focus accuracy or poor adaptability to environmental changes, especially in low-light environments or complex scenarios, resulting in too long focus time and unstable focus accuracy.
By optimizing the mobile strategy and image clarity detection algorithm of the lens to achieve fast and accurate automatic focus. Specific steps include two -way movement at the initial position of the scorched lens, determine the initial movement direction according to the image definition, and then adjust the movement speed of the focus lens in the initial movement direction. Record the best focus position when the image definition decreases.
Realize the fast and accurate automatic focus, reduce the focus time, improve the focus accuracy, and maintain the stability of focus when environmental changes.
Smart Images

Figure CN119012010B_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 mature, autofocus systems are a key technology for improving image quality and the shooting experience. Their performance and efficiency are directly related to the final image clarity and user satisfaction. Traditional autofocus methods often rely on complex algorithms or preset focusing strategies. However, in practice, these methods often suffer from slow response, insufficient focusing accuracy, and 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 focusing accuracy to a certain extent, it also significantly increases 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 various 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] To solve the above technical problems, the present invention provides an automatic focusing control method and a control system thereof, which achieve fast and accurate automatic focusing by optimizing the movement strategy of the focusing lens and the image clarity detection algorithm.
[0007] The present invention provides an automatic focusing control method, which includes the following steps:
[0008] 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;
[0009] Adjusting the focus lens at a preset moving speed along the initial moving direction, and regularly calculating the image definition change rate;
[0010] 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;
[0011] 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;
[0012] 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 optimal focus position, and the focus lens is moved to the optimal focus position.
[0013] Preferably, the focusing lens is moved bidirectionally according to a preset distance at its initial position, and the initial movement direction of the focusing lens is determined according to the image clarity obtained after the bidirectional movement, including:
[0014] At an initial position of the focusing lens, the focusing lens is moved in a first direction by a first distance, and a first image clarity after the movement is calculated;
[0015] Moving the image in a second direction by a first distance, and calculating the clarity of a second image after the movement, wherein the first direction and the second direction are opposite to each other;
[0016] Compare the values of the first image clarity and the second image clarity, specifically:
[0017] 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;
[0018] 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;
[0019] If the second image definition is equal to the first image definition, the steps of calculating the first image definition and the second image definition are performed again according to a second distance that is smaller than the first distance until the initial moving direction of the focus lens is determined.
[0020] Preferably, the adjusting the focus lens at a preset moving speed along the initial moving direction and periodically calculating the image definition change rate comprises:
[0021] After determining the initial moving direction of the focus lens, starting a preset moving speed to move the focus lens at a uniform speed along the initial moving direction;
[0022] At the beginning and end of each preset time interval, capturing and calculating the image sharpness of the image at the focus lens position;
[0023] The image clarity change rate is calculated based on the image clarity captured within each preset time interval.
[0024] Preferably, the calculation formula for the image definition change rate is:
[0025]
[0026] in, Indicates the rate of change of image clarity, Indicates the current time Image clarity when Indicates the last time Image clarity, Indicates the preset time interval.
[0027] Preferably, in the adjusting the moving speed based on the image definition change rate, the adjustment formula of the moving speed is:
[0028]
[0029] in, Indicates the adjusted movement speed. Indicates the initial moving speed, Indicates the preset adjustment coefficient.
[0030] 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 includes:
[0031] When the image clarity change rate calculated at each preset time interval is less than a preset threshold, it is determined that the current focusing lens has approached the optimal focus position;
[0032] According to the image definition change rate being less than a preset threshold, the moving speed is further adjusted using the adjustment formula to reduce the moving speed;
[0033] The focus lens is moved at the re-adjusted moving speed, and the image definition change rate is kept calculated.
[0034] Preferably, when the image clarity is first detected to be degraded during the movement of the focus lens, recording the position at the previous moment as the optimal focus position and moving the focus lens to the optimal focus position comprises:
[0035] 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 deteriorated;
[0036] When the image clarity is first detected to be degraded, the focus lens position at the previous moment is recorded as the optimal focus position;
[0037] 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.
[0038] The present invention also provides an automatic focusing control system for executing an automatic focusing control method, the control system comprising:
[0039] 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 to determine the initial movement direction of the focusing lens based on the image clarity obtained after the bidirectional movement;
[0040] a change rate calculation module, configured to adjust the focus lens along the initial moving direction at a preset moving speed and periodically calculate the image definition change rate;
[0041] 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;
[0042] a deceleration module, configured to reduce the moving speed of the focus lens and continue to move the focus lens along the initial moving direction when the image definition change rate is less than a preset threshold;
[0043] The focus alignment module is used to record the position at the previous moment as the optimal focus position and move the focus lens to the optimal focus position when the image clarity is detected to decrease for the first time during the movement of the focus lens.
[0044] Compared with related technologies, the automatic focusing control method and control system provided by the present invention have the following beneficial effects:
[0045] The present invention achieves fast and accurate automatic focusing by optimizing the movement strategy of the focusing lens and the image clarity detection algorithm. The method first preliminarily determines the focusing direction by moving the focusing lens in both directions and comparing the image clarity. Then, the moving speed of the focusing lens is dynamically adjusted using the image clarity change rate to reduce the moving step length when approaching the optimal focus position, thereby improving the focusing accuracy. At the same time, when a decrease in image clarity is detected, 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
[0046] Figure 1 A flow chart of an automatic focusing control method provided by the present invention;
[0047] Figure 2 This is a structural schematic diagram of an automatic focusing control system provided by the present invention. DETAILED DESCRIPTION
[0048] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all of the structures. Furthermore, the embodiments of the present invention and the features of the embodiments may be combined with one another unless there is a conflict.
[0049] It should also be noted that, for ease of description, only portions relevant to the present invention are shown in the accompanying drawings, rather than all of the contents. Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the various operations (or steps) as being processed sequentially, many of the operations can be performed in parallel, concurrently, or simultaneously. In addition, the order of the various operations can be rearranged. The process can be terminated when its operations are completed, but may also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0050] Example 1
[0051] The present invention provides an automatic focusing control method, which includes the following steps:
[0052] S1: 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.
[0053] This step can quickly determine the initial movement 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 optimal movement direction can be found in any situation.
[0054] In addition, due to the adoption of a two-way comparison and gradual 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.
[0055] In this embodiment, step S1 specifically includes the following steps:
[0056] S11: At an initial position of the focusing lens, the focusing lens is moved in a first direction by a first distance, and a first image clarity after the movement is calculated.
[0057] 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 optimal 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.
[0058] The specific steps of the trial are:
[0059] First, initialize the parameters: set the initial position of the focusing lens to zero, define the first direction as positive (for example, moving forward), and the first distance to a pre-set small distance value. This value should be large enough to observe the change in image clarity, but not too large to miss the best focus.
[0060] Secondly, perform forward movement: based on the initial position, drive the focus lens to move a first distance in the forward direction.
[0061] Next, image capture and processing are performed: an image of the target area is captured at the new position, and an image processing algorithm (including but not limited to edge detection and Laplace operator) is used to calculate the image clarity value, which is the first image clarity.
[0062] Finally, record the data: save the current position and the corresponding image clarity value for subsequent comparison.
[0063] S12: Moving in a second direction according to a first distance, and calculating a second image definition after the movement, wherein the first direction and the second direction are opposite to each other.
[0064] In this embodiment, in order to compare the image clarity in different directions, it is necessary to repeat similar operations in the opposite directions, specifically:
[0065] 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.
[0066] Next, image capture and processing are performed in the same manner: an image of the target area is captured at the new position, 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.
[0067] Finally, record the data as well: save the current position and the corresponding image clarity value for subsequent comparison.
[0068] S13: Compare the first image clarity and the second image clarity, specifically:
[0069] 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;
[0070] 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;
[0071] If the second image definition is equal to the first image definition, the steps of calculating the first image definition and the second image definition are performed again according to a second distance that is smaller than the first distance until the initial moving direction of the focus lens is determined.
[0072] In this embodiment, the initial moving direction of the focus lens can be determined by comparing the image clarity in two directions, specifically:
[0073] First, compare sharpness: compare the sharpness values of images captured at two different locations.
[0074] Next, determine the direction:
[0075] 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).
[0076] 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).
[0077] 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. In this case, the step size needs to be reduced for more detailed detection.
[0078] Next, 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.
[0079] Finally, record the direction choice: Once you have determined the initial direction of movement, record it as a basis for subsequent steps.
[0080] S2: adjusting the focus lens along the initial moving direction at a preset moving speed, and periodically calculating the image definition change rate.
[0081] 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 movement speed of the focusing lens, which can gradually slow down when approaching the optimal focus position, thereby improving the focusing accuracy; the preset time interval and movement speed selection can optimize the focusing speed, which is neither too fast nor too slow, ensuring that the focusing process is both fast and accurate.
[0082] In this embodiment, step S2 specifically includes the following steps:
[0083] 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.
[0084] 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.
[0085] First, the initial movement direction has been determined in step S13. Now a preset movement 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 focus position. After determining the initial movement direction, the control system starts the focusing lens and moves it at a uniform speed along the direction at a preset speed.
[0086] In addition, during the movement process, the position of the focus lens needs to be continuously monitored to ensure that it moves at the predetermined speed and is ready to enter the next step of timing calculation of the image clarity change rate.
[0087] The steps for setting the preset moving speed are as follows:
[0088] a. Initial settings:
[0089] Based on the maximum moving speed of the focusing lens and the system response time, a reasonable moving speed range is preliminarily determined. You can refer to the specification of the focusing lens to understand its maximum moving speed and recommended moving speed range.
[0090] b. Experimental test:
[0091] Multiple experiments were conducted in a laboratory environment to test the impact of different movement speeds on focusing accuracy. Several typical test scenarios were selected, including different lighting conditions and target objects, to ensure that the preset movement speeds performed well under various conditions. Focus time, focusing accuracy, and other key indicators were recorded at each movement speed.
[0092] c. Data Analysis:
[0093] Analyze the experimental data to find the movement 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.
[0094] d. Optimization and adjustment:
[0095] Based on 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 changes in light, movement of the target object, etc.).
[0096] e. Speed integration:
[0097] Integrating a predetermined preset movement speed into the autofocus control system ensures that the focus lens can move at the set speed.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] The image processing algorithm determined in step S11 is used to calculate the clarity value of each captured image and record it for subsequent calculation of the clarity change rate.
[0103] S23: Calculate the image definition change rate according to the image definition captured in each preset time interval.
[0104] The calculation formula of the image definition change rate is:
[0105]
[0106] in, Indicates the rate of change of image clarity, Indicates the current time Image clarity when Indicates the last time Image clarity, Indicates the preset time interval.
[0107] In this embodiment, by comparing the image clarity values at adjacent time points, the clarity change rate can be calculated, thereby understanding whether the focus lens is close to the optimal focus position.
[0108] The image clarity change rate is calculated according to the above formula, and the calculated clarity change rate is recorded so as to be compared with the preset threshold and decide the next action.
[0109] 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.
[0110] The adjustment formula for the moving speed is:
[0111]
[0112] in, Indicates the adjusted movement speed. Indicates the initial moving speed, Indicates the preset adjustment coefficient.
[0113] 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.
[0114] In step S3, the preset adjustment coefficient is set , this is an empirical value, usually between 0 and 1, used to adjust the movement speed, 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.
[0115] 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 according to 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.
[0116] 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.
[0117] This step can significantly improve the focusing accuracy by reducing the movement speed when approaching the optimal focus position. The reduced movement speed ensures that the focus lens can be positioned more accurately at the optimal focus position, thereby obtaining a clearer image.
[0118] 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 focus stability can be maintained by reducing the movement speed.
[0119] The initial movement speed is fast, allowing the camera to quickly approach the optimal focus position. As it approaches the optimal focus position, the movement speed gradually decreases to ensure the final focus accuracy. This strategy ensures both focusing speed and focusing accuracy.
[0120] In this embodiment, step S4 specifically includes the following steps:
[0121] 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.
[0122] 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.
[0123] 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.
[0124] Compare change rates: Calculate the image clarity change rate at each preset time interval and compare it with the preset threshold.
[0125] Determine if the image clarity change rate is less than a preset threshold, then it is determined that the focus lens is close to the optimal focus position.
[0126] S42: According to the image definition change rate being less than a preset threshold, the moving speed is adjusted again using the adjustment formula to reduce the moving speed.
[0127] 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.
[0128] Specifically, the moving speed is calculated according to the adjustment formula in step S3 to further reduce the moving speed.
[0129] S43: Moving the focus lens at the re-adjusted moving speed, and keeping calculating the image definition change rate.
[0130] In this embodiment, the focus lens continues to move at the new moving speed, and the image definition change rate is kept calculated to ensure the accuracy of the final focus.
[0131] Specifically:
[0132] Continue moving: Make the focusing lens continue to move at a constant speed along the initial moving direction at a new moving speed.
[0133] 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.
[0134] 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.
[0135] 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 optimal focus position, and the focus lens is moved to the optimal focus position.
[0136] 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 at the previous moment is immediately recorded to avoid missing the optimal focus position due to excessive movement.
[0137] 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.
[0138] In this embodiment, step S5 specifically includes the following steps:
[0139] S51: Comparing the image clarity at the previous and next moments. If the image clarity at the next moment is lower than the image clarity at the previous moment, it is determined that the image clarity has deteriorated.
[0140] During the movement of the focus lens, it is necessary to monitor the change in image clarity in real time to determine when the focus lens has approached or exceeded the optimal focus position.
[0141] 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.
[0142] 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.
[0143] S52: When the image clarity degradation is detected for the first time, the focus lens position at the previous moment is recorded as the optimal focus position.
[0144] In this embodiment, when the image clarity degradation is detected for the first time, the current position of the focus lens needs to be recorded as the optimal focus position.
[0145] Once a decrease in image clarity is detected, 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.
[0146] S53: Stop the current movement of the focus lens, and move the focus lens in the reverse direction according to the recorded optimal focus position, so as to move the focus lens to the optimal focus position.
[0147] In this embodiment, after the optimal focus position is recorded, it is necessary to stop the current movement and move the focus lens in the reverse direction to the optimal focus position.
[0148] 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 accurately moves to the optimal focus position. When the focus lens reaches the optimal focus position, confirm its position and end the automatic focusing process.
[0149] The working principle of an automatic focusing control method provided by the present invention is as follows:
[0150] In the initial stage of autofocusing, the focus lens is first located at a preset starting position, and then the focus lens is controlled to move short distances in two opposite directions (first direction and second direction) according to a preset distance (first distance).
[0151] Movement in the first direction: the focusing lens moves in the first direction by a first distance, and the system captures and calculates the image clarity at this time (first image clarity).
[0152] 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.
[0153] The initial movement direction of the focus lens is determined by comparing the image clarity in the two directions. If the first image clarity is higher, the first direction is selected; otherwise, the second direction is selected. If the two are equal, the movement distance (the second distance) is reduced, and the above steps are repeated until the initial movement direction is determined.
[0154] After determining the initial moving direction, the focusing lens is started at a preset moving speed and moved 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.
[0155] At the beginning and end of each time interval, images are captured and their sharpness is calculated.
[0156] 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.
[0157] 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 focusing speed and accuracy.
[0158] 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.
[0159] 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.
[0160] During the movement of the focusing lens, the image clarity is continuously monitored. When a decrease in image clarity is detected 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 before and after, it is determined whether there is a decrease in clarity. 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.
[0161] Example 2
[0162] 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:
[0163] The initial movement direction determining module 100 is used to perform bidirectional movement of the focus lens at an initial position according to a preset distance, and determine the initial movement direction of the focus lens according to the image clarity obtained after the bidirectional movement.
[0164] The change rate calculation module 200 is used to adjust the focus lens along the initial moving direction at a preset moving speed and regularly calculate the image clarity change rate.
[0165] The position adjustment module 300 is 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.
[0166] The deceleration module 400 is configured to reduce the moving speed of the focus lens and continue to move the focus lens along the initial moving direction when the image definition change rate is less than a preset threshold.
[0167] The focus alignment module 500 is used to record the position at the previous moment as the optimal focus position and move the focus lens to the optimal focus position when the image clarity is detected to decrease for the first time during the movement of the focus lens.
[0168] 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 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 produce 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 1 A device that provides the functions specified in a block or multiple blocks.
[0169] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable 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 read-only memory (CD-ROM), or other optical disc storage, magnetic disk storage, or magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0170] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
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, represents the preset adjustment factor, and Between 0 and 1.
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 the preset threshold, the moving speed is adjusted again by the adjustment formula to reduce the moving speed, wherein the preset adjustment coefficient The choice should ensure that the movement speed gradually decreases when approaching the best focus position; 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
Focusing method, device and projection equipment
CN107942474A
Stepping step length control method and method for determining stepping step length of stepping motor
CN113747042A