Image capturing device and autofocus method thereof

TWI946353BActive Publication Date: 2026-11-11JUJIA UNITED TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
TW115125612
Authority / Receiving Office
TW · TW
Patent Type
Patents
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-11-11
Estimated Expiration
2046-06-28

Smart Images

  • Figure TWG2TB001921164_001
    Figure TWG2TB001921164_001
  • Figure TWG2TB001921164_002
    Figure TWG2TB001921164_002
  • Figure TWG2TB001921164_003
    Figure TWG2TB001921164_003
Patent Text Reader

Abstract

An autofocus method is applicable to an image capturing device. The autofocus method includes: sequentially receiving a plurality of focus values ​​from a plurality of first frames; and executing an autofocus execution thread in response to the image state of the plurality of first frames being a stable state. The step of executing the autofocus execution thread includes: confirming the focus state of a second frame, wherein the plurality of first frames and the second frame are obtained by sequentially capturing current images from a lens at a current position; performing an autofocus procedure using a local maximum value search method in response to the focus state of the second frame being out of focus; and performing an autofocus procedure using a global maximum value search method in response to the failure of the local maximum value search method.
Need to check novelty before this filing date? Find Prior Art

Claims

1. An autofocus method, comprising: sequentially receiving a plurality of focus values ​​from a plurality of first frames; and, in response to the image state of the plurality of first frames being a stable state, executing an autofocus thread, wherein executing the autofocus thread includes: Confirm the focus state of a second frame, wherein the plurality of first frames and the second frame are obtained by sequentially capturing the current frame at a current position via a lens; in response to the focus state of the second frame being out of focus, perform an autofocus procedure using a local maximum search method; and in response to the failure of the local maximum search method, perform the autofocus procedure using a global maximum search method.

2. The autofocus method as described in claim 1, wherein the image state includes a stable state and a shaky state, and an initial image state is the shaky state; in response to the image state being the shaky state and the difference in focus values ​​corresponding to the first frames of N1 consecutive frames in the plurality of first frames being less than a first threshold, the image state is determined to be the stable state; and in response to the image state being the stable state and the difference in focus values ​​corresponding to the first frames of N2 consecutive frames in the plurality of first frames being greater than a second threshold, the image state is determined to be the shaky state, wherein N2 is less than or equal to N1; wherein... When the autofocus execution thread is in the activated state, the second threshold is the value obtained by dividing the focus value of the first frame of the first frame in the two adjacent frames corresponding to the focus value difference by a first proportional parameter; wherein, when the autofocus execution thread is not activated, the second threshold is the value obtained by dividing the focus value of the first frame of the first frame in the two adjacent frames corresponding to the focus value difference by a second proportional parameter; and wherein the second proportional parameter is greater than or equal to the first proportional parameter.

3. The autofocus method as described in claim 1, wherein the step of executing the autofocus thread further includes: In response to the focus state of the second screen being in focus, a change event in the third screen is detected; And in response to the occurrence of this change event, the local maximum value search method is used to perform the autofocus procedure.

4. The autofocus method as described in claim 3, wherein the step of detecting the change event of the third frame includes: receiving multiple zone focus values ​​of the third frame; reading the overall focus value of the previously successfully focused frame; calculating the overall focus value of the third frame based on the multiple zone focus values ​​of the third frame; and determining that the change event has occurred in response to the difference between the overall focus value of the third frame and the overall focus value of the focused frame being greater than a threshold.

5. The autofocus method as described in claim 3, wherein the step of detecting the change event of the third frame includes: receiving multiple zone focus values ​​of the third frame; reading multiple zone focus values ​​of the previously successfully focused frame; and determining that the change event has occurred in response to any three or more zone focus values ​​between the multiple zone focus values ​​of the third frame and the multiple zone focus values ​​of the focused frame being greater than a threshold.

6. The autofocus method as described in claim 1, wherein the step of performing the autofocus procedure using the local maximum value search method comprises: driving a pair of focus motors to move the lens to a plurality of focus positions according to a dynamic step; receiving focus values ​​of a plurality of third frames, wherein the plurality of third frames are respectively captured by the lens when it is sequentially located at the plurality of focus positions, and each focus value includes a first filter value; and completing the autofocus procedure in response to the difference between the first filter values ​​of two adjacent third frames in the plurality of third frames being less than a first threshold and the difference between the first filter value and a maximum filter value of a later third frame in the two adjacent third frames being less than a second threshold, wherein... The maximum filter value is the maximum value among all the first filter values ​​of all the third frames before the third frame.

7. The autofocus method as described in claim 6, wherein the step of performing the autofocus procedure using the local maximum value search method further comprises: accumulating a number of changes in response to changing the movement direction of the lens; and completing the autofocus procedure in response to the number of changes being greater than a third threshold.

8. The autofocus method as described in claim 6, wherein the dynamic step is one of a coarse step and a fine step, and the step of driving the focus motor to move the lens to the plurality of focus positions according to the dynamic step comprises: driving the focus motor to first move the lens sequentially to at least one of the plurality of focus positions at the coarse step; and in response to the difference between the first filter values ​​of the two adjacent third frames being greater than a third threshold and the first filter value of the last third frame of the plurality of third frames being greater than the first filter value of the penultimate third frame of the plurality of third frames, switching the dynamic step from the coarse step to the fine step, and then driving the focus motor to move the lens sequentially to the remaining of the plurality of focus positions at the fine step.

9. The autofocus method as described in claim 6, wherein the dynamic step is one of a coarse step and a fine step, the first filter value is a low-pass filter value, each of the focus values ​​further includes a high-pass filter value, and the step of driving the focus motor to move the lens to the plurality of focus positions according to the dynamic step comprises: driving the focus motor to move the lens sequentially to at least one of the plurality of focus positions at the coarse step; and in response to the difference between the low-pass filter values ​​of the two adjacent third frames being less than or equal to a third threshold and the difference between the high-pass filter values ​​of the two adjacent third frames being greater than a fourth threshold, switching the dynamic step from the coarse step to the fine step, and then driving the focus motor to move the lens sequentially to the remaining of the plurality of focus positions at the fine step.

10. The autofocus method as described in claim 1, wherein the step of performing the autofocus procedure using the global maximum search method comprises: driving a pair of focusing motors to move the lens to a plurality of focusing positions according to a sampling step; receiving focusing values ​​of a plurality of third frames, wherein the plurality of third frames are captured by the lens when it is located at the plurality of focusing positions respectively; establishing a focusing value distribution model based on the focusing values ​​of the plurality of third frames, and generating an optimal focusing position; driving the focusing motors to move the lens to the optimal focusing position, and receiving the focusing value of the third frame corresponding to the optimal focusing position in the plurality of third frames; and completing the autofocus procedure in response to satisfying a convergence condition.

11. The autofocus method as described in claim 10, wherein the step of performing the autofocus procedure using the global maximum search method further comprises: (a) in response to the failure to meet the convergence condition, adding the focus value of the third frame corresponding to the optimal focus position in the plurality of third frames to a dataset; (b) updating the focus value distribution model and the optimal focus position according to the dataset; (c) driving the focus motor to move the lens to the optimal focus position and receiving the focus value of the third frame corresponding to the optimal focus position in the plurality of third frames; (d) accumulating an iteration number; and (e) repeating steps (a) to (d) until the convergence condition is met.

12. The autofocus method as described in claim 11, wherein the convergence condition is that the difference in focus value between two adjacent third frames in the plurality of third frames is less than 1%.

13. The autofocus method as described in claim 11, wherein the convergence condition is that the number of iterations is greater than 10.

14. An image capturing device, comprising: a lens for focusing an incident light; an image sensor coupled to the lens for sensing the incident light passing through the lens to sequentially generate a plurality of frames; a calculation module coupled to the image sensor for calculating a focus value for each of the frames; a frame state detection module coupled to the calculation module for sequentially receiving a plurality of focus values ​​of a plurality of first frames among the plurality of frames; executing an autofocus thread in response to the frame state of the plurality of first frames being a stable state; and confirming the focus state of a second frame among the plurality of frames, wherein the plurality of first frames and the second frame are obtained by sequentially capturing a current frame at a current position via a lens; A local focusing module, coupled to the image state detection module, is used to perform an autofocus procedure using a local maximum value search method in response to the focusing state of the second image being out of focus; and a global focusing module, coupled to the local focusing module, is used to perform the autofocus procedure using a global maximum value search method in response to the failure of the local maximum value search method.

15. The image capturing apparatus as claimed in claim 14 further comprises: a pair of focusing motors, respectively coupled to the lens, the local focusing module and the global focusing module, the focusing motors being used to drive the lens to adjust a focusing position.

16. The image capturing apparatus as described in claim 15, wherein, The local focusing module is further configured to: drive the focusing motor to move the lens to multiple focusing positions according to a dynamic step; receive focusing values ​​of multiple third frames in the multiple frames, wherein the multiple third frames are captured by the lens when it is respectively located at the multiple focusing positions, and each focusing value includes a first filter value; and complete the autofocus procedure in response to the difference between the first filter values ​​of two adjacent frames of the multiple third frames being less than a first threshold and the difference between the first filter value of the later third frame in the two adjacent frames and a maximum filter value being less than a second threshold, wherein the maximum filter value is the maximum value among all the first filter values ​​of all third frames before the later third frame.

17. The image capturing apparatus as described in claim 15, wherein, The global autofocus module is further configured to: drive the focus motor to move the lens to multiple focus positions according to a sampling step; receive focus values ​​of multiple third frames in the multiple frames, wherein the multiple third frames are captured by the lens when it is located at the multiple focus positions respectively; establish a focus value distribution model based on the focus values ​​of the multiple third frames and generate an optimal focus position; drive the focus motor to move the lens to the optimal focus position and receive the focus value of the third frame corresponding to the optimal focus position in the multiple third frames; and complete the autofocus procedure in response to satisfying a convergence condition.

18. The image capturing apparatus as described in claim 17, wherein, The global autofocus module is further configured to: (a) in response to failure to meet the convergence condition, add the focus value of the third frame corresponding to the optimal focus position in the plurality of third frames to a dataset; (b) update the focus value distribution model and the optimal focus position according to the dataset; (c) drive the focus motor to move the lens to the optimal focus position and receive the focus value of the third frame corresponding to the optimal focus position in the plurality of third frames; (d) accumulate an iteration count; and (e) repeat steps (a) to (d) until the convergence condition is met.

19. The image capturing apparatus as claimed in claim 18, wherein the convergence condition is that the difference in focus value between two adjacent third frames in the plurality of third frames is less than 1%.

20. The image capturing apparatus as described in claim 18, wherein the convergence condition is that the number of iterations is greater than 10.

Citation Information

Patent Citations

  • Automatic focusing method and device, electronic equipment and storage medium

    CN116828302A

  • Lens focusing method based on network camera

    CN119031244A

  • Method for automatically focusing image definition of three-dimensional endoscope camera

    CN119485013A

  • Auto-focus apparatus, image capture apparatus, and auto-focus method

    TW200819894A

  • Image photographing method and device, and movable platform

    WO2023159611A1