Imaging device, autofocus control device and method thereof

The autofocus control method in imaging devices enhances accuracy and speed by calculating focus lens movement based on contrast values and acceleration/deceleration processes, addressing the reliance on user skill in conventional systems.

JP7818663B1Active Publication Date: 2026-02-20ACUTELOGIC
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
JP2024158492
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2026-02-20
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

Conventional autofocus systems in imaging devices suffer from reduced accuracy and speed due to inappropriate setting of focus lens movement, relying heavily on the experience and skill of the adjuster, and require complex calculation conditions.

Method used

An autofocus control method that calculates the movement amount of the focus lens by generating image data at each lens position, determining contrast values, and using acceleration/deceleration processes to find the in-focus position, independent of the adjuster's skill, by calculating extreme values and determining the next movement amount between maximum and minimum values.

Benefits of technology

Improves autofocus accuracy and speed by quantitatively setting the focus lens movement, reducing reliance on user experience and skill, and optimizing the focus adjustment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007818663000001_ABST
    Figure 0007818663000001_ABST
Patent Text Reader

Abstract

An imaging device, an autofocus control device and a method thereof are provided. [Solution] The focus lens of the imaging device is moved based on the current movement amount, and image data for each lens position is generated while the focus lens is moving. The contrast value within the autofocus evaluation area of ​​the image data for each lens position is obtained, and an autofocus evaluation value is calculated based on the contrast value. It is determined whether a peak value has appeared among the multiple autofocus evaluation values. If a peak value has appeared, focusing is performed. If a peak value has not appeared, the extreme value of the movement amount is calculated, an acceleration / deceleration determination process is performed, and the next movement amount of the focus lens is determined. The focus lens is moved based on the next movement amount until autofocus is completed, and image data for each lens position is generated while the focus lens is moving, and the contrast value is obtained, the autofocus evaluation value is calculated, and the peak value determination is performed again.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present application relates to the field of focusing in imaging, and in particular to an imaging device and an autofocus control device and method therefor. [Background technology]

[0002] Cameras, mobile phones with integrated imaging functions, and other imaging devices typically have autofocus capabilities. Autofocus utilizes the principle of light reflection from the subject. Light reflected from the subject is received by the imaging device (e.g., a CCD / CMOS sensor) of the camera or other imaging device, processed by a computer, and causes an electric focus control device to achieve focus. In contrast-based autofocus, the accuracy and speed of autofocus can be reduced if the focus lens movement amount is not set appropriately. Furthermore, conventional autofocus systems have required complex calculation conditions for the focus lens movement amount, which means that the quality of focus depends on the experience and skill of the adjuster, making autofocus unrealistic. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2002-122776 [Patent Document 2] Japanese Patent Application Laid-Open No. 2005-156971 [Patent Document 3] Japanese Patent Application Laid-Open No. 2012-13944 Summary of the Invention

[0004] In view of the above, the present application provides an imaging device, an autofocus control device and a method thereof, which can improve the accuracy and speed of autofocus by appropriately setting the amount of movement of the focus lens, and achieve quantitative adjustment that is not dependent on the experience or skill of the adjuster.

[0005] In a first aspect, an embodiment of the present application provides an autofocus control method, the autofocus control method being applied to an imaging device including an optical lens, the optical lens including a focus lens and an imaging lens, and the autofocus control method comprising: moving the focus lens based on a current movement amount along an optical axis direction of the optical lens, and generating image data for each lens position while the focus lens is moving; Obtaining a contrast value within an autofocus evaluation area of ​​image data for each lens position; Calculating an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​the image data for each lens position; determining whether a peak value appears among autofocus evaluation values ​​within an autofocus evaluation area of ​​image data of each frame among a plurality of frames of image data; When the peak value appears, the in-focus position of the focus lens is determined, and the focus lens is controlled to move to the in-focus position to complete the focusing; If no peak value appears, Calculating extreme values ​​of the movement amount, where calculating the extreme values ​​of the movement amount includes calculating a maximum movement amount and a minimum movement amount; Performing an acceleration / deceleration determination process, in which the next movement amount of the focus lens is determined by the acceleration / deceleration determination process, and the next movement amount is between the maximum movement amount and the minimum movement amount; determining the in-focus position of the focus lens, and controlling the focus lens to move to the in-focus position until focusing is completed, moving the focus lens based on the determined next movement amount, generating image data for each lens position while the focus lens is moving, and again acquiring the contrast value, calculating the autofocus evaluation value, and determining the peak value; Includes:

[0006] According to the first aspect of the present invention, when the autofocus control method determines that the peak value has not been reached, it calculates the extreme value of the movement amount and performs an acceleration / deceleration determination process. Calculating the extreme value of the movement amount includes calculating the maximum movement amount and the minimum movement amount. The acceleration / deceleration determination process determines the next movement amount of the focus lens, which is between the maximum movement amount and the minimum movement amount. In contrast-based autofocus, the accuracy and speed of autofocus are improved by appropriately setting the movement amount of the focus lens. In the process of calculating the movement amount of the focus lens in the acceleration / deceleration process, the determination conditions for the acceleration / deceleration process are organized to achieve quantitative adjustment that is not dependent on the experience and skill of the adjuster.

[0007] In a second aspect, the present embodiment provides an imaging device comprising a memory and a computer program stored in the memory and executable by a processor, the computer program executing the computer program to perform the processes of the autofocus control method according to the first aspect.

[0008] In a third aspect, the present embodiment provides a computer-readable storage medium having a computer program stored therein, the computer program being adapted to implement the process of the auto-focus control method according to the first aspect when executed by a processor.

[0009] The beneficial effects of the imaging device according to the second aspect and the computer-readable storage medium according to the third aspect of the present application can be understood from the description of the beneficial effects of the autofocus control method according to the first aspect described above, and therefore will not be repeated here.

[0010] In a fourth aspect, an embodiment of the present application provides an imaging device, the imaging device comprising an optical lens, an imaging element, a memory, and a processor. the optical lens includes a focus lens, an imaging lens, and a focus adjustment mechanism, the focus lens is disposed corresponding to the imaging lens and is connected to the focus adjustment mechanism, and the focus adjustment mechanism is configured to move the focus lens along an optical axis direction of the optical lens based on a current movement amount; the imaging element is configured to convert light from the subject image into an image signal while the optical lens is moving, and to generate image data corresponding to each lens position of the focus lens; The memory stores computer programs, The processor is configured to execute a computer program to perform the following processes: Execute a contrast value calculation process, which is used to obtain a contrast value within an autofocus evaluation area of ​​the image data for each lens position; executing an autofocus evaluation value calculation process, the autofocus evaluation value calculation process being used to calculate an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​the image data for each lens position; An autofocus processing process is executed, and the autofocus processing process is used to determine whether a peak value appears among the autofocus evaluation values ​​in the autofocus evaluation area of ​​the image data of each frame of the image data of the plurality of frames. If a peak value appears, the focus position of the focus lens is determined, and the focus lens is controlled to move to the focus position to complete focusing. If a peak value does not appear, the following process is executed, namely: calculating extreme values ​​of the amount of movement, the calculating the extreme values ​​of the amount of movement including calculating a maximum amount of movement and a minimum amount of movement; An acceleration / deceleration determination process is performed, and the next movement amount of the focus lens is determined through the acceleration / deceleration determination process, and the next movement amount is between the maximum movement amount and the minimum movement amount; The in-focus position of the focus lens is determined, and the focus lens is controlled to move to the in-focus position until focusing is completed. The focus lens is moved based on the determined next movement amount, image data is generated for each lens position while the focus lens is moving, and the acquisition of the contrast value, the calculation of the autofocus evaluation value, and the determination of the peak value are performed again.

[0011] The beneficial effects of the imaging device according to the fourth aspect of the present application can be understood by referring to the description of the beneficial effects of the autofocus control method according to the first aspect, and therefore will not be repeated here.

[0012] In a fifth aspect, the present embodiment provides an autofocus control device, which includes a scan control module, a contrast value calculation module, an autofocus evaluation value determination module, a peak value determination module, a focus control module, a movement amount determination module, and an acceleration / deceleration determination module. the scan control module is configured to move the focus lens along the optical axis direction of the optical lens based on a current movement amount, and generate image data for each lens position during the movement of the focus lens; the contrast value calculation module is configured to determine a contrast value within an autofocus evaluation area of ​​the image data for each lens position; The autofocus evaluation value determination module is configured to calculate an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​the image data for each lens position. the peak value determination module is configured to determine whether a peak value appears among autofocus evaluation values ​​within an autofocus evaluation area of ​​image data of each frame among the image data of the plurality of frames; the focus control module is configured to determine a focus position of the focus lens when the peak value appears, and control the focus lens to move to the focus position to complete focusing; The movement amount determination module is configured to calculate extreme values ​​of the movement amount when the peak value does not appear, and calculating the extreme values ​​of the movement amount includes calculating a maximum movement amount and a minimum movement amount; The acceleration / deceleration determination module is configured to perform an acceleration / deceleration determination process when the peak value does not appear, and determine the next movement amount of the focus lens through the acceleration / deceleration determination process, where the next movement amount is between the maximum movement amount and the minimum movement amount; The scan control module is configured to move the focus lens based on the determined next movement amount to generate image data for each lens position while the focus lens is moving, and during this period the contrast value calculation module is configured to calculate the contrast value again, the autofocus evaluation value determination module is configured to calculate the autofocus evaluation value again, and the peak value determination module is configured to determine the peak value again, and after determining the focus position of the focus lens, the focus control module is further configured to control the focus lens to move to the focus position to complete focusing.

[0013] The beneficial effects of the imaging device according to the fifth aspect of the present application can be understood by referring to the description of the beneficial effects of the autofocus control method according to the first aspect, and therefore will not be repeated here. [Brief explanation of the drawings]

[0014] In order to more clearly describe the technical solutions of the embodiments of the present application or the prior art, the following briefly introduces the drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings from these drawings without creative efforts. [Figure 1] 1 is a schematic diagram of a module of an imaging device according to an embodiment of the present application; [Figure 2] 1 is a schematic diagram illustrating image processing, autofocus, and face detection performed by an imaging device according to an embodiment of the present application; [Figure 3] 1 is a flowchart of an auto-focus control method according to an embodiment of the present application. [Figure 4] FIG. 10 is a schematic diagram showing a specific flow of S37 according to an embodiment of the present application. [Figure 5] FIG. 10 is a schematic diagram showing a specific flow of S372 according to an embodiment of the present application. [Figure 6] FIG. 2 is a schematic diagram of parameters related to autofocus according to an embodiment of the present application; [Figure 7] 10 shows an example of scan data of autofocus evaluation values ​​for a subject with low brightness and low contrast. [Figure 8] This example shows that an autofocus evaluation value is obtained for a low-contrast subject when the position of the focus lens is fixed. [Figure 9] 10A and 10B are diagrams for explaining a method for calculating the minimum movement amount when the focus lens is away from the in-focus position. [Figure 10] 10A and 10B are diagrams for explaining a method for calculating the minimum movement amount when the focus lens is considerably far from the in-focus position. [Figure 11] 10A and 10B are diagrams for explaining a method for calculating the minimum movement amount when the focus lens is near the peak position. [Figure 12] FIG. 3 is a schematic diagram showing a first deceleration determination condition according to an embodiment of the present application. [Figure 13] FIG. 10 is a schematic diagram showing a second deceleration determination condition according to an embodiment of the present application. [Figure 14] FIG. 10 is a schematic diagram showing a third deceleration determination condition according to an embodiment of the present application. [Figure 15] FIG. 3 is a schematic diagram showing a first acceleration determination condition according to an embodiment of the present application. [Figure 16] FIG. 4 is a schematic diagram showing a second acceleration determination condition according to an embodiment of the present application. [Figure 17] FIG. 10 is a schematic diagram showing a third acceleration determination condition according to an embodiment of the present application. [Figure 18] 1 is a flowchart of an auto-focus control method according to an embodiment of the present application. [Figure 19] This illustrates an example in which autofocus operation based on contrast is performed according to the flow of FIG. [Figure 20] FIG. 10 is a schematic diagram of a module of an auto-focus control device according to another embodiment of the present application. DETAILED DESCRIPTION OF THE INVENTION

[0015] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and comprehensively described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments that can be obtained by those skilled in the art without creative efforts all belong to the protection scope of the present application.

[0016] Unless otherwise defined, technical or scientific terms used herein shall have the ordinary meaning understood by one of ordinary skill in the art to which this application belongs. Terms such as "first," "second," and the like used herein are used to distinguish between different objects, not to describe a particular order, number, or importance. Similarly, similar terms such as "one," "an," or "the," do not denote a numerical limitation, but are used only to indicate the presence of at least one. Similar terms such as "comprise" or "include" mean that a preceding component or item covers a subsequently listed component or item, or their equivalents, and do not exclude other components or items. Similar terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may also include electrical connections, whether direct or indirect.

[0017] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment can be included in at least one embodiment of the present application. Appearances of such a term anywhere in the specification do not necessarily refer to the same embodiment, nor are they mutually exclusive independent or alternative embodiments. Those skilled in the art can explicitly or implicitly understand that the embodiments described herein can be combined with other embodiments.

[0018] Referring to FIG. 1, FIG. 1 is a schematic diagram of a module of an imaging device 1 according to an embodiment of the present application. The imaging device 1 may be a camera module or a camera of an electronic device. The imaging device 1 includes an optical lens 11, an imaging element 12, a processor 13, a memory 14, and a focus adjustment mechanism 15. The imaging element 12 is provided corresponding to the optical lens 11, the imaging element 12 is connected to the processor 13, and the processor 13 is connected to the memory 14. The optical lens 11 includes at least a focus lens 112 and an imaging lens 114. The focus adjustment mechanism 15 is connected between the focus lens 112 and the processor 13.

[0019] In some embodiments, the processor 13 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor 13 may implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The processor 13 may be an image processor, a microprocessor, or any other conventional processor. The steps of the methods disclosed in the embodiments of the present application may be performed and completed directly by a hardware decoding processor, or may be performed and completed by a combination of hardware and software modules in the decoding processor. The memory 14 may be a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or the like. The image sensor 12 may be a charge-coupled device (CCD), a complementary metal-oxide semiconductor (CMOS), or the like. The memory 14 and the image sensor 12 are separately electrically connected to the processor 13. The focus adjustment mechanism 15 may be an electric and transmission assembly or the like, but is not limited thereto.

[0020] In some embodiments, referring also to FIG. 2 , the focus adjustment mechanism 15 is configured to move the focus lens 112 along the optical axis direction of the optical lens 11 based on a predetermined movement amount. This movement amount is a control value output by the processor 13 to the focus adjustment mechanism 15 for moving the focus lens 112. The imaging lens 114 focuses the subject image on the image sensor 12. While the optical lens 11 is moving, the image sensor 12 is configured to convert light from the subject image into image signals to generate multiple frames of RAW image data and output the multiple frames of image data to the processor 13. A computer program is stored in the memory 14. The processor 13 executes the computer program to perform an image processing process and an autofocus process. In the image processing process, image processing is performed on the multiple frames of image data to obtain processed image data. The image processing may be, but is not limited to, shading correction processing, exposure processing, white balance processing, etc. The autofocus process is performed on the multiple frames of image data that have undergone image processing. In the focusing process, the focus adjustment mechanism 15 drives the focus lens 112 based on a predetermined movement amount. During the process of moving the focus lens 112, the optical lens 11 scans the subject and generates image data for each lens position while the focus lens 112 is moving. Because multiple frames of image data were generated when the focus lens 112 was at different lens positions, the contrast values ​​of each frame of image data may differ. Focusing involves determining the position of the focus lens 112 when generating one frame of image data with the clearest contrast, and this position is considered the in-focus position. Furthermore, during the process of moving the focus lens 112 to find the in-focus position, the focus lens 112 may be moved multiple times until the in-focus position is found. Specifically, the autofocus process: performing a contrast value calculation process, the contrast value calculation process being used to obtain contrast values ​​within an autofocus evaluation area of ​​the image data for each lens position; Executing an autofocus evaluation value calculation process, the autofocus evaluation value calculation process being used to calculate an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​image data for each lens position; Executing an autofocus processing process, which is used to determine whether a peak value appears among the autofocus evaluation values ​​in the autofocus evaluation area of ​​the image data of each frame of the image data of a plurality of frames, and if a peak value appears, determining the focus position of the focus lens 112 and controlling the focus lens 112 to move to the focus position, thereby completing focusing; If no peak value appears, the next process is: Calculating extreme values ​​of the movement amount, where calculating the extreme values ​​of the movement amount includes calculating a maximum movement amount and a minimum movement amount; Performing an acceleration / deceleration determination process, which determines the next movement amount of the focus lens 112, and the next movement amount is between the maximum movement amount and the minimum movement amount; determining the in-focus position of the focus lens 112, and controlling the focus lens 112 to move to the in-focus position until focusing is completed, by moving the focus lens 112 based on the determined next movement amount, generating image data for each lens position while the focus lens is moving, and performing the contrast value calculation process, the autofocus evaluation value calculation process, and the autofocus processing process again; Includes:

[0021] As can be seen from this, in the autofocus process, the focus position of the focus lens 112 is determined, and the focus adjustment mechanism 15 is controlled to move the focus lens 112 to the focus position along the optical axis direction of the optical lens 11, thereby completing the focusing. As can be seen, the optical axis direction X of the optical lens is shown in Figure 2, and the optical axis direction X is the direction of the central axis of light propagation in the optical system, and is usually defined as the center line of the light beam (optical column) or the symmetry axis of the optical system.

[0022] In some embodiments, the processor 13 executes a computer program and further performs an image generation process, in which some processing is performed based on the image data processed in the image processing process to generate and output image data for output.

[0023] In some embodiments, the processor 13 executes a computer program and further performs a face detection process, which detects various facial feature data from the image data output by the image generation process when a face is included in a frame of image.

[0024] In some embodiments, referring to FIG. 3, the processor 13 executes a computer program to perform the autofocus process shown in FIG. 3. This autofocus process is a process of an autofocus control method. It should be understood that the process of the autofocus control method can be added, subtracted, or sequentially adjusted according to actual needs, and is not limited herein. Specifically, the autofocus control method includes S31 to S38.

[0025] S31: The focus lens 112 is moved along the optical axis direction of the optical lens 11 based on the current movement amount, and image data is generated for each lens position while the focus lens is moving.

[0026] S32: The contrast value within the autofocus evaluation area of ​​the image data for each lens position is obtained.

[0027] S33: An autofocus evaluation value is calculated based on the contrast value within the autofocus evaluation area of ​​the image data for each lens position.

[0028] S34: Determine whether a peak value appears among the autofocus evaluation values ​​in the autofocus evaluation area of ​​the image data of each frame of the image data of multiple frames. If a peak value appears, proceed to step S35; if no peak value appears, proceed to step S36.

[0029] S35: The in-focus position of the focus lens 112 is determined, and the focus lens 112 is controlled to move to the in-focus position to complete the focusing, and then the process ends.

[0030] S36: Calculating extreme values ​​of the movement amount Calculating the extreme values ​​of the movement amount includes calculating the maximum movement amount and the minimum movement amount.

[0031] S37: An acceleration / deceleration determination process is performed. The acceleration / deceleration determination process determines the next movement amount of the focus lens 112, and the next movement amount is between the maximum movement amount and the minimum movement amount.

[0032] S38: The focus lens 112 is moved based on the determined next movement amount, and image data is generated for each lens position while the focus lens is moving, and the process returns to step S32.

[0033] In the present application, if a peak value appears in the autofocus evaluation value within the autofocus evaluation area of ​​image data for each frame of image data among multiple frames, the focus position of the focus lens 112 is determined, and the focus lens 112 is controlled to move to the focus position, thereby completing focusing. If a peak value does not appear in the autofocus evaluation value within the autofocus evaluation area of ​​image data for each frame of image data among multiple frames, the following is performed: Calculating the extreme values ​​of the movement amount, where calculating the extreme values ​​of the movement amount includes calculating the maximum movement amount and the minimum movement amount; performing an acceleration / deceleration determination process, and determining the next movement amount of the focus lens 112 through the acceleration / deceleration determination process, where the next movement amount is between the maximum movement amount and the minimum movement amount; determining the focus position of the focus lens 112, and controlling the focus lens 112 to move to the focus position, thereby generating image data for each lens position while the focus lens is moving, and again acquiring the contrast value, calculating the autofocus evaluation value, and determining the peak value. In this way, autofocus accuracy and speed are improved in contrast-based autofocus by appropriately setting the amount of movement of focus lens 112. In the process of calculating the amount of movement of focus lens 112 in the acceleration / deceleration process, the judgment conditions for the acceleration / deceleration process are organized to achieve quantitative adjustment that is not dependent on the experience and skill of the adjuster.

[0034] Referring to Figure 4, Figure 4 is a schematic diagram showing a specific flow of S37 according to one embodiment of the present application. It can be understood that the specific flow of S37 can be added, removed, or sequentially adjusted according to actual needs, and is not limited in this specification. Specifically, S37 includes S372 to S374.

[0035] S372: An acceleration / deceleration determination process is executed. The acceleration / deceleration determination process includes an acceleration determination process for determining whether an acceleration movement is currently required, and a deceleration determination process for determining whether a deceleration movement is currently required. If it is determined that a deceleration movement is required, S373 is executed, and if it is determined that an acceleration movement is required, S374 is executed.

[0036] S373: The next movement amount of the focus lens 112 is determined based on the minimum movement amount and / or the current movement amount, and the process proceeds to S38.

[0037] S374: The next movement amount of the focus lens 112 is determined based on the maximum movement amount and / or the current movement amount, and the process proceeds to S38.

[0038] In this manner, in the present application, if it is determined that no peak value appears among the autofocus evaluation values ​​within the autofocus evaluation area of ​​each frame of image data among multiple frames of image data, an acceleration / deceleration determination process is executed. If it is determined that deceleration movement is necessary, the next movement amount of the focus lens 112 is determined based on the maximum movement amount and / or the current movement amount, and the determined next movement amount of the focus lens 112 is reduced relative to the current movement amount. Alternatively, if it is determined that acceleration movement is necessary, the next movement amount of the focus lens 112 is determined based on the minimum movement amount and / or the current movement amount, and the determined next movement amount of the focus lens 112 is increased relative to the current movement amount. This allows the focus lens 112 to be quickly moved to the focus position using the fastest and most stable movement method, thereby improving focusing accuracy and focusing speed.

[0039] In some embodiments, performing the acceleration / deceleration determination process includes first performing the deceleration determination process and then performing the acceleration determination process. Referring to FIG. 5, FIG. 5 is a schematic diagram illustrating a specific flow of S372 according to an embodiment of the present application. It should be understood that the specific flow of S372 may be added, subtracted, or sequentially adjusted according to actual needs, and is not limited herein. Specifically, S372 includes S3721 to S3723.

[0040] S3721: Executes a deceleration determination process. Deceleration determination is to determine whether the image data of each frame of image data among multiple frames is currently near the peak value based on the change trend of the autofocus evaluation value within the autofocus evaluation area. If it is near the peak value, deceleration is necessary, and if it is not near the peak value, deceleration is not necessary. Being near the peak value means that the current peak value has not been exceeded but is near the peak value, or that the current peak value has been exceeded but is near the peak value. If it is determined that deceleration is necessary, execute S373, and if it is determined that deceleration is not necessary, execute S3722.

[0041] S3722: Executes an acceleration determination process. Acceleration determination is a process of determining whether the current value is far from the peak value based on the change trend of the autofocus evaluation value within the autofocus evaluation area of ​​the image data of each frame of image data among multiple frames. If it is far from the peak value, it is determined that acceleration is necessary and S374 is executed; if not, it is determined that acceleration is not necessary and S3723 is executed.

[0042] S3723: It is determined that the next movement amount of the focus lens 112 is equal to the current movement amount, and the process returns to S38. Here, being far from the peak value means that the distance to the peak value is greater than a preset value.

[0043] In this way, in the present application, the deceleration determination process is first executed, and the acceleration determination process is executed when it is determined that deceleration movement of focus lens 112 is not necessary. When the value is near the peak value, it can be quickly determined that deceleration is necessary and that there is no need to execute the acceleration determination process again, reducing the amount of data calculation and enabling faster autofocusing.

[0044] In some embodiments, referring to FIG. 3, S36 specifically includes calculating the maximum movement amount of the next movement of the focus lens 112.

[0045] In some embodiments, the maximum movement amount of the next movement of the focus lens 112 is determined based on the depth of field of the optical lens 11 and the correspondence between the depth of field and the maximum movement amount. As shown in Table 1 and FIG. 6, the maximum movement amount is determined based on the depth of field of the optical lens 11. Generally speaking, the in-focus position is the position of the optical lens 11 when incident light from the subject converges to a single point on the focal plane. The front depth of field indicates the position where the subject is located closer to the focal plane and the incident light from the subject does not converge to a single point on the focal plane but converges to the diameter of an acceptable circle of confusion. The rear depth of field indicates the position where the subject is located farther from the focal plane and the incident light from the subject does not converge to a single point on the focal plane but converges to the diameter of an acceptable circle of confusion. In other words, as long as the subject is within the depth of field, acceptable focus accuracy can be obtained even if the focal plane is shifted. In some embodiments, the maximum movement amount may be equal to the depth of field, but is not limited to this.

[0046] Table 1 below shows the relationship between subject distance, focus position, rear depth of field, front depth of field, and maximum movement amount in some embodiments. The rightmost column of Table 1 shows the maximum movement amount calculated based on the rear depth of field and the front depth of field, at which the subject is almost within the depth of field even when the lens is moved.

[0047] [Table 1]

[0048] When determining the amount of lens movement, autofocus accuracy can be ensured as long as the subject is within the depth of field by the amount of lens movement. Therefore, the maximum movement amount is calculated from the current lens position based on the maximum movement amount in Table 1. For example, when the subject distance is 1.0 m, the forward depth of field is 0.886 m. Although this subject distance is not in Table 1, the focus position at 0.886 m is approximately 184 (the focus position when the subject distance is 1 m in Table 1) + 12 = 196.

[0049] In this way, when calculating the maximum movement amount, the rear depth of field and the front depth of field of the optical lens 11 are fully taken into consideration, and the accuracy of autofocus can be ensured.

[0050] Specifically, S36 further includes calculating the minimum movement amount of the next movement of the focus lens 112.

[0051] In some embodiments, in contrast-based autofocus, an autofocus evaluation value is calculated while the focus lens 112 is scanning, and the position with the maximum autofocus evaluation value is set as the in-focus position. However, for low-brightness or low-contrast objects, noise may be superimposed on the autofocus evaluation value, affecting autofocus accuracy. Figure 7 shows example scan data of autofocus evaluation values ​​for low-brightness and low-contrast objects. As shown in this data, noise is superimposed on the autofocus evaluation value, making it difficult to determine a clear peak position for the autofocus evaluation value. Clearly, if noise is significant relative to the autofocus evaluation value, it is preferable to operate the autofocus while taking the amount of noise into consideration. Therefore, the minimum movement amount is calculated based on the amount of noise superimposed on the autofocus evaluation value within the autofocus evaluation area of ​​image data for each frame of image data among multiple frames. The amount of noise is determined based on the difference between the maximum and minimum values ​​of the autofocus evaluation values ​​obtained within a certain period of time when the position of the focus lens 112 is fixed, which are previously measured. This improves the accuracy and speed of autofocus in low contrast.

[0052] Specifically, FIG. 8 illustrates an example of obtaining an autofocus evaluation value for a low-contrast subject when the position of the focus lens 112 is fixed. The autofocus evaluation value within the autofocus evaluation area of ​​each frame of image data among multiple frames of image data and the position of the focus lens 112 corresponding to each autofocus evaluation value are used as the ordinate and abscissa, respectively, to generate multiple coordinate points in a two-dimensional coordinate system. An approximate curve is obtained based on the multiple coordinate points. Here, the amount of noise is determined based on the difference between the maximum and minimum values ​​of the autofocus evaluation value. It is also possible to obtain the amount of noise by calculating a standard deviation and multiplying it by a coefficient. Because the amount of noise depends on the gain multiplied by the output signal of the optical sensor, it can be measured at various gains, or it can be simply calculated from the gain used to measure the amount of noise and the gain used during autofocus operation.

[0053] In this way, the amount of noise in multiple frames of image data is fully taken into account when calculating the minimum movement amount, improving the accuracy and speed of autofocus in low contrast situations. A relatively low-contrast scene may be, but is not limited to, an exposed scene, a scene with little ambient light, etc. In some embodiments, when the amount of noise is high, movement near the focus position based on the depth of field is meaningless, so the maximum movement amount is set to be equal to or greater than the minimum movement amount calculated based on the amount of noise, thereby determining the maximum and minimum movement amounts.

[0054] In some embodiments, the calculation of the minimum movement amount is divided into two cases. The first case is when focus lens 112 is currently still far from the in-focus position, and the second case is when focus lens 112 is already near the in-focus position. Next, a method for calculating the minimum movement amount in the above two cases will be described in detail.

[0055] First, a method for calculating the minimum movement amount in the first case (when the focus lens 112 is currently still far from the in-focus position) will be described.

[0056] Referring to FIG. 9, FIG. 9 is a diagram illustrating a method for calculating the minimum movement amount when the focus lens 112 is away from the in-focus position. In the diagram, 401 indicates the change in the autofocus evaluation value when no noise is superimposed, and 402 indicates the change in the autofocus evaluation value when noise is superimposed. The noise originates from the external environment and circuit noise. The external environment includes, but is not limited to, optical shot noise, which becomes a problem in low illuminance situations.

[0057] As can be seen from FIG. 9, the superimposition of noise causes the autofocus evaluation value to fluctuate up and down relative to the true autofocus evaluation value corresponding to the position of the focus lens 112. Autofocusing involves moving the focus lens 112 in the direction that increases the autofocus evaluation value to find the peak position of the autofocus evaluation value. Therefore, it is necessary to confirm whether the autofocus evaluation value increases by moving the focus lens 112 from its current position. However, if the amount of noise is not negligible relative to the change in the autofocus evaluation value, if the amount of movement of the focus lens 112 is small, it may be impossible to determine whether the increase in the autofocus evaluation value is due to noise or a true increase in the autofocus evaluation value caused by moving the focus lens 112. Therefore, the true increase in the autofocus evaluation value caused by moving the focus lens 112 must be greater than the amount of noise. Therefore, the formula for calculating the minimum movement amount is expressed as follows: Minimum movement amount = noise amount / slope. The amount of noise is defined as above. The slope is the ratio between the amount of change (F1) in the autofocus evaluation value within one frame of image data and the amount of movement (M1) of the focus lens 112 within that one frame of image data.

[0058] In this manner, in the present application, the minimum movement amount is equal to the ratio of the amount of noise to the slope indicating the change in the autofocus evaluation value. When calculating the minimum movement amount, the amount of noise is fully taken into consideration, and the true change in the autofocus evaluation value within the minimum movement amount of the focus lens 112 is set to be greater than the amount of noise, thereby reducing the influence of noise on the change in the autofocus evaluation value. Because situations with relatively high noise levels generally involve relatively low contrast, a minimum movement amount set with the amount of noise taken into consideration is particularly suitable for low-contrast scenes, improving the accuracy and speed of autofocus in low-contrast or low-illuminance situations. Possible low-contrast or low-illuminance scenes include, but are not limited to, long-exposure scenes and scenes with weak ambient light.

[0059] 10, which is a diagram illustrating a method for calculating the maximum movement amount limit value relative to the minimum movement amount when the focus lens 112 is significantly away from the in-focus position. When the focus lens 112 is significantly away from the in-focus position, the change in the autofocus evaluation value of multiple frames of image data obtained by scanning the optical lens 11 is small, and the gradient of the change in the autofocus evaluation value is small, so the calculated minimum movement amount may be quite large. In this case, a maximum movement amount limit value is set in advance, and if the minimum movement amount becomes larger than the maximum movement amount limit value, the minimum movement amount is set to the maximum movement amount limit value. The maximum movement amount limit value should preferably be approximately 1 to 5 times the maximum movement amount calculated from the depth of field. Therefore, calculating the minimum movement amount based on the amount of noise superimposed on the autofocus evaluation value within the autofocus evaluation area of ​​image data of each frame of image data of multiple frames further includes, if the calculated minimum movement amount is greater than the maximum movement amount limit value, setting the minimum movement amount to the maximum movement amount limit value, and the maximum movement amount limit value is 1 to 5 times the maximum movement amount obtained within the depth of field of the optical lens.

[0060] Next, a method for calculating the minimum movement amount in the second case (when the focus lens 112 is near the in-focus position) will be described.

[0061] Referring to FIG. 11, FIG. 11 is a diagram illustrating a method for calculating the minimum movement amount when focus lens 112 is near the peak position. FIG. 11 shows autofocus evaluation values ​​obtained by scanning a low-contrast subject near the peak value using focus lens 112 in a low-brightness environment. The solid line shows the autofocus evaluation value obtained by scanning a low-contrast subject near the peak position using the focus lens in a low-brightness environment. The dotted line is a quadratic function approximation of the data shown by the solid line. As shown in FIG. 11, in order to determine the focus position, the minimum movement amount is determined to be the difference between the position of focus lens 112 corresponding to peak position P of the approximation curve and the position of focus lens 112 corresponding to position F where the amount of noise has decreased from the peak position. Therefore, when the position of the focus lens 112 is away from the in-focus position, calculating the minimum movement amount based on the amount of noise superimposed on the autofocus evaluation value within the autofocus evaluation area of ​​the image data of each frame of image data among multiple frames includes the minimum movement amount being the difference between the position of the focus lens 112 corresponding to the peak position of the approximation curve and the position of the focus lens 112 corresponding to the position where the amount of noise has decreased from the peak position.

[0062] In this way, when focus lens 112 is near the in-focus position, by determining that the minimum movement amount is the difference between the position of focus lens 112 corresponding to the peak position of the approximation curve and the position of focus lens 112 corresponding to the position where the amount of noise has decreased from the peak position, it is possible to improve the accuracy of autofocus by fully considering the effect of the amount of noise on the autofocus evaluation value. Note that the measurement in Figure 11 is performed by changing the brightness, with the brightness and the minimum movement amount set as adjustment data, and a low-contrast face being suitable as the measurement subject.

[0063] In some embodiments, if the maximum movement amount calculated based on the depth of field is smaller than the minimum movement amount calculated based on the amount of noise, the maximum movement amount is replaced with a movement amount that is equal to or greater than the minimum movement amount.

[0064] If, due to shooting conditions, a difference occurs in which the maximum movement amount calculated based on the depth of field is smaller than the minimum movement amount calculated based on the amount of noise, it is assumed that the noise is so large that it is meaningless to move focus lens 112 based on the depth of field near the in-focus position, and it is desirable to set the maximum movement amount to the minimum movement amount calculated based on the amount of noise or more, and this is how the maximum and minimum movement amounts are determined. However, it is necessary to actually shoot a low-light subject to check the autofocus operation and make adjustments if there are any problems.

[0065] Next, specific determination conditions of S3721 will be described in detail. In some embodiments, the deceleration determination conditions of S3721 include at least one of a first deceleration determination condition, a second deceleration determination condition, and a third deceleration determination condition. The first deceleration determination condition is that the rate of decrease from the maximum value of the autofocus evaluation value in the autofocus evaluation area of ​​image data for each frame of image data among the multiple frames of image data exceeds a first specified value. The second deceleration determination condition is that the rate of increase of the autofocus evaluation value in the autofocus evaluation area of ​​image data for each frame of image data among the multiple frames of image data exceeds a second specified value. The third deceleration determination condition is that the rate of increase of the autofocus evaluation value in the autofocus evaluation area of ​​each image data among all image data since the start of the focus operation is equal to or greater than a third specified value.

[0066] The first deceleration determination condition is that the rate of decrease from the maximum value of the autofocus evaluation value in the autofocus evaluation area of ​​each frame of image data among the multiple frames of image data exceeds a first specified value, indicating that the focus lens 112 has already passed the in-focus position and therefore must decelerate so as not to move away from the in-focus position again. The second deceleration determination condition is that the rate of decrease in the autofocus evaluation value in the autofocus evaluation area of ​​each frame of image data among the multiple frames of image data exceeds a second specified value, indicating that the focus lens 112 has not yet passed the in-focus position but is already near the in-focus position. The third deceleration determination condition is that the rate of increase in the autofocus evaluation value in the autofocus evaluation area of ​​each image data among all image data since the start of the focus operation is equal to or greater than a third specified value. It is possible to determine whether the focus lens 112 is near the in-focus position (i.e., whether the autofocus evaluation value in the autofocus evaluation area of ​​each frame of image data among the multiple frames of image data is near its peak value) using any one of the first, second, and third deceleration determination conditions. When the focus lens 112 is near the in-focus position, it is determined that deceleration is necessary, and when the focus lens 112 is near the in-focus position, it is prevented from continuing to accelerate, passing the in-focus position, and then moving away from the in-focus position again. This reduces the focusing time and improves the focusing speed.

[0067] Referring to FIG. 12, FIG. 12 is a schematic diagram illustrating a first deceleration determination condition according to an embodiment of the present application. In FIG. 12, when the focus lens 112 moves beyond the in-focus position, the autofocus evaluation value drops from its maximum value. FV_max is the maximum autofocus evaluation value, and FV_drop is the autofocus evaluation value after the drop. The first deceleration determination condition (the first deceleration determination condition is that the rate of drop from the maximum autofocus evaluation value in the autofocus evaluation area of ​​each frame of image data among multiple frames of image data exceeds a first specified value) may be, specifically, but is not limited to, drop rate (d%) > drop threshold. Drop rate (d%) = (FV_max - FV_drop) / FV_max. The first specified value may be, but is not limited to, the drop threshold. The drop threshold in the first deceleration determination condition may be the larger of the noise amount ratio or 5%. The noise amount ratio = noise amount / autofocus evaluation value. The noise amount is calculated with reference to the above description and will not be repeated here. 5% is a typical value used for normal brightness. As can be appreciated, the deceleration drop threshold can be adjusted according to actual needs.

[0068] 13 is a schematic diagram showing a second deceleration determination condition according to an embodiment of the present application. In FIG. 13, the second deceleration determination condition (the second deceleration determination condition is that the decrease in the increase rate of the autofocus evaluation value within the autofocus evaluation area of ​​image data of each frame of image data of multiple frames exceeds a second specified value) may be, specifically, but is not limited to, that the decrease in the increase rate between the increase rate of the previous frame and the increase rate of the current frame is equal to or greater than a deceleration threshold. Specifically, the second deceleration determination condition is the increase rate of the previous frame (+a%) - the increase rate of the current frame (+b%) ≥ the deceleration threshold. The autofocus evaluation value of point A is FV_A, the autofocus evaluation value of point B is FV_B, and the autofocus evaluation value of point C is FV_C. The increase rate of the previous frame (+a%) = (FV_B - FV_A) / FV_A, and the increase rate of the current frame (+b%) = (FV_C - FV_B) / FV_B. The deceleration threshold of the second deceleration determination condition can be the larger of the noise amount ratio or 5%, where the noise amount ratio is calculated with reference to the above formula, and 5% is a typical value used for normal brightness. As can be appreciated, the deceleration threshold can be adjusted according to actual needs.

[0069] Referring to FIG. 14, FIG. 14 is a schematic diagram showing a third deceleration determination condition according to an embodiment of the present application. In FIG. 14, the third deceleration determination condition (the third deceleration determination condition is that the rate of increase of the autofocus evaluation value of each image data item in the autofocus evaluation area from the start of the focus operation is equal to or greater than a third specified value) may specifically be, but is not limited to, that the ratio of the difference between the maximum and minimum values ​​of the autofocus evaluation value to the maximum value from the start of the focus operation is greater than an increase threshold. The maximum value of the autofocus evaluation value is FV_max, the minimum value of the autofocus evaluation value is FV_min, and the increase threshold is set to (FV_max-FV_min) / FV_max≧the increase threshold. Here, the maximum increase rate is the increase rate when FV_max is equal to the peak value of the autofocus evaluation value. The increase threshold may be, but is not limited to, 2 / 3 of the maximum increase rate. The increase rate is calculated based on the maximum and minimum values ​​of the autofocus evaluation value in the scan data, and the increase threshold is set to 2 / 3 of the maximum increase rate. The scan data is obtained by calculating the minimum movement amount of a low-contrast, low-brightness object. 2 / 3 is taken into consideration when the autofocus operation starts from a position that is 1 / 3 or less of the maximum autofocus evaluation value, at which acceleration is considered necessary. As can be seen, the rising threshold can be adjusted according to actual needs.

[0070] In some embodiments, if the deceleration determination process determines that deceleration movement is required, determining the next movement amount of the focus lens 112 is at least one of the following (1), (2), and (3): (1) The next movement amount of the focus lens 112 is determined to be the minimum movement amount. (2) The next movement amount of the focus lens 112 is determined to be half the current movement amount. (3) The next movement amount of the focus lens 112 is determined to be the current movement amount minus n, which is an integer equal to or greater than 1. Half the current movement is less than the current movement minus n.

[0071] For example, if the first deceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be the minimum movement amount. If the second deceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be half the current movement amount. If the third deceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be the current movement amount minus n, an integer greater than or equal to 1. As can be seen, the first deceleration determination condition, the second deceleration determination condition, and the third deceleration determination condition can be arbitrarily combined with the above three methods for determining the next movement amount of the focus lens 112 when it is determined that deceleration movement is necessary. For example, if the first deceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be half the current movement amount. If the second deceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be the current movement amount minus n, an integer greater than or equal to 1. If the third deceleration determination condition is met, it is determined that the next movement amount of focus lens 112 is the minimum movement amount. Note that this specification does not particularly limit the amount, and specific adjustments are made according to actual needs.

[0072] In some embodiments, when performing the deceleration determination process, if it is determined that deceleration movement is necessary and the focus lens 112 is near the focus position, if the difference between the next movement amount determined in (1) or the next movement amount determined in (2) and the current movement amount is greater than a preset value, it is determined that the next movement amount is the next movement amount determined in (3).

[0073] Next, in some embodiments, the acceleration determination conditions of S3722 will be described in detail. The acceleration determination conditions of S3722 include at least one of a first acceleration determination condition, a second acceleration determination condition, and a third acceleration determination condition. The first acceleration determination condition is that the current movement amount of the focus lens 112 is equal to or less than the currently determined minimum movement amount of the focus lens 112. The second acceleration determination condition is that, within the image data of a predetermined frame, the rate of increase in the autofocus evaluation value within the autofocus evaluation area of ​​image data of adjacent frames is smaller than a fourth specified value. The third acceleration determination condition is that, among the image data of multiple frames, the number of image data of consecutive frames that do not undergo acceleration processing exceeds a fifth specified value.

[0074] The first acceleration determination condition is that the current movement amount of focus lens 112 is equal to or less than the currently determined minimum movement amount of focus lens 112, indicating that the movement speed of focus lens 112 is too slow. The second acceleration determination condition is that, within the image data of a preset frame, the rate of increase in the autofocus evaluation value within the autofocus evaluation area of ​​image data of adjacent frames is smaller than a fourth specified value, indicating that focus lens 112 is significantly far from the in-focus position and therefore the change in the autofocus evaluation value is small. The third acceleration determination condition is that the number of image data of consecutive frames that are not subjected to acceleration processing among the image data of multiple frames exceeds a fifth specified value, indicating that focus lens 112 is significantly far from the in-focus position and therefore the change in the autofocus evaluation value is small. If any one of the above first acceleration judgment condition, second acceleration judgment condition, and third acceleration judgment condition is satisfied, it can be determined that the focus lens 112 is far from the focus position (i.e., no peak value appears among the autofocus evaluation values ​​within the autofocus evaluation area of ​​the image data of each frame of multiple frames of image data), or that the moving speed is too slow, and therefore acceleration is necessary, which can further shorten the focusing time.

[0075] 15 is a schematic diagram showing a first acceleration determination condition according to an embodiment of the present application. The first acceleration determination condition (the current movement amount of focus lens 112 is equal to or less than the minimum movement amount) may be increase rate (a%)<noise amount ratio. Increase rate (a%)=increase amount of autofocus evaluation value / autofocus evaluation value, and noise amount ratio=noise amount / autofocus evaluation value. The noise amount is an actual value calculated with reference to FIG. 8.

[0076] Referring to FIG. 16, FIG. 16 is a schematic diagram showing a second acceleration determination condition according to an embodiment of the present application. The second acceleration determination condition (the rate of increase in the autofocus evaluation value within the autofocus evaluation area of ​​each frame of image data of adjacent frames within the image data of a preset frame is smaller than a fourth specified value) is that the rate of change in the autofocus evaluation value within a specific number of past frames is smaller than the change rate threshold. In other words, the autofocus evaluation value is stable or its increase or decrease is unclear. For example, in FIG. 16, the change rate (a%) in the image data of the second frame is less than the change rate threshold, the change rate (b%) in the image data of the third frame is less than the change rate threshold, and the change rate (c%) in the image data of the fourth frame is less than the change rate threshold. Here, the change rate threshold is the larger of the noise amount ratio or 10%, with 10% being a typical value used for normal brightness.

[0077] Referring to FIG. 17, FIG. 17 is a schematic diagram illustrating a third acceleration determination condition according to an embodiment of the present application. The third acceleration determination condition (the number of consecutive frames of image data that are not subjected to acceleration processing among multiple frames of image data exceeds a fifth predetermined value) is that the number of movements exceeds a movement number threshold under the initial lens movement amount. In some embodiments, the movement number threshold n=3, so that the goal is to complete the autofocus operation within a predetermined number of movements, for example, within 10 movements, and acceleration / deceleration adjustment is required, so that the autofocus operation can be completed quickly and accurately. As can be appreciated, in other embodiments, the movement number threshold can be adjusted according to actual needs.

[0078] In some embodiments, if the acceleration determination process determines that accelerated movement is required, determining the next movement amount of the focus lens 112 is at least one of (1), (2), and (3) below. (1) The next movement amount of the focus lens 112 is determined to be the maximum movement amount. (2) The next movement amount of the focus lens 112 is determined to be m times the current movement amount, where m is a real number equal to or greater than 1. (3) The next movement amount of the focus lens 112 is determined to be the current movement amount plus n, which is an integer equal to or greater than 1. The current movement amount multiplied by m is greater than the current movement amount plus n, and the current movement amount multiplied by m is less than or equal to the determined maximum movement amount.

[0079] If the first acceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be the maximum movement amount. If the second acceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be m times the current movement amount, where m is a real number greater than or equal to 1. If the third acceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be the current movement amount plus n, an integer greater than or equal to 1. As can be seen, the first, second, and third acceleration determination conditions can be arbitrarily combined with the above three methods for determining the next movement amount of the focus lens 112 when it is determined that accelerated movement is necessary. For example, if the first acceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be m times the current movement amount, where m is a real number greater than or equal to 1. If the second acceleration determination condition is met, the next movement amount of the focus lens 112 is determined to be the current movement amount plus n, an integer greater than or equal to 1. If the third acceleration determination condition is met, it is determined that the next movement amount of focus lens 112 is the maximum movement amount. There are no particular limitations here, and specific adjustments are made according to actual needs.

[0080] In some embodiments, S32 includes the following steps: 1) Generate, for each pixel, RAW image data of one frame corresponding to an optical image of a subject focused by an imaging lens using the image sensor 12; 2) Perform image processing on this RAW image data of one frame; 3) Calculate a contrast value and a luminance evaluation value within an autofocus evaluation area of ​​the RAW image data of each frame; 4) Calculate an autofocus evaluation value for this RAW image data of one frame through correction processing and weighted calculation processing using the contrast value and the luminance evaluation value within the autofocus evaluation area of ​​the RAW image data of each frame.

[0081] 18, which is a flowchart of an automatic focus control method according to an embodiment of the present application. It should be understood that the processes of the automatic focus control method can be added, removed, or sequentially adjusted according to actual needs, and are not limited herein. Specifically, the automatic focus control method includes steps S1701 to S1714.

[0082] S1701: Perform initial settings. The initial settings include, but are not limited to, setting a focus operation mode, setting an autofocus evaluation frame, setting an operating range of the focus lens 112, setting an initial position of the focus lens 112, and setting an initial movement direction of the focus lens 112. Among these, the focus operation mode includes a single focus mode (AF-S), a continuous focus mode (AF-C), an autofocus mode (AF-A), etc. The autofocus evaluation frame is set to determine an appropriate autofocus evaluation area based on a user selection or the result of automatic determination by the processor 13. The initial position of the focus lens 112 is the position of the focus lens 112 before the start of focus movement. The initial movement direction of the focus lens 112 is the direction in which the initial focus lens 112 is moved, and generally, the focus lens 112 is moved in a direction that increases the autofocus evaluation value.

[0083] Specifically, the total movement range of the focus lens 112 is determined based on the depth of field of the optical lens 11 and / or information about the subject. The total movement range includes a far-side boundary value and a near-side boundary value. The far-side boundary value refers to the boundary value at which the focus lens 112 is moved toward a side where the focus position of the focus lens 112 is farther from the user, while the near-side boundary value refers to the boundary value at which the focus lens 112 is moved toward a side where the focus position of the focus lens 112 is closer to the user. For example, in Table 1, if the subject distance is 10 m and the rear depth of field is set to infinity, subjects farther than 10 m are within the depth of field, so there is no need to move the focus lens 112 to a farther position to scan the focus position. Therefore, the far-side boundary value may be set within the range of 120. On the other hand, the near-side boundary value must be set to include the camera performance specification distance. The lens module in Table 1 has a performance specification of 0.1 m. However, at the near point, the lens movement amount relative to the subject distance becomes significantly larger, making it meaningless to set the near boundary value based on the depth of field. Therefore, the near boundary value is usually set to a value with a certain margin added to the near position (850) in Table 1. For example, to detect the peak position of a subject located at 0.1 m, the near boundary value must be set to several times the maximum lens movement amount. If the subject is a face, the near boundary value can be set higher than the near distance specified in the camera's performance specifications. For example, if the subject distance is 0.3 m or greater, i.e., if it is not necessary to capture a face closer than 0.3 m from the subject, the operating range can be limited to 351 or less, allowing for faster autofocus operation.

[0084] S1702: The focus adjustment mechanism 15 moves the focus lens 112 to the initial position.

[0085] S1703: Autofocus-related data required for autofocus operation is processed to obtain an autofocus evaluation value for image data of the current position. Specifically, the autofocus-related data may be, but is not limited to, the movement range of the focus lens 112, the start conditions for autofocus operation, the end conditions for autofocus operation, the size of the autofocus evaluation area, the number of frame divisions for the autofocus evaluation area, etc. The autofocus-related data also includes exposure information, which may be, but is not limited to, sensor gain, exposure time, etc. The autofocus-related data also includes noise information derived from the external environment and circuit noise. The external environment may include, but is not limited to, optical shot noise, which becomes a problem in low illuminance.

[0086] S1704: Peak value determination is performed. Specifically, the focus adjustment mechanism 15 moves the focus lens 112 based on the determined current movement amount, and in the process of moving the focus lens 112, the autofocus evaluation value of the autofocus evaluation area of ​​the image data of each frame of image data of several frames is obtained, and it is determined whether a peak value appears in the autofocus evaluation value of the image data of each frame of image data of several frames. If a peak value appears, proceed to S1705. If not, proceed to S1707.

[0087] S1705: Calculate the in-focus position. Specifically, the autofocus evaluation value within the autofocus evaluation area of ​​each frame of image data among the multiple frames of image data and the position of the focus lens 112 corresponding to each autofocus evaluation value are used as the ordinate and abscissa, respectively, to generate multiple coordinate points in a two-dimensional coordinate system. An approximation curve is obtained based on the multiple coordinate points, and the abscissa corresponding to the peak position of the approximation curve is determined as the in-focus position.

[0088] S1706: The focus lens 112 is moved to the in-focus position to complete the focusing.

[0089] S1707: Calculates the minimum movement amount / maximum movement amount. Specifically, the maximum movement amount for the next movement of the focus lens 112 is determined based on the depth of field of the optical lens 11 and the correspondence between the depth of field and the maximum movement amount. The minimum movement amount is calculated based on the amount of noise superimposed on the autofocus evaluation value within the autofocus evaluation area of ​​image data for each frame of image data among multiple frames. When the focus lens 112 is away from the in-focus position, the calculation formula for the minimum movement amount is: minimum movement amount = noise amount / slope. Here, the noise amount is determined based on the difference between the maximum and minimum values ​​of the autofocus evaluation values ​​obtained within a certain period of time when the position of the focus lens 112 is fixed, which are measured in advance. The slope is the ratio of the amount of change (F1) in the autofocus evaluation value of image data for one frame to the movement amount (M1) of the focus lens 112 within the image data for that frame. If the calculated minimum movement amount is greater than the maximum movement amount limit value, the minimum movement amount is set to the maximum movement amount limit value, and the maximum movement amount limit value is 1 to 5 times the maximum movement amount obtained within the depth of field of the optical lens 11. When the focus lens 112 is near the peak position, the minimum movement amount is the difference between the position of the focus lens 112 corresponding to the peak position of the approximation curve and the position of the focus lens 112 corresponding to the position where the noise amount has decreased from the peak position.

[0090] S1708: A deceleration determination process is performed. The deceleration determination refers to determining whether the autofocus evaluation value of the autofocus evaluation area in the image data of multiple frames is currently near a peak value based on the change trend of the autofocus evaluation value. If it is determined that the autofocus evaluation value is near the peak value, deceleration is necessary. If the autofocus evaluation value is not near the peak value, deceleration is not necessary. In some embodiments, the deceleration determination condition includes at least one of a first deceleration determination condition, a second deceleration determination condition, and a third deceleration determination condition. The first deceleration determination condition is that the rate of decrease from the maximum value of the autofocus evaluation value in the autofocus evaluation area of ​​image data of each frame of the image data of the multiple frames exceeds a first specified value. The second deceleration determination condition is that the rate of increase of the autofocus evaluation value in the autofocus evaluation area of ​​image data of each frame of the image data of the multiple frames exceeds a second specified value. The third deceleration determination condition is that the rate of increase of the autofocus evaluation value in the autofocus evaluation area of ​​each image data of all image data since the start of the focus operation is equal to or greater than a third specified value.

[0091] If it is determined that deceleration is necessary, the process proceeds to S1709, whereas if it is determined that deceleration is not necessary, the process proceeds to S1710.

[0092] S1709: The next movement amount for deceleration is calculated, a peak mark is set, and it is recorded that the focus lens 112 is already near the peak value, and the process proceeds to S1714.

[0093] In some embodiments, if the deceleration determination process determines that deceleration movement is required, determining the next movement amount of the focus lens 112 is at least one of the following (1), (2), and (3): (1) The next movement amount of the focus lens 112 is determined to be the minimum movement amount. (2) The next movement amount of the focus lens 112 is determined to be half the current movement amount. (3) The next movement amount of the focus lens 112 is determined to be the current movement amount minus n, which is an integer equal to or greater than 1. Half the current movement is less than the current movement minus n.

[0094] The next movement amount of the focus lens 112 determined when it is determined that deceleration is necessary is determined based on the minimum movement amount or the current movement amount. When the deceleration determination process is being executed, if it is determined that deceleration movement is necessary and the focus lens 112 is near the in-focus position, and the difference between the next movement amount determined in (1) or the next movement amount determined in (2) and the current movement amount is greater than a preset value, it is determined that the next movement amount is the next movement amount determined in (3).

[0095] S1710: Determine whether near peak value. As can be seen, if it is determined in S1708 that the deceleration condition is met, this indicates that the autofocus evaluation value within the autofocus evaluation area of ​​the image data acquired by the focus lens 112 is near the peak value. If this is the case, a peak mark is set in S1709. If it is determined in S1708 that the deceleration condition is not met, the process proceeds to S1710. There are two cases where the deceleration condition is not met in S1710. The first is when the deceleration condition is not met and the image is not near the peak value. The second is when the deceleration condition is not met but the image is near the peak value. Therefore, determining whether near the peak value is met in S1710 is actually determining whether a peak mark is present. If a peak mark is present, the process proceeds to S1711; if not, the process proceeds to S1712.

[0096] S1711: The next movement amount of the focus lens 112 is determined to be the current movement amount, and the process proceeds to S1714.

[0097] S1712: An acceleration determination process is performed. In some embodiments, acceleration determination refers to determining whether the current value is far from the peak value based on the change trend of the autofocus evaluation value in the autofocus evaluation area of ​​the image data of multiple frames. In some embodiments, the acceleration determination condition includes at least one of a first acceleration determination condition, a second acceleration determination condition, and a third acceleration determination condition. The first acceleration determination condition is that the current movement amount of the focus lens 112 is less than or equal to the currently determined minimum movement amount of the focus lens 112. The second acceleration determination condition is that, within the image data of a predetermined frame, the rate of increase in the autofocus evaluation value in the autofocus evaluation area of ​​image data of each frame of image data of adjacent frames is smaller than a fourth specified value. The third acceleration determination condition is that the number of image data of consecutive frames that do not undergo acceleration processing among the image data of multiple frames exceeds a fifth specified value.

[0098] If it is determined that acceleration is necessary, the process proceeds to S1713, whereas if it is determined that acceleration is not necessary, the process proceeds to S1711.

[0099] S1713: The next movement amount of acceleration is calculated.

[0100] In some embodiments, if the acceleration determination process determines that accelerated movement is required, determining the next movement amount of the focus lens 112 is at least one of (1), (2), and (3) below. (1) The next movement amount of the focus lens 112 is determined to be the maximum movement amount. (2) The next movement amount of the focus lens 112 is determined to be m times the current movement amount, where m is a real number equal to or greater than 1. (3) The next movement amount of the focus lens 112 is determined to be the current movement amount plus n, which is an integer equal to or greater than 1. The current movement amount multiplied by m is greater than the current movement amount plus n, and the current movement amount multiplied by m is less than or equal to the determined maximum movement amount.

[0101] When it is determined that acceleration of the focus lens 112 is necessary, the next movement amount determined is determined based on the maximum movement amount or the current movement amount.

[0102] S1714: The focus adjustment mechanism 15 moves the focus lens 112 based on the determined next movement amount, and the process returns to S1703.

[0103] In the present application, when it is determined that the peak value has not been reached, there are three cases. In the first case, the deceleration condition is met and the determined next movement amount of the focus lens 112 is smaller than the current movement amount. In the second case, the acceleration condition is met and the determined next movement amount of the focus lens 112 is larger than the current movement amount. In the third case, neither the deceleration condition nor the acceleration condition is met and the determined next movement amount of the focus lens 112 is equal to the current movement amount. Furthermore, when it is determined that the peak value has not been reached, the maximum and minimum movement amounts of the next movement of the focus lens 112 are calculated in advance, and the next movement amount that satisfies the deceleration determination condition is determined based on the current movement amount or the minimum movement amount, and the next movement amount that satisfies the acceleration determination condition is determined based on the current movement amount or the maximum movement amount. This eliminates the need to rely on the experience of the adjuster, and improves the accuracy and speed of autofocus.

[0104] Next, Fig. 19 illustrates an example of performing autofocus operation based on contrast according to the flow of Fig. 18. In Fig. 19, the leftmost position is the start position of the autofocus operation, and after performing acceleration processing twice to reach the peak position (focus position), deceleration processing is performed twice.

[0105] Therefore, according to the present invention, it is possible to appropriately control the accuracy and speed of autofocus, which is particularly effective in low-luminance photography where noise in the autofocus evaluation value cannot be ignored for low-contrast subjects such as faces.

[0106] Referring to FIG. 20, FIG. 20 is a schematic diagram of modules of an autofocus control device 200 according to another embodiment of the present application. The autofocus control device 200 includes a scan control module 210, a contrast value calculation module 220, an autofocus evaluation value determination module 230, a peak value determination module 240, a focus control module 250, a movement amount determination module 260, and an acceleration / deceleration determination module 270. The scan control module 210 is configured to move the focus lens 112 along the optical axis direction of the optical lens based on the current movement amount, and generate image data for each lens position during the movement of the focus lens. The contrast value calculation module 220 is configured to determine a contrast value within an autofocus evaluation area of ​​the image data for each lens position. The autofocus evaluation value determination module 230 is configured to calculate an autofocus evaluation value based on the contrast value within the autofocus evaluation area of ​​the image data for each lens position. The peak value determination module 240 is configured to determine whether a peak value appears among the autofocus evaluation values ​​within the autofocus evaluation area of ​​the image data for each frame of image data among multiple frames of image data. The focus control module 250 is configured to determine the focus position of the focus lens 112 when a peak value appears, and control the focus lens 112 to move to the focus position to complete focusing. The movement amount determination module 260 is configured to calculate extreme values ​​of the movement amount when a peak value does not appear, where calculating the extreme values ​​of the movement amount includes calculating a maximum movement amount and a minimum movement amount. The acceleration / deceleration determination module 270 is configured to perform an acceleration / deceleration determination process when a peak value does not appear, and determine the next movement amount of the focus lens 112 through the acceleration / deceleration determination process, where the next movement amount is between the maximum movement amount and the minimum movement amount.The scan control module 210 is configured to move the focus lens 112 based on the determined next movement amount to generate image data for each lens position while the focus lens is moving, and during this period, the contrast value calculation module 220 is configured to calculate the contrast value again, the autofocus evaluation value determination module 230 is configured to calculate the autofocus evaluation value again, and the peak value determination module 240 is configured to determine the peak value again, and after determining the focus position of the focus lens 112, the focus control module 250 is further configured to control the focus lens 112 to move to the focus position to complete focusing.

[0107] In some embodiments, the software modules of the auto-focus control device 200 can be stored in a storage medium well known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory 14. For example, the processor 13 can read application programs, computer instructions, or data in memory 14 and complete the processes of the above-described methods performed by the auto-focus control device in combination with hardware.

[0108] The present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by the processor 13, the process of the autofocus control method is realized. The computer-readable storage medium may be a conventional storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or any other storage medium.

[0109] For ease of explanation, the embodiments of the methods are expressed as a combination of a series of operations. However, it should be understood by those skilled in the art that the present application is not limited to the order of operations described, and that some steps may be performed in other orders or simultaneously based on the present application. It should also be understood by those skilled in the art that the embodiments described in the specification are preferred embodiments, and that the operations and modules are not necessarily required for the present application.

[0110] In the above embodiments, the description of each embodiment has its own emphasis, and for the parts not described in detail in one embodiment, reference can be made to the relevant descriptions of other embodiments.

[0111] The steps of the methods in the embodiments of the present application can be adjusted, combined, and deleted in sequence according to actual needs.

[0112] Those skilled in the art can understand that all or part of the processes in the methods of the above embodiments can be achieved by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed, the processes of the above method embodiments can be realized. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), etc.

[0113] The above embodiments are only used to explain the technical solutions of the present application and do not limit the technical solutions of the present application. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand the following: Those skilled in the art may still modify the technical solutions described in the above embodiments and make equivalent substitutions for some of these technical features, and these modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. 1. An autofocus control method, comprising: The autofocus control method is applied to an imaging device including an optical lens, the optical lens including a focus lens and an imaging lens, and the autofocus control method includes: moving the focus lens based on a current movement amount along an optical axis direction of the optical lens, and generating image data for each lens position while the focus lens is moving; Obtaining a contrast value within an autofocus evaluation area of ​​the image data for each lens position; calculating an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​the image data for each lens position; determining whether a peak value appears among autofocus evaluation values ​​within an autofocus evaluation area of ​​image data of each frame among the plurality of frames of image data; When a peak value appears, a focus position of the focus lens is determined, and the focus lens is controlled to move to the focus position to complete focusing; If no peak value appears, Calculating extreme values ​​of the movement amount, wherein the calculating of the extreme values ​​of the movement amount includes calculating a maximum movement amount and a minimum movement amount; performing an acceleration / deceleration determination process, wherein the acceleration / deceleration determination process determines a next movement amount of the focus lens, and the next movement amount is between the maximum movement amount and the minimum movement amount; determining a focus position of the focus lens, and controlling the focus lens to move to the focus position until focusing is completed by moving the focus lens based on the determined next movement amount, generating image data for each lens position while the focus lens is moving, and again acquiring a contrast value, calculating an autofocus evaluation value, and determining a peak value; Including, 1. An automatic focus control method comprising:

2. the calculating of the maximum movement amount includes determining the maximum movement amount based on a depth of field of the optical lens and a correspondence relationship between the depth of field and the maximum movement amount; 2. The autofocus control method according to claim 1.

3. The calculation of the minimum movement amount described above is Calculating the minimum movement amount based on an amount of noise superimposed on an autofocus evaluation value in an autofocus evaluation area of ​​image data of each frame of the image data of a plurality of frames, wherein the amount of noise is determined based on a difference between a maximum value and a minimum value of autofocus evaluation values ​​measured in advance within a certain period of time obtained when the position of the focus lens is fixed; and / or If the maximum movement amount is smaller than the minimum movement amount, replacing the maximum movement amount with a movement amount equal to or greater than the minimum movement amount; Including, 2. The autofocus control method according to claim 1.

4. The autofocus control method includes: Scanning a subject in advance to obtain an autofocus evaluation value; generating a plurality of coordinate points in a two-dimensional coordinate system using an autofocus evaluation value within an autofocus evaluation area of ​​image data of each frame among the plurality of frames of image data and a position of a focus lens corresponding to each of the autofocus evaluation values ​​as an ordinate and an abscissa, respectively; obtaining an approximation curve based on the plurality of coordinate points; Calculating the minimum movement amount based on the amount of noise superimposed on the autofocus evaluation value in the autofocus evaluation area of ​​image data of each frame among the image data of the plurality of frames, determining the minimum movement amount based on a difference between a position of the focus lens corresponding to a peak position of the approximation curve and a position of the focus lens corresponding to a position where the amount of noise has decreased from the peak position when the focus lens is near a focused position; 4. The autofocus control method according to claim 3.

5. The autofocus control method includes: generating a plurality of coordinate points in a two-dimensional coordinate system using an autofocus evaluation value within an autofocus evaluation area of ​​image data of each frame among the plurality of frames of image data and a position of a focus lens corresponding to each of the autofocus evaluation values ​​as an ordinate and an abscissa, respectively; Calculating the minimum movement amount based on the amount of noise superimposed on the autofocus evaluation value in the autofocus evaluation area of ​​image data of each frame among the image data of the plurality of frames, determining the minimum movement amount based on a ratio of the noise amount to a slope when the focus lens is away from the in-focus position, wherein the slope is a ratio of a change amount (F1) of the autofocus evaluation value in one frame of image data to a movement amount (M1) of the focus lens in the one frame of image data; 4. The autofocus control method according to claim 3.

6. Calculating the minimum movement amount based on the amount of noise superimposed on the autofocus evaluation value in the autofocus evaluation area of ​​image data of each frame among the image data of the plurality of frames, When the calculated minimum movement amount is greater than a maximum movement amount limit value, the minimum movement amount is set to the maximum movement amount limit value; The maximum movement limit value is 1 to 5 times the maximum movement obtainable within the depth of field of the optical lens.

6. The autofocus control method according to claim 5.

7. The acceleration / deceleration determination process determines the next movement amount of the focus lens, determining a next movement amount of the focus lens based on the maximum movement amount and / or the current movement amount when it is determined that an accelerated movement is necessary in the acceleration / deceleration determination process; determining a next movement amount of the focus lens based on the minimum movement amount and / or the current movement amount when it is determined that deceleration movement is necessary in the acceleration / deceleration determination process; 2. The autofocus control method according to claim 1.

8. The acceleration / deceleration determination process includes an acceleration determination process for determining whether or not an acceleration movement is currently required, and a deceleration determination process for determining whether or not a deceleration movement is currently required.

8. The autofocus control method according to claim 7.

9. The execution of the acceleration / deceleration determination process includes: first executing the deceleration determination process, and then executing the acceleration determination process; 9. The autofocus control method according to claim 8.

10. When the deceleration determination process is executed, a determination condition of the deceleration determination process includes at least one of a first deceleration determination condition, a second deceleration determination condition, and a third deceleration determination condition; The first deceleration determination condition is that a rate of decrease from a maximum value of an autofocus evaluation value in an autofocus evaluation area of ​​image data of each frame of the image data of the plurality of frames exceeds a first specified value, The second deceleration determination condition is that a decrease in the rate of increase of the autofocus evaluation value in an autofocus evaluation area of ​​image data of each frame of the image data of the plurality of frames exceeds a second specified value; The third deceleration determination condition is that the rate of increase of the autofocus evaluation value of the autofocus evaluation area of ​​each image data among all image data from the start of the focus operation is equal to or greater than a third specified value, 9. The autofocus control method according to claim 8.

11. When it is determined that deceleration movement is necessary in the deceleration determination process, determining the next movement amount of the focus lens includes: (1) determining that the next movement amount of the focus lens is the minimum movement amount; (2) determining that the next movement amount of the focus lens is half of the current movement amount; (3) determining that the next movement amount of the focus lens is a value obtained by subtracting n, which is an integer equal to or greater than 1, from the current movement amount; at least one of Half of the current movement amount is smaller than the value obtained by subtracting n from the current movement amount, 9. The autofocus control method according to claim 8.

12. The automatic focus control method further includes, when performing the deceleration determination process, determining that deceleration movement is necessary and the focus lens is near a focus position, if the difference between the next movement amount determined in (1) or the next movement amount determined in (2) and the current movement amount is greater than a preset value, determining that the next movement amount is the next movement amount determined in (3).

12. The autofocus control method according to claim 11.

13. When the acceleration determination process is executed, a determination condition of the acceleration determination process includes at least one of a first acceleration determination condition, a second acceleration determination condition, and a third acceleration determination condition; the first acceleration determination condition is that the current movement amount of the focus lens is equal to or less than a currently determined minimum movement amount of the focus lens; the second acceleration determination condition is that, in image data of a preset frame, an increase rate of an autofocus evaluation value in an autofocus evaluation area of ​​image data of each frame among image data of adjacent frames is smaller than a fourth specified value; the third acceleration determination condition is that the number of consecutive frames of image data that are not subjected to acceleration processing among the plurality of frames of image data exceeds a fifth specified value; 9. The autofocus control method according to claim 8.

14. When it is determined that acceleration movement is necessary in the acceleration determination process, determining the next movement amount of the focus lens includes: determining that the next movement amount of the focus lens is the maximum movement amount; determining that the next movement amount of the focus lens is m times the current movement amount, where m is a real number equal to or greater than 1; determining that the next movement amount of the focus lens is a value obtained by adding n, which is an integer equal to or greater than 1, to the current movement amount; at least one of m times the current movement amount is greater than the value of the current movement amount plus n, m times the current movement amount is equal to or less than the determined maximum movement amount; 9. The autofocus control method according to claim 8.

15. The imaging device includes an imaging element, and determining an autofocus evaluation value within an autofocus evaluation area of ​​image data of each frame among the plurality of frames of image data includes: generating, by the imaging element, one frame of RAW image data for each pixel according to an optical image of a subject focused by the imaging lens; performing image processing on the one frame of RAW image data; Calculating a contrast value and a brightness evaluation value within an autofocus evaluation area of ​​the RAW image data of each frame; calculating an autofocus evaluation value of the RAW image data of one frame by a correction process and a weighting process using a contrast value and a luminance evaluation value within an autofocus evaluation area of ​​the RAW image data of each frame; Including, 2. The autofocus control method according to claim 1.

16. The autofocus control method further includes determining a total movement range of the focus lens based on information of a depth of field of the optical lens and / or information of a subject.

2. The autofocus control method according to claim 1.

17. An imaging device, a memory; and a computer program stored in the memory and executable by a processor; The processor executes the computer program to perform the process of the autofocus control method according to any one of claims 1 to 16. An imaging device characterized by:

18. 1. A computer-readable storage medium, comprising: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the process of the auto-focus control method according to any one of claims 1 to 16 is realized. A computer-readable storage medium comprising:

19. An imaging device, The imaging device includes an optical lens, an image sensor, a memory, and a processor. the optical lens includes a focus lens, an imaging lens, and a focus adjustment mechanism, the focus lens is disposed corresponding to the imaging lens and is connected to the focus adjustment mechanism, and the focus adjustment mechanism is configured to move the focus lens along an optical axis direction of the optical lens based on a current movement amount; the imaging element is configured to convert light from a subject image into an image signal while the optical lens is moving, and generate image data for each lens position while the focus lens is moving; the memory stores a computer program; The processor is configured to execute the computer program to perform the following processes: executing a contrast value calculation process, the contrast value calculation process being used to obtain a contrast value within an autofocus evaluation area of ​​the image data for each of the lens positions; executing an autofocus evaluation value calculation process, the autofocus evaluation value calculation process being used to calculate an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​the image data for each of the lens positions; An autofocus processing process is executed, and the autofocus processing process is used to determine whether a peak value appears in the autofocus evaluation value within the autofocus evaluation area of ​​the image data of each frame of the image data of a plurality of frames. If a peak value appears, the focus position of the focus lens is determined, and the focus lens is controlled to move to the focus position to complete focusing. If a peak value does not appear, the following process is executed, namely: calculating extreme values ​​of the movement amount, the calculating of the extreme values ​​of the movement amount including calculating a maximum movement amount and a minimum movement amount; performing an acceleration / deceleration determination process, determining a next movement amount of the focus lens by the acceleration / deceleration determination process, the next movement amount being between the maximum movement amount and the minimum movement amount; a focus position of the focus lens is determined, and the focus lens is controlled to move to the focus position until focusing is completed, and image data for each lens position is generated while the focus lens is moving based on the determined next movement amount, and the contrast value is acquired, the autofocus evaluation value is calculated, and the peak value is determined again; An imaging device characterized by:

20. An autofocus control device, The apparatus includes a scan control module, a contrast value calculation module, an autofocus evaluation value determination module, a peak value determination module, a focus control module, a movement amount determination module, and an acceleration / deceleration determination module, the scan control module is configured to move a focus lens of the optical lens based on a current movement amount along an optical axis direction of the optical lens of the imaging device, and generate image data for each lens position during the movement of the focus lens; the contrast value calculation module is configured to determine a contrast value within an autofocus evaluation area of ​​the image data for each lens position; The autofocus evaluation value determination module is configured to calculate an autofocus evaluation value based on a contrast value within an autofocus evaluation area of ​​the image data for each lens position. the peak value determination module is configured to determine whether a peak value appears among autofocus evaluation values ​​within an autofocus evaluation area of ​​image data of each frame among the image data of a plurality of frames; the focus control module is configured to determine a focus position of the focus lens when a peak value appears, and control the focus lens to move to the focus position to complete focusing; The movement amount determination module is configured to calculate extreme values ​​of the movement amount when no peak value appears, and the calculation of the extreme values ​​of the movement amount includes calculating a maximum movement amount and a minimum movement amount; The acceleration / deceleration determination module is configured to perform an acceleration / deceleration determination process when a peak value does not appear, and determine a next movement amount of the focus lens through the acceleration / deceleration determination process, and the next movement amount is between the maximum movement amount and the minimum movement amount; the scan control module is configured to move the focus lens based on the determined next movement amount to generate image data for each lens position while the focus lens is moving, and during this period, the contrast value calculation module is configured to calculate the contrast value again, the autofocus evaluation value determination module is configured to calculate the autofocus evaluation value again, and the peak value determination module is configured to determine the peak value again, and after determining the focus position of the focus lens, the focus control module is further configured to control the focus lens to move to the focus position to complete focusing. An automatic focus control device characterized by:

Citation Information

Patent Citations

  • Automatic focusing video camera

    JP1995007650A

  • Interchangeable lens device and control method of the same, imaging device and control method of the same, and imaging system

    JP2013242339A

  • Automatic focusing detection device, control method therefor, and imaging apparatus

    JP2014038291A

  • Image pickup apparatus, image pickup system, image pickup apparatus controlling method, program, and storage medium

    JP2014228592A

  • Focus detector and imaging device

    JP2018151659A