Anti-shake auto-focusing control method and device, computing device and storage medium

By using intermittent stepping motion and sliding window fitting, the focus point is determined by the normalized curvature feature ratio, which solves the problems of misjudgment and motion blur in autofocus and achieves efficient and accurate focusing in complex environments.

CN121567960BActive Publication Date: 2026-04-10JIANGSU MUTENGGUANG PRECISION OPTICAL INSTR CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-23
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing autofocus methods are susceptible to ambient light fluctuations and sensor noise, leading to misjudgments and motion blur. Furthermore, they are highly threshold-dependent, making it difficult to handle both high and low contrast scenes, resulting in overshoot or failure to lock on.

Method used

The focusing motor is controlled by intermittent stepping motion, moving during non-exposure time and remaining stationary during exposure time. The sharpness evaluation value is fitted by sliding window least squares method, the normalized curvature feature ratio is calculated, and the end of coarse search is determined by local minimum inflection point. Focusing is achieved by combining coarse search and fine search strategies.

Benefits of technology

It effectively avoids motion blur, improves image clarity and signal-to-noise ratio, reduces the impact of noise interference, and achieves fast, stable, and high-precision autofocus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567960B_ABST
    Figure CN121567960B_ABST
Patent Text Reader

Abstract

The application discloses a kind of anti-shake autofocus control method, device, computing device and storage medium, the method includes: receiving image sensor timing signal, control focusing motor only in the non-exposure time of image movement, keep still in exposure time;In exposure time, image is collected and sharpness evaluation value is calculated;Through sliding window, least square method fitting is carried out to continuous multiple frame sharpness evaluation value, obtains the quadratic term coefficient of each window fitting curve and sharpness average;The characteristic ratio of each window is calculated, and a continuous characteristic ratio sequence is formed;According to the change trend of the sequence, whether local minimum inflection point appears is judged;If yes, it is judged to reach coarse search peak value and end coarse search, enter the fine search stage with the peak value as center, and finally determine image sharpness position.The application eliminates motion blur by timing coordination, and peak value is judged using normalized curvature characteristic trend, so that the speed, accuracy and anti-interference ability of automatic focusing are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of automatic focusing, and particularly relates to an anti-shake automatic focusing control method and device, a computing device and a storage medium. BACKGROUND

[0002] Automatic focusing technology is a key function in imaging devices, and its performance directly affects the sharpness and imaging speed of images. The common automatic focusing methods currently mainly include search strategies based on hill climbing method and its improved schemes, such as judging the focusing direction and finding the peak point by the change trend of sharpness evaluation function.

[0003] In the prior art, CN109739011A discloses an automatic focusing method based on improved hill climbing method, which includes the following steps: 1) algorithm initialization, calculating the initial sharpness evaluation value and average gray scale; 2) evaluating the target image sharpness evaluation value and average gray scale in the current frame and comparing them with those in the last frame; 3) performing improved hill climbing method focusing; 4) performing parabolic fitting on the last three focusing data of the improved hill climbing method, and calculating the horizontal coordinate of the maximum value point as the required focusing point; 5) repeating steps 2) to 4) for the same target, so as to realize continuous automatic focusing for the same target.

[0004] However, this method has two defects of "single criterion" and "lack of time sequence cooperation". On the one hand, the criterion depends on the absolute amplitude drop of the sharpness evaluation value or the open-loop position prediction, which is not only easily affected by environmental light fluctuation and sensor noise interference to cause misjudgment, but also often has the problems of judgment lag or large prediction deviation; on the other hand, it ignores the influence of motor movement on imaging quality, and the motion blur caused by displacement during exposure will "flatten" the peak value of the defocus curve, resulting in loss of high-frequency information.

[0005] CN202010290827 discloses an automatic focusing hill climbing search algorithm based on threshold method and local maximum value, which can directly ignore the local extreme value caused by noise, brightness change and other factors by setting a threshold Value, thereby improving the success rate of focusing; the judgment conditions of the evaluation function in the "uphill", "downhill" and "flat" regions change with the change of the evaluation function value Sm of the last image, and can adaptively change the judgment conditions for images with different contrasts; by introducing the local evaluation function maximum value, the focusing cycle and focusing time are reduced; by setting a fixed moving step of the motor and using |SSm1|<Value*Sm1 or S>Sm1 as the condition for ending focusing, the problem that "even if the step size is reduced to zero, the lens still does not reach the best focusing point" in the traditional automatic focusing hill climbing search algorithm is solved.

[0006] However, this method still has two significant defects: one is that the anti-noise ability is limited, and the burst noise of a single image can easily refresh the local maximum value, leading to the algorithm misjudging as "downhill" and terminating prematurely; the other is that the threshold is highly dependent, and the preset threshold is difficult to consider both high-contrast scenes (which require a large threshold to prevent shaking) and low-contrast scenes (which require a small threshold to be sensitive to identification), resulting in a large overshoot or failure to lock in some scenes. SUMMARY

[0007] To solve the above technical problems, the present application provides an anti-shake automatic focusing control method, device, computing equipment and storage medium.

[0008] To achieve the above purpose, the technical scheme of the present application is as follows:

[0009] In a first aspect, the present application discloses an anti-shake automatic focusing control method, comprising:

[0010] Step S1: receiving the time sequence signal of the image sensor, and controlling the focusing motor to perform intermittent stepping motion;

[0011] Wherein, the focusing motor is controlled to move in the non-exposure time of each frame of image, and to remain stationary in the exposure time of each frame of image;

[0012] Step S2: collecting image data in the exposure time, and evaluating the sharpness of the collected image data through the image sharpness algorithm to obtain the sharpness evaluation value of each frame of image;

[0013] Step S3: setting a sliding window, performing least squares curve fitting on the sharpness evaluation values of the continuous multiple frames of image in the window, and respectively obtaining the quadratic term coefficient a of the fitting curve corresponding to each window and the average value S mean of the sharpness evaluation values in the window;

[0014] Step S4: based on the quadratic term coefficient a and the average value S mean of each window obtained in step S3, calculating the feature ratio R = a / S mean corresponding to each window to obtain a continuous feature ratio sequence;

[0015] Step S5: according to the change trend of the continuous feature ratio sequence obtained in step S4, judging whether a local minimum value inflection point appears;

[0016] If yes, it is determined that the coarse search peak value has been reached, and the coarse search is ended and the fine search stage is entered;

[0017] Otherwise, continue to perform coarse search.

[0018] On the basis of the above technical scheme, the following improvements can also be made:

[0019] As a preferred solution, the size of the sliding window is 3-9 image frames.

[0020] As a preferred solution, step S5 comprises:

[0021] From the continuous feature ratio sequence, a plurality of time-sequentially continuous feature ratios are obtained; based on the variation trend of the plurality of feature ratios, it is determined whether a local minimum value inflection point occurs;

[0022] The determination condition of the local minimum value inflection point comprises: the quadratic term coefficient a of the fitting curve of the sliding window corresponding to the current feature ratio is less than 0, and the current feature ratio is less than the previous feature ratio and the next feature ratio.

[0023] As a preferred solution, the fine search stage comprises: taking the position corresponding to the coarse search peak value as the center, searching in a pre-defined neighborhood range to find the maximum point of the definition evaluation value as the fine search peak value, and determining the position corresponding to the fine search peak value as the image definition position.

[0024] In a second aspect, the present application discloses an anti-shake automatic focusing control device, comprising:

[0025] A time sequence control module is configured to receive a time sequence signal of the image sensor and control the focusing motor to perform intermittent stepping motion;

[0026] The focusing motor is controlled to move in the non-exposure time of each image frame and remain stationary in the exposure time of each image frame;

[0027] A data acquisition module is configured to acquire image data in the exposure time and evaluate the definition of the acquired image data by an image definition algorithm to obtain the definition evaluation value of each image frame;

[0028] A fitting calculation module is configured to set a sliding window, perform least square curve fitting on the definition evaluation values of the continuous multiple image frames in the window, and obtain the quadratic term coefficient a of the fitting curve corresponding to each window and the average value S of the definition evaluation values in the window, respectively. mean ;

[0029] A feature calculation module is configured to calculate the feature ratio R corresponding to each window based on the quadratic term coefficient a and the average value S of each window obtained by the fitting calculation module, calculate the feature ratio R = a / S, and obtain a continuous feature ratio sequence. mean mean

[0030] A trend determination module is configured to determine whether a local minimum value inflection point occurs according to the variation trend of the continuous feature ratio sequence obtained by the feature calculation module.

[0031] If yes, it is determined that the coarse search peak value has been reached, the coarse search is ended, and a fine search stage is entered.​​

[0032] Otherwise, continue with the coarse search.

[0033] As a preferred solution, in the fitting calculation module, the size of the sliding window is 3-9 image frames.

[0034] As a preferred solution, the trend determination module is configured to perform the following:

[0035] From the continuous feature ratio sequence, a plurality of time-sequentially continuous feature ratios are obtained; based on the change trend of the plurality of feature ratios, it is determined whether a local minimum value inflection point occurs;

[0036] The judgment condition of the local minimum value inflection point includes: the quadratic term coefficient a of the fitting curve of the sliding window corresponding to the current feature ratio is less than 0, and the current feature ratio is less than the previous feature ratio and the next feature ratio.

[0037] As a preferred solution, it further includes a fine search module, the fine search module is configured to perform a fine search phase, including: searching in a predefined neighborhood range centered on the position corresponding to the coarse search peak value to find the maximum value point of the sharpness evaluation value as the fine search peak value, and determining the position corresponding to the fine search peak value as the image sharpness position.

[0038] In a third aspect, the present application discloses a computing device, comprising:

[0039] One or more processors;

[0040] Memory;

[0041] And one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions of any of the above anti-shake autofocus control methods.

[0042] In a fourth aspect, the present application discloses a storage medium, the storage medium stores one or more computer-readable programs, and the one or more programs include instructions suitable for being loaded by the memory and executing any of the above anti-shake autofocus control methods.

[0043] The present application discloses an anti-shake autofocus control method, device, computing device and storage medium, which has the following beneficial effects:

[0044] Firstly, by controlling the focusing motor to move only in the non-exposure time of the image and to remain stationary in the exposure time, the image blur problem caused by the motor movement is fundamentally avoided, so that clearer and higher signal-to-noise ratio image data is obtained, providing reliable input for subsequent sharpness evaluation.

[0045] Second, by using a sliding window to fit the definition of a plurality of consecutive frames of the value of the least squares method, and calculate the normalized curvature feature ratio, the focus on the basis of change from a single point or absolute threshold, to the curve shape trend analysis. This method can effectively smooth the sensor noise, avoid the dependence on a single frame of definition value, significantly reduce the influence of image noise, light fluctuations and other interference on the judgment process, improve the adaptability of the system in complex environment.

[0046] Third, the use of normalized curvature feature ratio sequence of local minimum inflection point as the end of the search criteria, can be sensitive, accurate capture of the most acute moment of defocus curve. This method of lag small, can stop the rough search, significantly reduce the overshoot, for the subsequent search provides a more accurate center starting point, thus speeding up the overall focus speed.

[0047] Fourth, the present application uses a "rough search, then fine search" two-stage strategy, and in the rough search stage, the above anti-shake acquisition and intelligent trend judgment are integrated, realizing the fast positioning of the focusing area. Then in the fine search stage, fine search is carried out near the rough search peak value with small step length, and finally the clear image position is found. The process design is scientific, which greatly improves the focusing efficiency while ensuring the final focusing accuracy.

[0048] In summary, the present application effectively solves the problems of evaluation distortion caused by motion blur in traditional automatic focusing, and misjudgment and overshoot caused by non-robust criteria, and realizes fast, stable and high-precision automatic focusing in various complex environments. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0050] Figure 1 The flow chart of the anti-shake automatic focusing control method provided by the embodiments of the present application.

[0051] Figure 2 The schematic diagram of the focusing motor movement provided by the embodiments of the present application.

[0052] Figure 3 The example diagram of the feature ratio (R1, R2, R3) provided by the embodiments of the present application.

[0053] Figure 4 The curve diagram of the definition evaluation score provided by the embodiments of the present application.

[0054] Figure 5 A rough search and a fine search flowchart are provided for the embodiments of the present application. DETAILED DESCRIPTION

[0055] The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0056] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0057] The ordinal numbers “first”, “second”, “third” and the like are used to describe common objects only to indicate different instances of similar objects, and are not intended to imply that the objects thus described must have a given order in time, space, sequence or in any other way.

[0058] In addition, the expression “including” the element is an “open” expression, which only means that the corresponding component or step exists, and should not be interpreted as excluding additional components or steps.

[0059] To achieve the purpose of the present application, as shown in some embodiments of the anti-shake autofocus control method, device, computing equipment and storage medium, Figure 1 The anti-shake autofocus control method includes the following steps:

[0060] Step S101: receiving a timing signal of an image sensor, and controlling a focusing motor to perform intermittent stepping motion;

[0061] Wherein, the focusing motor is controlled to move in the non-exposure time of each frame of image, and to remain stationary in the exposure time of each frame of image;

[0062] Step S102: collecting image data in the exposure time, and evaluating the collected image data by an image sharpness algorithm to obtain a sharpness evaluation value of each frame of image;

[0063] Step S103: setting a sliding window, performing least square curve fitting on the sharpness evaluation values of the continuous multiple frames of image in the window, and respectively obtaining a quadratic term coefficient a of the fitting curve corresponding to each window and an average value S mean of the sharpness evaluation values in the window;

[0064] Step S104: based on the quadratic term coefficient a and the average value S mean of each window obtained in step S3, calculating a feature ratio R=a / S corresponding to each window.mean , obtain a continuous feature ratio sequence;

[0065] Step S105: According to the change trend of the continuous feature ratio sequence obtained in step S4, it is judged whether a local minimum value inflection point appears;

[0066] If yes, it is determined that the coarse search peak value has been reached, and the coarse search is ended and the fine search stage is entered;

[0067] Otherwise, the coarse search is continued.

[0068] The above steps will be described in detail below.

[0069] Step S101 is a motor motion control step in time coordination.

[0070] As shown in Figure 2 , when the exposure time is detected to start, the focusing motor remains absolutely stationary, ensuring that there is no movement of the lens position during the entire exposure period, so that a clear image without motion blur is collected. After the exposure is over, enter the blanking time, and the focusing motor moves quickly at a preset coarse search step. This intermittent stepping mode runs through the entire focusing process, ensuring the stability of each input image from the source.

[0071] Step S102 is an image acquisition and sharpness evaluation step.

[0072] During the exposure period of each image, a complete image data is collected. Then, the frame of image data is preprocessed (such as noise reduction filtering), and the sharpness evaluation algorithm is called to evaluate the sharpness, and the sharpness evaluation value S i (i) representing the sharpness of the frame of image is output.

[0073] Step S103 is a sliding window fitting step.

[0074] First, a sliding window with a size of 6 frames of images is set (in actual application, the window size can be 3-9 frames).

[0075] Then, as the sharpness evaluation values of new image frames continuously enter the queue, the window continuously slides backward. After each sliding, the least square method is used to fit a quadratic curve to the 6 continuous sharpness evaluation value sequence [S i , S i+1 ,..., S i+5 ] in the window, and the fitting equation f i (x) = a i x 2 + b i x + c iMeanwhile, the arithmetic mean S of the 6 sharpness values in the window is calculated mean_i . Thus, each window generates a pair of key feature parameters: the quadratic coefficient a i and the mean S mean_i .

[0076] The quadratic coefficient a i represents the opening direction and opening size (i.e. the sharpness of the wave crest).

[0077] Step S104 is a normalization curvature feature value sequence generation step.

[0078] For each window feature parameter obtained in step S100, its feature ratio (i.e. normalized curvature feature value) R i is calculated:

[0079] R i = a i / S mean_i ;

[0080] This feature ratio eliminates the influence of absolute brightness on the evaluation value base in different scenes, and the negative value size directly reflects the sharpness (or flatness) of the defocus curve in the window area. As the search proceeds, a continuous feature value sequence [R1, R2, R3,...] is obtained, which is arranged in time (or position) sequence.

[0081] Step S105 is a trend inflection point-based coarse search peak value determination step.

[0082] Three continuous feature values, for example: R k-1 , R k , R k+1 (corresponding to the kth sliding window), are monitored. The determination logic is as follows:

[0083] Check whether the quadratic coefficient a k of the window corresponding to R k is less than 0. If a k >=0, it indicates that the curve opens upward or is a straight line, and no peak region is detected, and the coarse search continues.

[0084] If a k < 0, further compare the size relationship of R k and its adjacent values before and after it.

[0085] When R k < R k-1 and R k < R k+1 are simultaneously satisfied, it is determined that R kA local minimum inflection point. This means that the lens has just crossed the steepest falling edge of the defocus curve, and the corresponding lens position is the adjacent point of the coarse search peak position.

[0086] In the actual operation of the autofocus control method, the relationship between the sharpness evaluation score and the focusing position is as shown in Figure 4 . In the figure, the horizontal axis represents the focusing position, and the vertical axis represents the sharpness evaluation value calculated by collecting an image at the position. The overall curve of the figure presents a downward-opening quadratic curve, and the peak value corresponds to the theoretically optimal focusing position. In the coarse search stage, the motor moves step by step in the "coarse search range" with a set "coarse search step length". After reaching each position and collecting an image during the exposure still period, a sharpness evaluation value is calculated, and the R k-1 , R k , and R k+1 in the figure represent the normalized curvature characteristic values of the corresponding positions fitted by the previous consecutive 3-9 frame image scores and positions, respectively. When R k <R k-1 and R k <R k+1 , it means that the corresponding axis position of R k is the position of the maximum image sharpness evaluation score, i.e., the end point of the coarse search.

[0087] As shown in Figure 5 , once the above conditions are met, the coarse search motion is stopped, and the position of the coarse search peak is recorded, and the fine search stage is entered. The fine search stage is as follows: taking the determined coarse search peak position as the center, within a small predefined neighborhood (e.g., a range corresponding to ±2 times the coarse search step length) before and after it, the fine search is started.

[0088] In the fine search, the focusing motor movement step length can be adjusted to a smaller fine search step length. The goal of the fine search is no longer to find the inflection point of the R value, but to directly find the maximum value point of the sharpness evaluation value within this small range. Move step by step within the predefined neighborhood with the fine search step length, collect images and calculate the sharpness evaluation value. When a continuous decrease (i.e., "downhill") in the sharpness evaluation value is detected, it is considered that the peak has passed, and the previous position (i.e., the maximum value point of the sharpness evaluation value) is determined as the fine search peak, i.e., the final optimal focusing position.

[0089] A specific example is shown in Figure 3 , in which the first 9 consecutive images are collected, and the corresponding sharpness evaluation values are calculated as S1, S2, S3, S4, S5, S6, S7, S8, and S9, respectively. The sliding window size N is set to 6.

[0090] The sliding window at the first position Pos1: the window contains data [S1, S2, S3, S4, S5, S6]. The least square quadratic curve fitting is performed on the 6 sharpness evaluation values to obtain the first fitting equation: f1(x) = a1x 2 + b1x + c1. Meanwhile, the arithmetic mean S mean_1 = (S1+S2+S3+S4+S5+S6) / 6 of the sharpness evaluation values in the window is calculated.

[0091] Subsequently, the normalized curvature eigenvalue of the first window is calculated: R1 = a1 / S mean_1 .

[0092] The sliding window at the second position Pos2: the window slides forward by one frame, containing data [S2, S3, S4, S5, S6, S7]. The same fitting operation is performed to obtain the second fitting equation: f2(x) = a2x 2 + b2x + c2, and the mean S mean_2 is calculated.

[0093] Then the second eigenvalue is calculated: R2 = a2 / S mean_2 .

[0094] The sliding window at the third position Pos3: the window slides forward by one frame, containing data [S3, S4, S5, S6, S7, S8]. The same fitting operation is performed to obtain the second fitting equation: f3(x) = a3x 2 + b3x + c3, and the mean S mean_3 is calculated.

[0095] Then the third eigenvalue is calculated: R3 = a3 / S mean_3 .

[0096] Up to now, the time (position) sequence continuous eigenvalue sequence [R1, R2, R3,...] is obtained, which is used for subsequent trend judgment.

[0097] When a6 < 0, R6 < R5 and R6 < R7, it is determined that a local minimum value inflection point appears at R6. This means that near the window position corresponding to R6, the sharpness evaluation value curve not only presents an inverted parabolic shape (a6 < 0), but also its normalized curvature feature reaches a locally sharpest negative extreme point. Accordingly, it is determined that the lens has crossed the coarse search peak value region, immediately stops the coarse search, and records the coarse search peak value position.

[0098] Compared with CN109739011A mentioned in the background art, the application innovatively establishes an "exposure avoidance" timing mechanism, forces the motor to perform stepping and setting only during the non-exposure time of the camera, eliminates motion blur from the source, and ensures extremely high sharpness and signal-to-noise ratio of the input data. At the same time, the application uses the local inflection point of the normalized curvature eigenvalue (R=a / S mean ) to replace the traditional numerical threshold. This method effectively smooths noise using least squares fitting, eliminates light interference through normalization, and accurately locks the sharpest moment of the defocus curve shape using the R value trend under high-fidelity data. It realizes fast focusing with zero overshoot, high robustness and millisecond-level response in complex scenes.

[0099] Compared with CN202010290827 mentioned in the background art, the application uses least squares fitting to replace single-point comparison, effectively smooths sensor noise using statistical characteristics of multi-point data, and avoids false actions caused by single-point noise; The trend reversal of the normalized curvature eigenvalue R is used as the end condition, replacing the traditional absolute numerical decrease threshold. This eigenvalue eliminates the influence of environmental brightness base, can more accurately and adaptively locate the shape vertex of the defocus curve, and significantly reduces the overshoot stroke in the coarse search stage while ensuring search accuracy.

[0100] In some other embodiments, the application discloses an anti-shake autofocus control device, comprising:

[0101] a timing control module for receiving timing signals of an image sensor and controlling the focusing motor to perform intermittent stepping motion;

[0102] wherein the focusing motor moves during the non-exposure time of each frame of image and remains stationary during the exposure time of each frame of image;

[0103] a data acquisition module for acquiring image data during the exposure time and evaluating the acquired image data for sharpness using an image sharpness algorithm to obtain a sharpness evaluation value for each frame of image;

[0104] a fitting calculation module for setting a sliding window, performing least squares curve fitting on the sharpness evaluation values of consecutive multiple frames of image in the window, and obtaining a quadratic term coefficient a and an average value S mean of the sharpness evaluation values in each window, respectively;

[0105] a feature calculation module for calculating a feature ratio R=a / S mean of each window based on the quadratic term coefficient a and the average value S mean of each window obtained by the fitting calculation module, and obtaining a continuous feature ratio sequence;

[0106] a trend determination module configured to determine whether a local minimum inflection point occurs according to a change trend of the continuous feature ratio sequence obtained by the feature calculation module;

[0107] If yes, it is determined that the coarse search peak value is reached, and the coarse search is ended and the fine search stage is entered.

[0108] Otherwise, the coarse search is continued.

[0109] Further, in the fitting calculation module, the size of the sliding window is 3-9 image frames.

[0110] Further, the trend determination module is configured to perform the following:

[0111] From the continuous feature ratio sequence, a plurality of feature ratios in time sequence are obtained; and whether a local minimum inflection point occurs is determined based on a change trend of the plurality of feature ratios.

[0112] The judgment condition of the local minimum inflection point includes that a quadratic term coefficient a of a fitting curve of a sliding window corresponding to a current feature ratio is less than 0, and the current feature ratio is less than a previous feature ratio and a next feature ratio.

[0113] Further, the fine search module is configured to perform the fine search stage, including: searching in a predefined neighborhood range centered on a position corresponding to the coarse search peak value to find a maximum point of the definition evaluation value as a fine search peak value, and determining a position corresponding to the fine search peak value as the image definition position.

[0114] Further, it needs to be noted that the anti-shake automatic focusing control device provided in the above embodiments only takes the division of the above functional modules as an example when performing automatic focusing, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the anti-shake automatic focusing control device is divided into different functional modules to complete all or part of the above described functions.

[0115] In addition, the anti-shake automatic focusing control device and the anti-shake automatic focusing control method provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0116] In some other embodiments, the present application discloses a computing device, comprising:

[0117] one or more processors;

[0118] a memory;

[0119] and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions of any of the above anti-shake auto-focusing control methods.

[0120] In some other embodiments, the present application discloses a storage medium, which stores one or more computer-readable programs, and the one or more programs include instructions suitable for being loaded by a memory and performing any of the above anti-shake auto-focusing control methods.

[0121] The present application discloses an anti-shake auto-focusing control method, device, computing equipment and storage medium, which has the following beneficial effects:

[0122] Firstly, by controlling the focusing motor to move only in the non-exposure time of the image and to remain stationary in the exposure time, the image blur problem caused by motor movement is fundamentally avoided, so that clearer and higher signal-to-noise ratio image data is obtained, providing reliable input for subsequent sharpness evaluation.

[0123] Secondly, by using a sliding window to perform least squares fitting on the sharpness evaluation values of continuous multiple frames and calculating a normalized curvature feature ratio, the focusing judgment basis is changed from a single point or an absolute threshold to the analysis of the change trend of the curve shape. This method can effectively smooth the sensor noise, avoid the dependence on single-frame sharpness value, significantly reduce the influence of image noise, illumination fluctuation and other interference on the judgment process, and improve the adaptability of the system in complex environments.

[0124] Thirdly, using the local minimum inflection point of the normalized curvature feature ratio sequence as the criterion for ending the coarse search, the most sharp moment of the defocus curve can be sharply and accurately captured. This method has small judgment lag, can stop the coarse search in time, significantly reduces the overshoot stroke, and provides a more accurate center starting point for subsequent fine search, thereby accelerating the focusing speed as a whole.

[0125] Fourthly, the present application adopts a two-stage strategy of "coarse search first and then fine search", and combines the above anti-shake acquisition and intelligent trend judgment in the coarse search stage, realizing rapid positioning of the focusing area. Then, in the fine search stage, fine search is performed near the coarse search peak value with small step size, and finally the clear image position is found. This process design is scientific, which greatly improves the focusing efficiency while ensuring the final focusing accuracy.

[0126] In summary, the present application effectively solves the evaluation distortion caused by motion blur in traditional auto-focusing, and the misjudgment and overshoot caused by non-robust criteria, and realizes fast, stable and high-precision auto-focusing in various complex environments.

[0127] The above shows and describes the basic principles and main features of the present application and the advantages of the present application, and those skilled in the art should understand that the present application is not limited to the above embodiments, and the above embodiments and descriptions in the specification are only to illustrate the principles of the present application, and various changes and improvements can be made to the present application without departing from the spirit and scope of the present application, and these changes and improvements all fall within the scope of the claimed present application, and the scope of protection of the present application is defined by the appended claims and their equivalents.

Claims

1. An image-stabilized autofocus control method, characterized in that, include: Step S1: Receive the timing signal from the image sensor and control the focusing motor to perform intermittent stepping motion; The focusing motor is controlled to move during the non-exposure time of each frame of image and remain stationary during the exposure time of each frame of image. Step S2: Acquire image data within the exposure time, and evaluate the sharpness of the acquired image data using an image sharpness algorithm to obtain a sharpness evaluation value for each frame of the image; Step S3: Set a sliding window, perform least squares curve fitting on the sharpness evaluation values ​​of multiple consecutive frames within the window, and obtain the quadratic coefficient 'a' of the fitted curve and the average sharpness evaluation value 'S' within the window for each window. mean ; Step S4: Based on the quadratic term coefficients a and average values ​​S of each window obtained in step S3. mean Calculate the feature ratio R = a / S corresponding to each window. mean To obtain a continuous sequence of feature ratios; Step S5: From the continuous feature ratio sequence obtained in step S4, obtain multiple feature ratios that are sequentially continuous; based on the changing trend of the multiple feature ratios, determine whether a local minimum inflection point has occurred. The criteria for determining the inflection point of the local minimum include: the coefficient a of the quadratic term of the fitting curve of the sliding window corresponding to the current feature ratio is less than 0, and the current feature ratio is less than its previous feature ratio and its next feature ratio. If so, it is determined that the coarse search peak has been reached, the coarse search ends and the fine search stage begins; The fine search stage includes: taking the position corresponding to the coarse search peak as the center, searching within a predefined neighborhood range, finding the maximum value of the sharpness evaluation value as the fine search peak, and determining the position corresponding to the fine search peak as the image sharpness position; Otherwise, continue with a coarse search.

2. The autofocus control method according to claim 1, characterized in that, The sliding window is 3-9 frames in size.

3. An image-stabilized autofocus control device, characterized in that, include: The timing control module is used to receive timing signals from the image sensor and control the focusing motor to perform intermittent stepping motion. The focusing motor is controlled to move during the non-exposure time of each frame of image and remain stationary during the exposure time of each frame of image. The data acquisition module is used to acquire image data within the exposure time and evaluate the sharpness of the acquired image data using an image sharpness algorithm to obtain a sharpness evaluation value for each frame of the image. The fitting calculation module is used to set a sliding window, perform least squares curve fitting on the sharpness evaluation values ​​of multiple consecutive frames within the window, and obtain the quadratic coefficient 'a' of the fitted curve and the average sharpness evaluation value S within the window for each window. mean ; The feature calculation module is used to calculate the quadratic coefficients a and average values ​​S of each window based on the fitting calculation module. mean Calculate the feature ratio R = a / S corresponding to each window. mean To obtain a continuous sequence of feature ratios; The trend determination module is used to obtain multiple feature ratios that are sequentially continuous from the continuous feature ratio sequence obtained by the feature calculation module; and to determine whether a local minimum inflection point has occurred based on the changing trend of the multiple feature ratios. The criteria for determining the inflection point of the local minimum include: the coefficient a of the quadratic term of the fitting curve of the sliding window corresponding to the current feature ratio is less than 0, and the current feature ratio is less than its previous feature ratio and its next feature ratio. If so, it is determined that the peak of the coarse search has been reached, the coarse search ends, and the method in the fine search module is executed; Otherwise, continue with a coarse search; The fine search module is used to perform the fine search stage, including: taking the position corresponding to the coarse search peak as the center, searching within a predefined neighborhood range, finding the maximum value of the sharpness evaluation value as the fine search peak, and determining the position corresponding to the fine search peak as the image sharpness position.

4. The autofocus control device according to claim 3, characterized in that, In the fitting calculation module, the sliding window is 3-9 frames in size.

5. A computing device, characterized in that, include: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include instructions for the image stabilization autofocus control method as described in claim 1 or 2 above.

6. A storage medium, characterized in that, The storage medium stores one or more computer-readable programs, the programs including instructions adapted to be loaded by a memory and executed as described in claim 1 or 2.

Citation Information

Patent Citations

  • Automatic focusing method based on improved hill climbing method

    CN109739011A

  • An autofocus hill-climbing search method based on thresholding and local maxima

    CN111432129B

  • Automatic focusing method for camera

    CN107179645A

  • Automatic focusing method and device for image sharpness curve fitting based on least square method

    CN109005340A