Automatic focus adjustment control method and imaging device
The autofocus control method improves focus accuracy by identifying and accounting for provisional areas like eyes, glasses, and teeth, reducing the influence of light reflection and blinking, thus enhancing autofocus precision in digital cameras with face recognition.
Patent Information
- Application Number
- JP2024153604
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Conventional autofocus systems in digital cameras with face recognition are affected by light reflection from glasses or pupils, and blinking, leading to reduced focus accuracy, especially in low-light environments.
An autofocus control method that identifies a first target focus adjustment evaluation area overlapping with a face area, determines a target provisional area including an eye, eyeglass, or teeth area, adjusts the focus lens position, calculates contrast values, and determines a target focus position based on these evaluations to reduce the influence of provisional areas, improving focus accuracy.
The method enhances autofocus accuracy by minimizing the impact of light reflection and blinking, enabling precise and stable focusing on human faces.
Smart Images

Figure 0007738719000001_ABST
Abstract
Description
[Technical Field]
[0001] The present application relates to the field of autofocus technology, and more particularly to an autofocus control method and an imaging device. [Background technology]
[0002] Digital cameras equipped with face recognition functions are becoming widespread. By detecting a person's face area in a captured image and automatically focusing on that face area, it is possible to take a good photograph. Technology has also been proposed for detecting the eyes in a person's face area and adjusting the focus so that the eyes are in focus. Patent documents show that by detecting the eye area from face information detected by a face recognition means and obtaining focus information from the detected eye area, it is possible to focus on the area around the eyes within the face.
[0003] However, when using conventional imaging devices to adjust the focus on the eyes, the autofocus operation can be affected by factors such as light reflection from the glasses or pupils, or blinking, which can degrade the focus accuracy. This effect becomes particularly significant in low-light environments and cannot be ignored. [Prior art documents] [Patent documents]
[0004] Japanese Patent Application Laid-Open No. 2001-215403 Summary of the Invention [Problem to be solved by the invention]
[0005] In order to solve the above-mentioned technical problems, the present application provides an automatic focus adjustment control method and an imaging device, which reduces the influence of the automatic focus adjustment operation caused by light reflection on glasses or pupils, or blinking, and enables focusing with high accuracy and stability. [Means for solving the problem]
[0006] In a first aspect of the present application, there is provided an autofocus control method applied to an imaging device including a focus lens. The autofocus control method includes: capturing an image of a subject at a current focus lens position; determining a first target focus adjustment evaluation area when the captured image includes a face area, where the first target focus adjustment evaluation area and the face area at least partially overlap; determining a target provisional area in the first target focus adjustment evaluation area, where the first target focus adjustment evaluation area includes the target provisional area and a second target focus adjustment evaluation area excluding the target provisional area, where the target provisional area includes at least one of an eye area, an eyeglass area, and a teeth area; adjusting the focus lens position; acquiring a contrast value at each focus lens position of the second target focus adjustment evaluation area of the image acquired at each focus lens position; calculating a corresponding focus adjustment evaluation value at each focus lens position of the first target focus adjustment evaluation area based on the contrast value at least at each focus lens position of the second target focus adjustment evaluation area to acquire a focus adjustment evaluation value for each focus position; determining a target focus position based on the focus adjustment evaluation value for each focus position, and adjusting the position of the focus lens to the target focus position.
[0007] A second aspect of the present application provides an imaging device. The imaging device includes an imaging element unit, an optical lens unit, a lens driver, an image data generator, a face detection processor, an autofocus unit, an image signal processor, and a focus adjustment evaluation value calculator. The imaging element unit is used to convert an optical signal into an image signal. The optical lens unit includes a focus lens and is used to focus light from a subject onto the imaging element unit. The lens driver is used to drive the focus lens to adjust the position of the focus lens. The image data generator is used to output an image based on the image signal, thereby capturing the image. The face detection processor is used to identify a face region in the captured image. If the captured image includes a face region, the autofocus unit is used to determine a first target focus adjustment evaluation region, where the first target focus adjustment evaluation region and the face region at least partially overlap. The automatic focus adjustment unit is further used to determine a target provisional region in the first target focus adjustment evaluation region, so that the first target focus adjustment evaluation region includes the target provisional region and a second target focus adjustment evaluation region excluding the target provisional region, and the target provisional region includes at least one of the eye region, the eyeglass region, and the teeth region. The image signal processing unit is used to acquire contrast values at each focus lens position of the second target focus adjustment evaluation region of the image collected at each focus lens position. The focus adjustment evaluation value calculation unit is used to calculate corresponding focus adjustment evaluation values at each focus lens position of the first target focus adjustment evaluation region based on the contrast values at least at each focus lens position of the second target focus adjustment evaluation region, thereby acquiring focus adjustment evaluation values for each focus position. The automatic focus adjustment unit is further used to determine a target focus position based on the focus adjustment evaluation value for each focus position. The lens driving unit is further used to adjust the position of the focus lens to the target focus position.
[0008] The autofocus control method and imaging device provided by the present application accurately identify and determine the target provisional area to obtain a second target focus adjustment evaluation area, calculate the corresponding focus adjustment evaluation value of the first target focus adjustment evaluation area based on at least the contrast value of the second target focus adjustment evaluation area, and perform autofocus operation based on the focus adjustment evaluation value, thereby significantly reducing the influence of the target provisional area on the autofocus operation, improving the accuracy of determining the target focus position, improving the accuracy of autofocus adjustment, and enabling high-precision and stable focusing on human faces. [Brief explanation of the drawings]
[0009] In order to clearly explain the technical solutions of the embodiments of the present application, the drawings required for explaining the embodiments will be briefly described below. Obviously, the drawings described are only for some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative efforts. [Figure 1] FIG. 10 is a schematic diagram showing a mapping relationship between a focus lens position and a focus adjustment evaluation value in the related art. [Figure 2] 1 is a flowchart of an auto-focus control method provided by an embodiment of the present application. [Figure 3] 10 is a flowchart of a subdivision step in one example of step S2. [Figure 4] 1 is a schematic diagram showing collected images provided by an embodiment of the present application. [Figure 5] FIG. 2 is a schematic diagram illustrating a first target focus adjustment evaluation region and its multiple sub-regions provided by an embodiment of the present application. [Figure 6] 10 is a flowchart showing a subdivision step in one example of step S3. [Figure 7] 1 is a schematic diagram illustrating an image including eyeglasses provided by an embodiment of the present application. [Figure 8] 1 is a schematic diagram showing an image without glasses provided by an embodiment of the present application; [Figure 9] FIG. 9 is a schematic diagram of the numbers obtained by numbering the sub-regions in FIGS. 7 and 8. [Figure 10] FIG. 1 is a schematic diagram illustrating an image that does not include a face region, provided by an embodiment of the present application; [Figure 11] FIG. 11 is a schematic diagram of numbers obtained by numbering multiple sub-areas of the third target focus adjustment evaluation area in FIG. 10. [Figure 12] 10 is a flowchart showing a subdivision step in one example of step S31. [Figure 13] 1 is a schematic diagram of an image taken without wearing glasses, provided by an example of the present application; [Figure 14] 1A-1C are schematic diagrams of images collected when wearing eyeglasses, as provided by an embodiment of the present application. [Figure 15] FIG. 2 is a schematic diagram illustrating a mapping relationship between a focus lens position and a first contrast ratio provided by an embodiment of the present application. [Figure 16] 1 is a schematic diagram of an image taken without wearing glasses, provided by an example of the present application; [Figure 17] 1A-1C are schematic diagrams of images collected when wearing eyeglasses, as provided by an embodiment of the present application. [Figure 18] FIG. 10 is a schematic diagram illustrating a mapping relationship between a focus lens position and a second contrast ratio provided by an embodiment of the present application. [Figure 19] 10 is a flowchart showing a subdivision step in one example of step S322. [Figure 20] 10 is a flowchart showing a subdivision step in one example of step S3222. [Figure 21] FIG. 2 is a schematic diagram illustrating a first focus lens position range and a second focus lens position range provided by an embodiment of the present application. [Figure 22] FIG. 2 is a schematic diagram illustrating a first detection threshold and a second detection threshold provided by an embodiment of the present application. [Figure 23]FIG. 4 is a schematic diagram illustrating a first focus lens position range and a second focus lens position range provided by another embodiment of the present application. [Figure 24] FIG. 2 is a schematic diagram illustrating a first detection threshold and a second detection threshold provided by another embodiment of the present application. [Figure 25] 1A and 1B are schematic diagrams illustrating a change in the angle of view caused by movement of a focus lens in the related art. [Figure 26] 10 is a flowchart of another example of the subdivision step of step S2. [Figure 27] 1A and 1B are schematic diagrams illustrating focus adjustment evaluation areas corresponding to a first preset focus lens position and a second preset focus lens position provided by an embodiment of the present application. [Figure 28] 10 is a flowchart of another example of the subdivision step of step S3. [Figure 29] 1 is a schematic diagram of the eyeglasses area shifting when the focus lens moves, provided by an embodiment of the present application; [Figure 30] FIG. 30 is an enlarged schematic view of the subject shown in FIG. 29. [Figure 31] 10 is a schematic diagram of a target provisional area and a second target focus adjustment evaluation area in the overlap area provided by an embodiment of the present application. FIG. [Figure 32] 10A and 10B are schematic diagrams showing mapping relationships between focus lens positions, luminance values, and focus adjustment evaluation values in the related art. [Figure 33] 10 is a flowchart showing a subdivision step in one example of step S6. [Figure 34] FIG. 10 is a schematic diagram of a focus adjustment evaluation value after correction using a first correction formula provided by an embodiment of the present application. [Figure 35] FIG. 10 is a schematic diagram of a focus adjustment evaluation value after correction using a second correction formula provided by an embodiment of the present application. [Figure 36] 1 is a schematic diagram illustrating the structure of an imaging device provided by an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0010] Hereinafter, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the 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 belong to the protection scope of the present application.
[0011] Terms such as "first," "second," "third," and "fourth" used in the specification of this application are used merely to distinguish between objects being described and are not used to describe a specific order. The directions or positional relationships indicated by terms such as "upper," "lower," and "inner" used in the specification of this application are directions or positional relationships indicated based on the drawings, and are merely intended to explain the present invention and simplify the explanation. They are not intended to indicate or imply that the indicated devices or elements necessarily have a specific orientation, or are configured or operated in a specific orientation, and therefore cannot be understood as limitations on the present invention.
[0012] In the description of this application, the term "connection" should be understood in a broad sense unless otherwise explicitly specified or limited. For example, it may be a fixed connection, a detachable connection, or an integral connection. It may be a direct connection, an indirect connection via an intermediate medium, or internal communication between two components. It may be a mechanical connection or an electrical connection. Those skilled in the art can understand the specific meaning of the above term in the present invention depending on the specific circumstances.
[0013] Conventional automatic focus adjustment typically involves moving a focus lens, calculating a focus adjustment evaluation value, and setting the focus lens position corresponding to the maximum focus adjustment evaluation value as the in-focus position. See FIG. 1. FIG. 1 is a schematic diagram illustrating the mapping relationship between focus lens position and focus adjustment evaluation value in the related art. As shown in FIG. 1, a first curve 100 indicates the mapping relationship between focus lens position and focus adjustment evaluation value for a normal subject, while a second curve 101 indicates the mapping relationship between focus lens position and focus adjustment evaluation value for a case in which light strikes the eyeglass lens, frame, or pupil, causing reflection. In the first curve 100, the focus adjustment evaluation value is maximized at a focus lens position of 400, which corresponds to the in-focus position. In the second curve 101, the focus adjustment evaluation value decreases at a focus lens position of 400, and there are even larger focus adjustment evaluation values on the left and right of 400. Therefore, if the focus lens position is 400, where the focus adjustment evaluation value is not the maximum value, and 400 is set as the in-focus position, a problem occurs in which the accuracy of automatic focus adjustment is reduced. This is because the reflected portion of the high-intensity light becomes blurred when it deviates from the focus position, and the range of its influence increases.
[0014] The embodiments of the present application provide an autofocus control method, which can improve the accuracy of autofocus by taking into account the influence of reflected light on autofocus operation when light hits eyeglasses, eyes, and teeth.
[0015] Please refer to Fig. 2. Fig. 2 is a flowchart of an automatic focus adjustment control method provided by an embodiment of the present application. As shown in Fig. 2, the automatic focus adjustment control method includes the following steps S1 to S7.
[0016] In step S1, an image of the subject is captured at the current focus lens position.
[0017] Step S2: if the captured image includes a face region, determining a first target focus adjustment evaluation region, where the first target focus adjustment evaluation region and the face region at least partially overlap each other.
[0018] Step S3: determining a target provisional area in the first target focus adjustment evaluation area, where the first target focus adjustment evaluation area includes the target provisional area and a second target focus adjustment evaluation area excluding the target provisional area, and the target provisional area includes at least one of an eye area, an eyeglass area, and a tooth area.
[0019] Step S4: Adjust the focus lens position, and capture an image of the subject after the adjustment.
[0020] Step S5: Obtain the contrast value at each focus lens position of the second target focus adjustment evaluation area of the image collected at each focus lens position.
[0021] Step S6: Based on the contrast value at each focus lens position in at least the second target focus adjustment evaluation area, a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area is calculated to obtain a focus adjustment evaluation value for each focus position.
[0022] In step S7, a target in-focus position is determined based on the focus adjustment evaluation value for each focus position, and the position of the focus lens is adjusted to the target in-focus position.
[0023] The autofocus control method and imaging device provided by the present application accurately identify and determine the target provisional area to obtain a second target focus adjustment evaluation area, calculate the corresponding focus adjustment evaluation value of the first target focus adjustment evaluation area based on at least the contrast value of the second target focus adjustment evaluation area, and perform autofocus operation based on the focus adjustment evaluation value, thereby significantly reducing the influence of the target provisional area on the autofocus operation, improving the accuracy of determining the target focus position, improving the accuracy of autofocus adjustment, and enabling high-precision and stable focusing on human faces.
[0024] In some embodiments, the autofocus control method further includes acquiring contrast values at each focus lens position of the target interim region of the image captured at each focus lens position. Calculating a corresponding focus adjustment evaluation value at each focus lens position of the first target focus adjustment evaluation region based on the contrast values at each focus lens position of the at least second target focus adjustment evaluation region includes calculating a corresponding focus adjustment evaluation value at each focus lens position of the first target focus adjustment evaluation region based on the contrast values at each focus lens position of the second target focus adjustment evaluation region and the contrast values at each focus lens position of the target interim region, wherein a weighted value of the contrast value of the target interim region is smaller than a weighted value of the contrast value of the second target focus adjustment evaluation region.
[0025] When calculating the focus adjustment evaluation value, by lowering the weighting value of the target provisional area, it is possible to reduce the influence of the target provisional area on the calculation of the focus adjustment evaluation value and improve the accuracy of automatic focus adjustment.
[0026] In some embodiments, calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on the contrast value at each focus lens position in at least the second target focus adjustment evaluation area to obtain a focus adjustment evaluation value for each focus position includes calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based only on the contrast value at each focus lens position in the second target focus adjustment evaluation area.
[0027] The accuracy of automatic focus adjustment can be improved by calculating the focus adjustment evaluation value based only on the contrast value of the second target focus adjustment evaluation area, i.e., by excluding the target provisional area and eliminating the influence of the target provisional area on the calculation of the focus adjustment evaluation value.
[0028] Please refer to Figure 3. Figure 3 is a flowchart of a subdivision step in one example of step S2. In some embodiments, as shown in Figure 3, determining the first target focus adjustment evaluation area specifically includes the following subdivision steps S21 to S22.
[0029] S21, identifying features of a face region, the features including at least one of eyes, nose, and mouth.
[0030] S22: determining a first target focus adjustment evaluation region based on at least the position of the feature, and dividing the first target focus adjustment evaluation region into a plurality of sub-regions;
[0031] Detecting multiple feature points in a face region can identify the features, for example, four eye feature points, one nose feature point, and two mouth feature points.
[0032] Please refer to FIG. 4. FIG. 4 is a schematic diagram showing a collected image provided by an embodiment of the present application. As shown in FIG. 4, detected feature points are indicated by triangle marks. Among the four eye feature points 800, two eye feature points 800 are located on both ends of the right eye, and the other two eye feature points 800 are located on both ends of the left eye. A nose feature point 801 is located near the nose, and two mouth feature points 802 are located on both ends of the mouth. In another embodiment, there are two nose feature points 801 located on both ends of the nose. Furthermore, the quantity and positions of the eye feature points 800, nose feature points 801, and mouth feature points 802 can be selected as needed.
[0033] In some embodiments, determining the first target focus evaluation area based on at least the position of the feature and dividing the first target focus evaluation area into a plurality of sub-areas includes obtaining orientation information of the face area, the orientation information including a yaw angle and / or a pitch; and determining the first target focus evaluation area based on the position and orientation information of the feature and dividing the first target focus evaluation area into a plurality of sub-areas.
[0034] In some embodiments, determining a first target focus evaluation area based on the feature position and orientation information and dividing the first target focus evaluation area into a plurality of sub-areas includes determining a width, height, and center position of the first target focus evaluation area, and dividing the first target focus evaluation area into a predetermined number of rows and a predetermined number of columns to obtain a plurality of sub-areas arranged in an array.
[0035] Specifically, as shown in FIG. 4, the two eye feature points 800 located at both ends of the left or right eye are the inner eye feature point 800a and the outer eye feature point 800b, respectively. The inner eye feature point 800a of the left eye is closer to the right eye than the outer eye feature point 800b of the left eye, and the inner eye feature point 800a of the right eye is closer to the left eye than the outer eye feature point 800b of the right eye. The distance between the two outer eye feature points 800b is defined as the horizontal width of the first target focus adjustment evaluation area. The vertical height of the first target focus adjustment evaluation area is calculated using the following formula:
number
[0036] Please refer to FIG. 5. FIG. 5 is a schematic diagram showing a first target focus adjustment evaluation area and its multiple sub-areas provided by an embodiment of the present application. As shown in FIG. 5, the distance between the two outer eye feature points 800b is the horizontal width (marked as W in FIG. 5) of the first target focus adjustment evaluation area. The number of rows of the multiple sub-areas is set to 7, and the number of columns of the multiple sub-areas is set to 3, that is, N1 is 7, and N2 is 3. The vertical height (marked as H in FIG. 5) of the first target focus adjustment evaluation area is calculated by the following formula:
number
[0037] As described above, the first target focus adjustment evaluation region 1000 and its multiple sub-regions 400 are set based on the position of the eyes, so the regions for the eyes and eyeglasses can be set with high precision.
[0038] Please refer to Fig. 6. Fig. 6 is a flowchart of the subdivision steps in one example of step S3. In some embodiments, as shown in Fig. 6, determining the target provisional area in the first target focus adjustment evaluation area 1000 specifically includes the following subdivision steps S31 to S33.
[0039] S31: Determine whether the face area includes glasses. If the face area includes glasses, execute S32 below. If the face area does not include glasses, execute S33 below.
[0040] S32, determining that the target provisional region includes the glasses region;
[0041] S33, determining that the target provisional region includes the eye region;
[0042] Generally, when wearing glasses, the glasses cover the eyes, and the temporary target area is set to include the glasses area, thereby simultaneously reducing the influence of the eyes and glasses on the automatic focus adjustment operation.
[0043] In some embodiments, if the face region includes eyeglasses, determining that the target interim region includes the eyeglasses region includes determining that the eyeglasses region includes the sub-region 400 where the eyes are located or further includes the sub-region 400 adjacent to the eyes. If the face region does not include eyeglasses, determining that the target interim region includes the eye region includes determining that the eye region includes the sub-region 400 where the eyes are located.
[0044] Please refer to FIG. 7. FIG. 7 is a schematic diagram illustrating an image including eyeglasses, provided by an embodiment of the present application. As shown in FIG. 7, when it is determined that the face region includes eyeglasses, i.e., when it is determined that the person is wearing eyeglasses, the sub-region 400e where the eyes are located and the sub-region 400f adjacent to a portion of the eyes are set as the eyeglasses region 2000. A target provisional region 5000 is set to include the eyeglasses region 2000, and the region of the first target focus adjustment evaluation region 1000 excluding the target provisional region 5000 is set as the second target focus adjustment evaluation region 6000.
[0045] In some embodiments, determining the target provisional region in the first target focus adjustment evaluation region 1000 further includes determining whether the face region includes teeth, and if the face region includes teeth, determining that the target provisional region includes a teeth region. If the face region includes teeth, determining that the target provisional region includes a teeth region specifically includes determining that the teeth region includes the sub-region 400 where the teeth are located. Whether the face region includes teeth can be determined by color segmentation, etc.
[0046] Please refer to FIG. 8. FIG. 8 is a schematic diagram illustrating an image provided by an embodiment of the present application that does not include eyeglasses. As shown in FIG. 8, if it is determined that the face region does not include eyeglasses, i.e., if it is determined that the person is not wearing eyeglasses, the sub-region 400e where the eyes are located is set as the eye region 2100. A target provisional region 5000 is set to include the eye region 2100, and the region of the first target focus adjustment evaluation region 1000 excluding the target provisional region 5000 is set as the second target focus adjustment evaluation region 6000.
[0047] In some embodiments, the first target focus adjustment evaluation region 1000 further includes a region other than the face region, such as the left and right neck regions 400g shown in Figures 7 and 8. The target provisional region 5000 further includes a region other than the face region. For example, as shown in Figure 7, the target provisional region 5000 includes the glasses region 2000 and the left and right neck sub-regions 400g. Also, as shown in Figure 8, the target provisional region 5000 includes the eye region 2100 and the left and right neck sub-regions 400g.
[0048] When calculating the focus adjustment evaluation value of the first target focus adjustment evaluation area 1000, weight values corresponding to the plurality of sub-areas 400 are set in advance, and the focus adjustment evaluation value is calculated based on the corresponding weight values and contrast values.
[0049] Please refer to FIG. 9. FIG. 9 is a schematic diagram of the numbers obtained by numbering the multiple sub-regions 400 in FIGS. 7 and 8. As shown in FIG. 9, the numbers of the multiple sub-regions 400 shown in FIGS. 7 and 8 range from 0 to 20. When wearing glasses, the weighted values of the multiple sub-regions 400 are {1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 0, 1, 2, 1, 1, 2, 1, 0, 1, 0} in ascending order. When not wearing glasses, the weighted values of the multiple sub-regions 400 are {1, 1, 1, 1, 1, 0, 1, 0, 1, 2, 1, 1, 2, 1, 1, 2, 1, 0, 1, 0} in ascending order. By setting the weighted value of the target provisional region 5000 to 0, the target provisional region 5000 is excluded, eliminating the influence of these regions on the autofocus operation. In some other embodiments, the weighting value of the target temporary region 5000 is set smaller than the weighting value of the second target focus adjustment evaluation region 6000 to reduce the influence of these regions on the autofocus operation. For example, when wearing glasses, the weighting values of the multiple sub-regions 400 are {1, 1, 1, 0.1, 1, 0.1, 0.1, 0.1, 0.1, 0.1, 2, 0.1, 1, 2, 1, 1, 2, 1, 0.1, 1, 0.1} in ascending numerical order. When not wearing glasses, the weighting values of the multiple sub-regions 400 are {1, 1, 1, 1, 1, 0.1, 1, 0.1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 0.1, 1, 0.1} in ascending numerical order.
[0050] In some embodiments, the following formula can be used to calculate the focus adjustment evaluation value of the first target focus adjustment evaluation area 1000:
number
number
[0051] In some embodiments, the image captured by the imaging device does not include a facial region. See FIG. 10. FIG. 10 is a schematic diagram illustrating an image without a facial region provided by an embodiment of the present application. As shown in FIG. 10, the captured image does not include a facial region. When the captured image does not include a facial region, the central region of the image is set as a third target focus adjustment evaluation region 3000, and the third target focus adjustment evaluation region 3000 is divided into multiple sub-regions. When calculating the corresponding focus adjustment evaluation value of the third target focus adjustment evaluation region 3000, the weight value of the centrally located sub-region of the third target focus adjustment evaluation region 3000 may be higher than the weight value of the peripherally located sub-regions. For example, the weight values of the multiple sub-regions of the third target focus adjustment evaluation region 3000 gradually decrease outward along the radial direction. In other embodiments, the weight values of the multiple sub-regions of the third target focus adjustment evaluation region 3000 are the same.
[0052] Please refer to FIG. 11. FIG. 11 is a schematic diagram of numbers obtained by numbering the sub-regions of the third target focus adjustment evaluation region 3000 in FIG. 10. As shown in FIG. 11, the numbers of the sub-regions shown in FIG. 11 are 0 to 8. The weight values of the sub-regions are {1, 1, 1, 1, 4, 1, 1, 1, 1} in ascending order of numbers.
[0053] In some embodiments, the focus adjustment evaluation value of the third target focus adjustment evaluation area 3000 can be calculated using the following formula:
number
number
[0054] Please refer to Figure 12. Figure 12 is a flowchart of the subdivision steps in one example of step S31. In some embodiments, as shown in Figure 12, determining whether the face region includes glasses specifically includes the following subdivision steps S311 to S313.
[0055] S311, obtain the minimum contrast value in the plurality of sub-regions 400 and the contrast value of the sub-region 400f adjacent to the eye.
[0056] S312, determining a target detection threshold.
[0057] S313: The ratio between the contrast value of the sub-region 400f adjacent to the eyes and the acquired minimum contrast value is set as the current first contrast ratio, and based on the current first contrast ratio and the target detection threshold, it is determined whether the face region includes glasses.
[0058] In step S311, obtaining the contrast value of the sub-region 400f adjacent to the eyes can be obtaining the contrast value of the sub-region 400h between the eyes (see FIG. 7), or obtaining the contrast value of other sub-regions 400f adjacent to the eyes, such as the sub-regions 400 located above, below, or outside the eyes and adjacent to the eyes. When wearing glasses, the frames of the glasses are usually located between and around the eyes, and increase the contrast value of the sub-region 400. The ratio of the minimum contrast value to the contrast value of the sub-region 400f adjacent to the eyes can be used to determine whether the face region of the captured image includes glasses, i.e., whether the person is wearing glasses.
[0059] Contrast values of a plurality of sub-regions 400 of the first target focus adjustment evaluation region 1000 can be obtained, a minimum contrast value is determined from the plurality of contrast values, and the sub-region 400 corresponding to the minimum contrast value is further determined.
[0060] Please refer to FIG. 13. FIG. 13 is a schematic diagram of an image provided by an embodiment of the present application, collected when the subject is not wearing eyeglasses. By obtaining contrast values of the multiple sub-regions 400, it is determined that the first sub-region 400a has the smallest contrast value, the contrast value of the first sub-region 400a is C1, the contrast value of the sub-region 400h between the eyes is C2, and the first contrast ratio is C2 / C1. Please refer to FIG. 14. FIG. 14 is a schematic diagram of an image provided by an embodiment of the present application, collected when the subject is wearing eyeglasses. By obtaining contrast values of the multiple sub-regions 400, it is determined that the second sub-region 400b has the smallest contrast value, the contrast value of the second sub-region 400b is C3, and the contrast value of the sub-region 400h between the eyes is C4, and the first contrast ratio is C4 / C3.
[0061] The contrast value of the sub-region 400h between the eyes is significantly increased due to the eyeglass frames, and C4 is significantly larger than C2. Therefore, by calculating a first contrast ratio based on the contrast value of the sub-region 400h between the eyes and the minimum contrast value, and comparing the first contrast ratio with a target detection threshold, it is possible to determine whether the eyeglasses are worn.
[0062] The contrast value of the other sub-regions 400f adjacent to the eyes increases due to the eyeglass frames, and a first contrast ratio calculated based on the minimum contrast value and the contrast value of the other sub-regions 400f adjacent to the eyes can also be used to determine whether eyeglasses are worn.
[0063] When determining whether eyeglasses are worn based on the first contrast ratio, the first contrast ratio changes according to the amount of focus deviation. See FIG. 15. FIG. 15 is a schematic diagram illustrating a mapping relationship between focus lens position and first contrast ratio provided by an embodiment of the present application. As shown in FIG. 15, a third curve 500 represents the mapping relationship between focus lens position and first contrast ratio when eyeglasses are worn, and a fourth curve 501 represents the mapping relationship between focus lens position and first contrast ratio when eyeglasses are not worn. As can be seen from the third curve 500 and the fourth curve 501, the first contrast ratio is maximum at the focus lens position 400 near the focus. As the distance from the focus lens position 400 near the focus, i.e., when the focus lens position is smaller or larger than 400, the first contrast ratio decreases. In both the third curve 500 and the fourth curve 501, the first contrast ratio decreases as the distance from the focus lens position 400 near the focus is increased. As can be seen from the third curve 500, when eyeglasses are worn, the first contrast ratio is minimum at focus lens positions 200 and 600, with the minimum value of the first contrast ratio being approximately 20. As can be seen from the fourth curve 501, when eyeglasses are not worn, the first contrast ratio corresponding to focus lens position interval 502 is greater than the minimum first contrast ratio when eyeglasses are worn, i.e., exceeds 20. Therefore, when the focus lens position is within focus lens position interval 502, determining whether eyeglasses are worn based on the first contrast ratio will result in an incorrect determination. To improve the accuracy of detecting whether eyeglasses are worn, in the embodiments of the present application, the amount of focus deviation is used as the basis for the determination to accurately determine whether eyeglasses are worn.
[0064] In an embodiment of the present application, the amount of focus deviation is determined based on the second contrast ratio and a preset ratio value. The second contrast ratio is the ratio of the contrast values between the sub-region 400 with the maximum contrast value and the sub-region 400 with the minimum contrast value. See FIGS. 16 and 17. FIG. 16 is a schematic diagram of an image taken without wearing glasses, as provided in an embodiment of the present application. FIG. 17 is a schematic diagram of an image taken with wearing glasses, as provided in an embodiment of the present application. As shown in FIG. 16, by obtaining the contrast values of the multiple sub-regions 400, it is determined that the first sub-region 400a has the smallest contrast value, and the contrast value of the first sub-region 400a is C1. The contrast value of the sub-region 400e where the eyes are located is the largest, and the contrast value of the sub-region 400e where the eyes are located is C5. The second contrast ratio is C5 / C1. As shown in FIG. 17, by obtaining the contrast values of multiple sub-regions 400, it is determined that the second sub-region 400b has the smallest contrast value, and the contrast value of the second sub-region 400b is C3; the sub-region 400e where the eyes are located has the largest contrast value, and the contrast value of the sub-region 400e where the eyes are located is C6; and the second contrast ratio is C6 / C3.
[0065] Please refer to FIG. 18. FIG. 18 is a schematic diagram illustrating the mapping relationship between the focus lens position and the second contrast ratio provided by an embodiment of the present application. As shown in FIG. 18, a fifth curve 600 represents the mapping relationship between the focus lens position and the second contrast ratio when wearing eyeglasses, and a sixth curve 601 represents the mapping relationship between the focus lens position and the second contrast ratio when not wearing eyeglasses. Because the contrast value C5 of the sub-region 400e where the eyes are located is large even when not wearing eyeglasses, the second contrast ratio has a smaller difference between the contrast ratio when wearing eyeglasses and the contrast ratio when not wearing eyeglasses than the first contrast ratio. As shown in FIG. 18, the difference between the fifth curve 600 and the sixth curve 601 is smaller than the difference between the third curve 500 and the fourth curve 501.
[0066] In some embodiments, the preset ratio value is greater than the maximum first contrast ratio in the mapping relationship between the focus lens position and the first contrast ratio when the eyeglasses are not worn and less than the maximum first contrast ratio in the mapping relationship between the focus lens position and the first contrast ratio when the eyeglasses are worn. For example, the maximum first contrast ratio in the fourth curve 501 is Cmax, and the maximum first contrast ratio in the mapping relationship between the focus lens position and the first contrast ratio when the eyeglasses are not worn is Cmax. In some embodiments, the preset ratio value is greater than Cmax and less than or equal to 80.
[0067] 18, the preset ratio value 602 is 60. In other embodiments, the preset ratio value 602 can be set to other values as needed and is not limited here.
[0068] When the second contrast ratio is equal to or smaller than a preset ratio value, the amount of defocus is large, and when the second contrast ratio is larger than the preset ratio value, the amount of defocus is small.
[0069] Please refer to Figure 19. Figure 19 is a flowchart of the subdivision steps in one example of step S322. In some embodiments, as shown in Figure 19, determining the target detection threshold specifically includes the following subdivision steps S3221 to S3223.
[0070] S3221: determining a first detection threshold corresponding to a large amount of defocus and a second detection threshold corresponding to a small amount of defocus;
[0071] S3222: Determine the current defocus amount of the imaging device based on the first target focus adjustment evaluation area 1000.
[0072] In step S3223, one of the first detection threshold and the second detection threshold is selected as a target detection threshold according to the current amount of defocus of the imaging device.
[0073] When the amount of defocus of the imaging device is small, the first detection threshold is selected as the target detection threshold, and when the amount of defocus of the imaging device is large, the second detection threshold is selected as the target detection threshold.
[0074] In the embodiments of the present application, detection thresholds corresponding to different amounts of focus deviation are determined, and the corresponding detection threshold is selected according to the amount of focus deviation of the current imaging device to determine whether or not glasses are being worn. This makes it possible to determine whether or not glasses are being worn based on the actual conditions of the current imaging device, thereby improving the accuracy of determining whether glasses are being worn.
[0075] Please refer to Figure 20. Figure 20 is a flowchart of a subdivision step in one example of step S3222. In some embodiments, as shown in Figure 20, determining the focus deviation amount of the current imaging device based on the first target focus adjustment evaluation area 1000 specifically includes the following subdivision steps S32221 to S32222.
[0076] S32221, the maximum contrast value in the plurality of sub-regions 400 is obtained.
[0077] S32222: The ratio between the acquired maximum contrast value and the minimum contrast value is set as the current second contrast ratio, and the current amount of focus deviation of the imaging device is determined based on the current second contrast ratio and a preset ratio value.
[0078] If the ratio between the maximum contrast value and the minimum contrast value in the plurality of sub-regions 400 is smaller than a preset ratio value, it is determined that the current image capture device is out of focus, and the second detection threshold is selected as the target detection threshold. If the ratio between the maximum contrast value and the minimum contrast value in the plurality of sub-regions 400 is equal to or greater than the preset ratio value, it is determined that the current image capture device is out of focus, and the first detection threshold is selected as the target detection threshold.
[0079] In some embodiments, determining the first detection threshold corresponding to a large amount of defocus and the second detection threshold corresponding to a small amount of defocus includes determining the first detection threshold and the second detection threshold based on a predetermined ratio value, a first mapping relationship, a second mapping relationship, and a third mapping relationship.
[0080] The first mapping relationship includes a mapping relationship between the focus lens position and the second contrast ratio. As described above, the second contrast ratio is the ratio between the maximum contrast value and the minimum contrast value, as shown in the fifth curve 600 and the sixth curve 601 in FIG. 18. The second mapping relationship includes a mapping relationship between the focus lens position and the first contrast ratio when eyeglasses are present, as shown in the third curve 500 in FIG. 15. The third mapping relationship includes a mapping relationship between the focus lens position and the first contrast ratio when eyeglasses are not present, as shown in the fourth curve 501 in FIG. 15. As described above, the first contrast ratio is the ratio between the minimum contrast value and the contrast value of the subregion 400f adjacent to the eye.
[0081] In some embodiments, determining the first detection threshold and the second detection threshold based on the preset ratio value, the first mapping relationship, the second mapping relationship, and the third mapping relationship described above includes: dividing a focus lens position range defined in the first mapping relationship into a first focus lens position range and a second focus lens position range, wherein the first focus lens position range is a focus lens position range corresponding to a second contrast ratio in the first mapping relationship that is equal to or greater than a preset ratio value, and the second focus lens position range is a focus lens position range corresponding to a second contrast ratio in the first mapping relationship that is smaller than the preset ratio value; determining a minimum first contrast ratio in a first contrast ratio range corresponding to a first focus lens position range in the second mapping relationship, and determining a maximum first contrast ratio in the first contrast ratio range corresponding to the first focus lens position range in the third mapping relationship, wherein one first contrast ratio is selected within a range that is smaller than the minimum first contrast ratio of the third curve 500 and larger than the maximum first contrast ratio of the fourth curve 501, as a first detection threshold; determining a minimum first contrast ratio in a first contrast ratio range corresponding to a second focus lens position range in the second mapping relationship, and determining a maximum first contrast ratio in the first contrast ratio range corresponding to the second focus lens position range in the third mapping relationship, wherein one first contrast ratio within a range smaller than the minimum first contrast ratio of the third curve 500 and larger than the maximum first contrast ratio of the fourth curve 501 is selected as a second detection threshold.
[0082] A first focus lens position range and a second focus lens position range can be determined based on the mapping relationship between the focus lens position and the second contrast ratio when the eyeglasses are worn. As shown in FIG. 18 , the preset ratio value 602 is 60. In the fifth curve 600, when the second contrast ratio is 60, the corresponding focus lens positions are P1 and P2. The first focus lens position range is obtained by combining focus lens positions greater than or equal to P1 and less than or equal to P2, and the second contrast ratio corresponding to the first focus lens position range is greater than or equal to 60. The second focus lens position range is obtained by combining focus lens positions less than P1 with focus lens positions greater than P2, and the second contrast ratio corresponding to the second focus lens position range is less than 60.
[0083] A first focus lens position range and a second focus lens position range can be determined based on the mapping relationship between the focus lens position and the second contrast ratio when the user is not wearing glasses. As shown in FIG. 18 , the preset ratio value 602 is 60. In the sixth curve 601, when the second contrast ratio is 60, the corresponding focus lens positions are P3 and P4. The first focus lens position range is obtained by combining focus lens positions greater than or equal to P3 and less than or equal to P4, and the second contrast ratio corresponding to the first focus lens position range is greater than or equal to 60. The second focus lens position range is obtained by combining focus lens positions less than P3 with focus lens positions greater than P4, and the second contrast ratio corresponding to the second focus lens position range is less than 60.
[0084] A first focus lens position range and a second focus lens position range are determined based on the mapping relationship between the focus lens position and the second contrast ratio when the eyeglasses are worn, and a first detection threshold and a second detection threshold are determined based on the first focus lens position range and the second focus lens position range. See FIG. 21. FIG. 21 is a schematic diagram illustrating a first focus lens position range and a second focus lens position range provided by an embodiment of the present application. As shown in FIG. 21, in the third curve 500, when the focus lens position is greater than P1 and less than P2, the corresponding minimum first contrast ratio is C5. In the fourth curve 501, when the focus lens position is greater than P1 and less than P2, the corresponding maximum first contrast ratio is C6. A first contrast ratio greater than C6 and less than C5 is selected as the first detection threshold. In the third curve 500, when the focus lens position is less than P1 or greater than P2, the corresponding minimum first contrast ratio is C7. In the fourth curve 501, when the focus lens position is equal to or less than P1 or equal to or greater than P2, the corresponding maximum first contrast ratio is C8. A first contrast ratio greater than C8 and less than C7 is selected as the second detection threshold. See FIG. 22. FIG. 22 is a schematic diagram illustrating the first detection threshold and the second detection threshold provided by an embodiment of the present application. FIG. 22 illustrates the first detection threshold and the second detection threshold.
[0085] Based on the mapping relationship between the focus lens position and the second contrast ratio when the eyeglasses are not worn, a first focus lens position range and a second focus lens position range can be determined. See FIG. 23. FIG. 23 is a schematic diagram illustrating a first focus lens position range and a second focus lens position range provided by another embodiment of the present application. As shown in FIG. 23, in the third curve 500, when the focus lens position is greater than or equal to P3 and less than or equal to P4, the corresponding minimum first contrast ratio is C9. In the fourth curve 501, when the focus lens position is greater than or equal to P3 and less than or equal to P4, the corresponding maximum first contrast ratio is C6. A first contrast ratio greater than C6 and less than C9 is selected as the first detection threshold. In the third curve 500, when the focus lens position is less than or equal to P3 or greater than or equal to P4, the corresponding minimum first contrast ratio is C7. In the fourth curve 501, when the focus lens position is less than or equal to P3 or greater than or equal to P4, the corresponding maximum first contrast ratio is C10. A first contrast ratio greater than C10 and less than C7 is selected as the second detection threshold. Figure 24 is a schematic diagram illustrating the first detection threshold and the second detection threshold provided by another embodiment of the present application. Figure 24 shows the first detection threshold and the second detection threshold.
[0086] In some embodiments, the first detection threshold shown in FIG. 24 is equal to the first detection threshold shown in FIG. 22, and the second detection threshold shown in FIG. 24 is equal to the second detection threshold shown in FIG.
[0087] In some embodiments, determining whether the face region includes eyeglasses based on the current first contrast ratio and the target detection threshold includes determining that the face region does not include eyeglasses if the first contrast ratio is greater than the target detection threshold, and determining that the face region does not include eyeglasses if the first contrast ratio is less than the target detection threshold.
[0088] When the amount of defocus is small, a first detection threshold is selected as the target detection threshold, and when the first contrast ratio is greater than the first detection threshold, the face region includes glasses, i.e., the person is wearing glasses, and when the first contrast ratio is less than the first detection threshold, the face region does not include glasses, i.e., the person is not wearing glasses.
[0089] When the amount of defocus is large, a second detection threshold is selected as the target detection threshold, and when the first contrast ratio is greater than the second detection threshold, the face region includes glasses, i.e., the person is wearing glasses, and when the first contrast ratio is less than the second detection threshold, the face region does not include glasses, i.e., the person is not wearing glasses.
[0090] In some embodiments, determining whether the face region includes eyeglasses includes obtaining photographic information, and determining whether the face region includes eyeglasses only if it is determined based on the photographic information that the photographic environment is low-light.
[0091] The shooting information may include a brightness value (BV) and / or a gain value of the image sensor unit of the image capture device. The brightness value can directly determine whether the shooting environment is low-illuminance. In addition, since the gain value of the image sensor unit increases in a low-illuminance shooting environment, it can be determined whether the shooting environment is low-illuminance based on the magnitude of the gain value.
[0092] In low-light shooting environments, light reflection cannot be ignored, and the impact of light reflection from glasses on automatic focus adjustment operation is even greater in low-light conditions. Therefore, it is preferable to determine whether glasses are being worn only in low-light conditions, which not only significantly improves the focus accuracy in low-light conditions, but also simplifies the automatic focus adjustment steps in high-light shooting environments, improving the efficiency of automatic focus adjustment.
[0093] In technologies related to autofocus adjustment, changes in the angle of view caused by movement of the focus lens also affect the autofocus adjustment operation. In Patent Document 2 (JP 2008-42405 A), in response to the issue of changes in the photographic angle of view caused by movement of the focus lens during focus adjustment control, the change in the angle of view of an image photographed at a focus lens position on the close-up side, where the angle of view is wider, is corrected using infinity, where the angle of view is the narrowest, as a reference.
[0094] However, when performing autofocus processing, the focus adjustment evaluation area on the image sensor that was set before the autofocus operation started deviates from the actual subject due to a change in the angle of view caused by movement of the focus lens.
[0095] Please refer to FIG. 25. FIG. 25 is a schematic diagram of a change in the angle of view caused by movement of the focus lens in the related art. As shown in FIG. 25, before the autofocus operation starts, the initial position of the subject on the image is a first position 4000. After that, when the autofocus operation starts and the focus lens moves, the angle of view changes, and the position of the subject on the image moves along the arrows shown in FIG. 25 to a second position 4001, i.e., a shift occurs. The change in the angle of view caused by movement of the focus lens is similar to the state in which an image expands or contracts in a radial direction from the image center 1103 to the image periphery. The closer the subject is to the image periphery, the greater the shift. When a face area is not located at the image center 1103, the farther the position of the face area is from the image center 1103, the greater the effect of the change in the angle of view. Even if a face is detected at the first position 4000 and a corresponding focus adjustment evaluation area 1000a is set, the face area moves to a second position 4001 on the image due to movement of the focus lens, resulting in a shift from the first position 4000. After the positional deviation occurs, the corresponding focus adjustment evaluation area 1000b also deviates from the focus adjustment evaluation area 1000a. Therefore, the calculation of the focus adjustment evaluation value of the first target focus adjustment evaluation area 1000 is affected, which may reduce the accuracy of automatic focus adjustment.
[0096] In the embodiments of the present application, by taking into consideration the effect that a change in the angle of view due to movement of the focus lens has on the calculation of the focus adjustment evaluation value, the effect that a change in the angle of view has on the automatic focus adjustment operation can be reduced, which is particularly effective when the subject is not located at the center of the image.
[0097] Please refer to Fig. 26. Fig. 26 is a flowchart of the subdivision steps in another example of step S2. In some embodiments, as shown in Fig. 26, when the collected image includes a face region, determining the first target focus adjustment evaluation region specifically includes the following subdivision steps S25 to S26.
[0098] S25, if the image captured at the current focus lens position contains a face region, determine a focus adjustment evaluation region corresponding to the current focus lens position.
[0099] S26: Based on the position of the focus adjustment evaluation area at the current focus lens position, the positions of the focus adjustment evaluation area at the first preset focus lens position and the second preset focus lens position are determined, and the overlapping area between the focus adjustment evaluation area corresponding to the first preset focus lens position and the focus adjustment evaluation area corresponding to the second preset focus lens position is set as a first target focus adjustment evaluation area 1000.
[0100] The angle of view at the first preset focus lens position is larger than the angle of view at the current focus lens position, and the angle of view at the second preset focus lens position is smaller than the angle of view at the current focus lens position.
[0101] The angle of view of the first preset focus lens position can be the maximum angle of view of the imaging device, and the angle of view of the second preset focus lens position can be the minimum angle of view of the imaging device.
[0102] The movement position of the face area on the image can be calculated from the initial focus lens position and the movement range of the focus lens during automatic focus adjustment, based on data provided by the lens manufacturer or data measured in advance. That is, the position of the face area at the first preset focus lens position and the position of the face area at the second preset focus lens position can be calculated from the current focus lens position and the movement range of the focus lens, based on data provided by the lens manufacturer or data measured in advance.
[0103] Please refer to FIG. 27. FIG. 27 is a schematic diagram showing focus adjustment evaluation areas corresponding to a first preset focus lens position and a second preset focus lens position provided by an embodiment of the present application. As shown in FIG. 27, the position of the object on the image at the current focus lens position is a third position 1100, the position of the object on the image at the first preset focus lens position is a fourth position 1101, and the position of the object on the image at the second preset focus lens position is a fifth position 1102. Based on the image in which the object is at the third position 1100, a focus adjustment evaluation area 1000c at the current focus lens position is determined, and further, a focus adjustment evaluation area 1000d at the first preset focus lens position and a focus adjustment evaluation area 1000e at the second preset focus lens position are determined. An overlapping area 1107 between the focus adjustment evaluation area 1000d at the first preset focus lens position and the focus adjustment evaluation area 1000e at the second preset focus lens position is defined as the first target focus adjustment evaluation area 1000.
[0104] In this way, even when the angle of view changes due to movement of the focus lens, the first target focus adjustment evaluation area 1000 will not move away from the face area, and the impact of changes in the angle of view on the automatic focus adjustment operation can be reduced, thereby reducing the impact on the accuracy of the automatic focus adjustment.
[0105] Before determining the positions of the focus adjustment evaluation area at the first preset focus lens position and the second preset focus lens position, the autofocus control method further includes determining whether the face area is located in a central area of the image based on the image captured at the current focus lens position. Determining the positions of the focus adjustment evaluation area at the first preset focus lens position and the second preset focus lens position based on the position of the focus adjustment evaluation area at the current focus lens position includes, if the face area is located outside the central area of the image captured at the current focus lens position, determining the positions of the focus adjustment evaluation area at the first preset focus lens position and the second preset focus lens position based on the position of the focus adjustment evaluation area at the current focus lens position.
[0106] When the face area is not in the central area of the image, the accuracy of the autofocus adjustment can be significantly improved by taking into account the effect of changes in the angle of view on the autofocus adjustment operation.
[0107] When wearing eyeglasses, if the angle of view changes due to movement of the focus lens, the position of the eyeglasses region 2000 shifts, affecting the automatic focus adjustment operation. In the embodiment of the present application, by taking into consideration the effect that a change in the angle of view due to movement of the focus lens has on the position of the eyeglasses region 2000, it is possible to reduce the effect on the calculation of the focus adjustment evaluation value, and ultimately to reduce the effect that a change in the angle of view has on the automatic focus adjustment operation.
[0108] Please refer to Fig. 28. Fig. 28 is a subdivision step flowchart in another example of step S3. In some embodiments, as shown in Fig. 28, determining the target provisional area 5000 in the first target focus adjustment evaluation area 1000 specifically includes the following subdivision steps S31 to S33.
[0109] S31: determining a focus adjustment evaluation area at the current focus lens position and a temporary area in the focus adjustment evaluation area based on an image captured at the current focus lens position;
[0110] S32: Based on the position of the temporary area at the current focus lens position, the positions of the temporary area at the first preset focus lens position and the second preset focus lens position are determined.
[0111] S33: The overlap area between the area including the provisional area corresponding to the current focus lens position, the provisional area corresponding to the first preset focus lens position, and the provisional area corresponding to the second preset focus lens position and the first target focus adjustment evaluation area 1000 is defined as the target provisional area 5000.
[0112] Please refer to FIGS. 29 and 30. FIG. 29 is a schematic diagram of the eyeglasses region 2000 shifting when the focus lens moves, according to an embodiment of the present application. FIG. 30 is a schematic diagram of an enlarged view of the object shown in FIG. 29. As shown in FIG. 30, the position of the object on the image at the current focus lens position is the sixth position 1200, the position of the object on the image at the first preset focus lens position is the seventh position 1201, and the position of the object on the image at the second preset focus lens position is the eighth position 1202. Based on the image in which the object is at the sixth position 1200, a focus adjustment evaluation region at the current focus lens position is determined, and eyeglasses region 2000a at the current focus lens position is further determined. Based on eyeglasses region 2000a at the current focus lens position, eyeglasses region 2000b at the first preset focus lens position and eyeglasses region 2000c at the second preset focus lens position are determined. Region 1206 including glasses region 2000a at the current focus lens position, glasses region 2000b at the first preset focus lens position, and glasses region 2000c at the second preset focus lens position is as shown in Fig. 30. For ease of explanation, Fig. 30 shows the region including glasses region 2000a at the current focus lens position, glasses region 2000b at the first preset focus lens position, and glasses region 2000c at the second preset focus lens position as a rectangle, but in some other embodiments, the region including glasses region 2000a at the current focus lens position, glasses region 2000b at the first preset focus lens position, and glasses region 2000c at the second preset focus lens position can have other shapes.
[0113] In this way, even when the angle of view changes due to movement of the focus lens, the glasses area 2000 will not come off the glasses, and the impact of the change in angle of view on the automatic focus adjustment operation can be reduced, so the impact on the accuracy of the automatic focus adjustment can also be reduced.
[0114] In some embodiments, before determining the temporary regions at the first preset focus lens position and the second preset focus lens position, the autofocus control method further includes determining whether the face region is located in a central region of the image based on an image captured at the current focus lens position. Determining the positions of the temporary regions at the first preset focus lens position and the second preset focus lens position based on the position of the temporary region at the current focus lens position includes, if the face region is located outside the central region of the image captured at the current focus lens position, determining the positions of the temporary regions at the first preset focus lens position and the second preset focus lens position based on the position of the temporary region at the current focus lens position.
[0115] In some embodiments, the overlapping region 1107 is set as the first target focus adjustment evaluation region 1000, and then a target provisional region 5000 and a second target focus adjustment evaluation region 6000 of the overlapping region 1107 are determined, and a focus adjustment evaluation value of the overlapping region 1107 can be calculated. The target provisional region 5000 of the overlapping region 1107 is determined by the above-described steps S31 to S33, and then the second target focus adjustment evaluation region 6000 is determined.
[0116] Please refer to FIG. 31. FIG. 31 is a schematic diagram of the target provisional region 5000 and the second target focus adjustment evaluation region 6000 of the overlap region 1107 provided by an embodiment of the present application. As shown in FIG. 31, FIG. 31 shows the region 1206 including the focus adjustment evaluation region 1000c at the current focus lens position, the glasses region 2000a at the current focus lens position, the glasses region 2000b at the first preset focus lens position, and the glasses region 2000c at the second preset focus lens position, and the overlap region 1107. The portion of the region 1206 in the overlap region 1107 is the target provisional region 5000 of the overlap region 1107, and the region of the overlap region 1107 excluding the target provisional region 5000 is the second target focus adjustment evaluation region 6000 of the overlap region 1107.
[0117] When calculating the focus adjustment evaluation value of the overlapping area 1107, the target provisional area 5000 of the overlapping area 1107 is excluded or the weight value of the target provisional area 5000 of the overlapping area 1107 is reduced to calculate the focus adjustment evaluation value of the overlapping area 1107. For specific calculation methods, refer to the method for calculating the focus adjustment evaluation value described above.
[0118] In technologies related to automatic focus adjustment, changes in brightness caused by movement of the focus lens also affect the automatic focus adjustment operation. Patent document (JP 2011-175119 A) discloses a method of correcting the focus adjustment evaluation value by calculating a correction coefficient that is the ratio of a focus adjustment evaluation value (contrast value) that is a reference brightness value to an acquired brightness evaluation value.
[0119] However, when correcting the focus adjustment evaluation value for brightness changes caused by movement of the focus lens, a different correction is required for a low-illuminance or low-contrast subject where noise components cannot be ignored.Patent document (JP 2009-237327 A) discloses a method of calculating the focus adjustment evaluation value by dividing the contrast value by the square root of the brightness value (integrated value) in order to reduce the influence of noise (optical shot noise) mixed into image data.
[0120] Please refer to FIG. 32. FIG. 32 is a schematic diagram showing the mapping relationship between focus lens position, luminance value, and focus adjustment evaluation value in the related art. As shown in FIG. 32, a seventh curve 1301 shows the mapping relationship between focus lens position and focus adjustment evaluation value, and an eighth curve 1300 shows the mapping relationship between focus lens position and luminance value. As can be seen from the eighth curve 1300 and the seventh curve 1301, when the focus lens moves, the luminance value changes, and the focus adjustment evaluation value also changes accordingly. In the seventh curve 1301, the focus adjustment evaluation value at focus lens position 200 is larger than the focus adjustment evaluation value at focus lens position 400, which is estimated to be the in-focus position, making it difficult to obtain the peak position of the focus adjustment evaluation value, which corresponds to the in-focus position.
[0121] In the embodiment of the present application, when correcting the focus adjustment evaluation value by taking into account changes in image luminance due to movement of the focus lens, the accuracy of automatic focus adjustment is improved by correcting the focus adjustment evaluation value using different methods for normal illuminance and low illuminance, which is particularly effective when the subject is a low-contrast face.
[0122] Please refer to FIG. 33. FIG. 33 is a flowchart of subdivision steps in one example of step S6. In some embodiments, as shown in FIG. 33, calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on the contrast value at each focus lens position in at least the second target focus adjustment evaluation area 6000 specifically includes the following subdivision steps S61 and S62.
[0123] S61: Based on the brightness value at each focus lens position in the second target focus adjustment evaluation area 6000, the contrast value of the second target focus adjustment evaluation area 6000 is corrected to obtain a contrast correction value at each focus lens position in the second target focus adjustment evaluation area 6000.
[0124] S62: Based on the contrast correction value at each focus lens position in at least the second target focus adjustment evaluation area 6000, a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area is calculated.
[0125] Correcting the contrast value of the second target focus adjustment evaluation area 6000 based on the brightness value at each focus lens position of the second target focus adjustment evaluation area 6000 to obtain a contrast correction value at each focus lens position of the second target focus adjustment evaluation area 6000 specifically includes correcting the contrast value of each sub-area 400 of the second target focus adjustment evaluation area 6000 based on the brightness value of the sub-area 400 to obtain a contrast correction value for the sub-area 400.
[0126] The automatic focus adjustment control method further includes obtaining contrast values and brightness values at each focus lens position of the target provisional area 5000 of the image collected at each focus lens position, correcting the contrast value of the target provisional area 5000 based on the brightness value at each focus lens position of the target provisional area 5000, and obtaining a contrast correction value at each focus lens position of the target provisional area 5000.
[0127] Correcting the contrast value of the target provisional area 5000 based on the brightness value at each focus lens position of the target provisional area 5000 to obtain a contrast correction value at each focus lens position of the target provisional area 5000 includes correcting the contrast value of each sub-area 400 of the target provisional area 5000 based on the brightness value of the sub-area 400 to obtain a contrast correction value for the sub-area 400.
[0128] Calculating corresponding focus adjustment evaluation values at each focus lens position of the first target focus adjustment evaluation area based on the contrast correction values at each focus lens position of at least the second target focus adjustment evaluation area 6000 includes calculating corresponding focus adjustment evaluation values at each focus lens position of the first target focus adjustment evaluation area based on the contrast correction values at each focus lens position of the second target focus adjustment evaluation area 6000 and the contrast correction values at each focus lens position of the target provisional area 5000, wherein the weighted value of the contrast correction value of the target provisional area 5000 is smaller than the weighted value of the contrast correction value of the second target focus adjustment evaluation area 6000.
[0129] The autofocus control method further includes obtaining shooting information of the imaging device, determining the illuminance of the shooting environment based on the shooting information, and determining a target correction method based on the illuminance of the shooting environment.
[0130] As described above, the illuminance of the shooting environment can be determined by the brightness value (BV) and / or the gain value of the image sensor unit of the imaging device. If the illuminance of the shooting environment is within a first preset illuminance range, the illuminance of the shooting environment is determined to be normal illuminance, and if the illuminance of the shooting environment is within a second preset illuminance range, the illuminance of the shooting environment is determined to be low illuminance. Values within the second preset illuminance range are smaller than values within the first preset illuminance range.
[0131] Correcting the contrast value of the second target focus adjustment evaluation area 6000 based on the brightness value at each focus lens position of the second target focus adjustment evaluation area 6000 includes correcting the contrast value of the second target focus adjustment evaluation area 6000 using a target correction method based on the brightness value at each focus lens position of the second target focus adjustment evaluation area 6000.
[0132] Correcting the contrast value of the target provisional area 5000 based on the brightness value at each focus lens position of the target provisional area 5000 includes correcting the contrast value of the target provisional area 5000 using a target correction method based on the brightness value at each focus lens position of the target provisional area 5000.
[0133] Determining the target correction manner based on the illuminance of the shooting environment includes determining that when the illuminance of the shooting environment is within a first predetermined illuminance range, the target correction manner is to perform correction based on a first correction formula, where the first correction formula is as follows:
number
[0134] In the first correction formula, the contrast value is the contrast value of the second target focus adjustment evaluation area 6000 or the provisional target area 5000 before correction, and the brightness value is the brightness value of the second target focus adjustment evaluation area 6000 or the provisional target area 5000.
[0135] Determining the target correction manner based on the illuminance of the shooting environment includes determining that when the illuminance of the shooting environment is within a second predetermined illuminance range, the target correction manner is to perform correction based on a second correction formula, where the second correction formula is as follows:
number
[0136] In the second correction formula, the contrast value is the contrast value of the second target focus adjustment evaluation area 6000 or the provisional target area 5000 before correction, and the brightness value is the brightness value of the second target focus adjustment evaluation area 6000 or the provisional target area 5000.
[0137] When calculating the focus adjustment evaluation value, the contrast correction value is used as the contrast value of the formula for calculating the focus adjustment evaluation value described above, and the corrected focus adjustment evaluation value is calculated. That is,
number
[0138] Please refer to FIG. 34. FIG. 34 is a schematic diagram of the focus adjustment evaluation value after correction using the first correction formula provided by the embodiment of the present application. As shown in FIG. 34, a ninth curve 1304 indicates the mapping relationship between the focus lens position and the focus adjustment evaluation value after correction using the first correction formula. As can be seen from the ninth curve 1304, after correction, the focus adjustment evaluation value can be made horizontal, and the peak position, which is the focus position, can be accurately obtained.
[0139] In some embodiments, in low-light shooting environments where noise components are not negligible, correction using the second correction formula is necessary. See FIG. 35. FIG. 35 is a schematic diagram of a focus adjustment evaluation value after correction using the second correction formula provided by an embodiment of the present application. As shown in FIG. 35, the tenth curve 1307 indicates the mapping relationship between the focus lens position and the focus adjustment evaluation value after correction using the first correction formula in a low-light shooting environment. As can be seen from the tenth curve 1307, in low-light conditions, after correction using the first correction formula, the focus adjustment evaluation value is over-corrected and not level. After correction using the second correction formula, the mapping relationship between the focus lens position and the focus adjustment evaluation value is as shown in the eleventh curve 1308. After correction using the second correction formula, the focus adjustment evaluation value can be leveled, and the peak position, which is the focus position, can be accurately obtained.
[0140] Please refer to Fig. 36. Fig. 36 is a schematic diagram showing the structure of an imaging device 1 provided by an embodiment of the present application. As shown in Fig. 36, the imaging device 1 includes an imaging element unit 10, an optical lens unit 20, a lens driving unit 30, an image data generation unit 40, a face detection processing unit 50, an automatic focus adjustment unit 60, an image signal processing unit 70, and a focus adjustment evaluation value calculation unit 80.
[0141] The optical lens unit 20 includes a focus lens, which is used to focus light from a subject onto the image sensor unit 10 .
[0142] The lens driving unit 30 is used to drive the focus lens in order to adjust the position of the focus lens. The lens driving unit 30 drives the focus lens of the optical lens unit 20 based on the focus lens position data output from the automatic focus adjustment unit 60.
[0143] The image sensor unit 10 is used to convert an optical signal into an image signal, generate raw data for each pixel according to an optical image of a subject, and output the raw data to the image signal processing unit .
[0144] The image signal processing unit 70 performs image processing such as shading correction, exposure, white balance, and calculation of contrast and brightness values for the plurality of sub-regions 400. The contrast value is calculated for each of the plurality of sub-regions 400 based on a signal of high frequency components extracted through a predetermined filter. The brightness value is calculated based on the sum of the pixel values of each sub-region 400.
[0145] The image data generating unit 40 is used to output an image based on the image signal, thus collecting the image. Specifically, the image data generating unit 40 performs predetermined signal processing on the data of each pixel to generate image data and output it to the outside.
[0146] The face detection processing unit 50 is used to detect various face feature data based on the image data output from the image data generating unit 40 and identify face areas in the collected images.
[0147] The focus adjustment evaluation value calculation unit 80 is used to calculate a focus adjustment evaluation value by using the contrast value, brightness value, etc. of each sub-region 400 through various correction processes and weighted calculation processes.
[0148] The automatic focus adjustment unit 60 is used to set a first target focus adjustment evaluation area 1000 and a target provisional area 5000, perform automatic focus adjustment operation processing based on the focus adjustment evaluation value, and output focus lens position data to the lens driving unit 30.
[0149] In some embodiments, the autofocus unit 60 is used to determine a first target focus adjustment evaluation area 1000 when the captured image includes a face area, and the first target focus adjustment evaluation area 1000 and the face area at least partially overlap. The autofocus unit 60 is further used to determine a target temporary area 5000 in the first target focus adjustment evaluation area 1000. The image signal processing unit 70 is used to acquire contrast values at each focus lens position of the second target focus adjustment evaluation area 6000 of the image captured at each focus lens position. The focus adjustment evaluation value calculation unit 80 is used to calculate corresponding focus adjustment evaluation values at each focus lens position of the first target focus adjustment evaluation area 1000 based on at least the contrast values at each focus lens position of the second target focus adjustment evaluation area 6000, thereby acquiring focus adjustment evaluation values for each focus position. The autofocus unit 60 is further used to determine a target focus position based on the focus adjustment evaluation values for each focus position. The lens driver 30 is further used to adjust the position of the focus lens to a target focus position.
[0150] The imaging device 1 and the autofocus control method correspond to each other, and more specifically, the contents of each embodiment of the autofocus control method can be referenced, and the contents of the imaging device 1 and the autofocus control method can be cross-referenced.
[0151] An embodiment of the present invention further provides a storage medium. The storage medium stores a computer program, and a processor can call and execute the computer program to realize the autofocus control method provided by any one of the above-described embodiments. The storage medium may be a computer-readable storage medium. The computer-readable storage medium may be a storage medium such as an access disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0152] Although the above-described embodiments of the methods are described as a series of combinations of operations for ease of description, those skilled in the art should recognize that the present application is not limited by the described order of operations, since some steps may be performed in other orders or simultaneously. Next, those skilled in the art should recognize that the embodiments described herein are all preferred embodiments, and related operations and modules are not necessarily required for the present application.
[0153] In the above-described 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.
[0154] Although examples of the present application have been illustrated and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these examples without departing from the principles and spirit of the present application, and that the scope of the present application is limited by the claims.
Claims
1. An automatic focus adjustment control method applied to an imaging device including a focus lens, comprising: capturing an image of the subject at a current focus lens position; determining a first target focus adjustment evaluation area when the captured image includes a face region, wherein the first target focus adjustment evaluation area and the face region at least partially overlap; determining a target provisional area in the first target focus adjustment evaluation area, wherein the first target focus adjustment evaluation area includes the target provisional area and a second target focus adjustment evaluation area excluding the target provisional area, and the target provisional area includes at least one of an eye area, an eyeglass area, and a tooth area; adjusting a focus lens position and capturing an image of the subject after the adjustment; Obtaining a contrast value at each focus lens position of the second target focus adjustment evaluation area of the image collected at each focus lens position; Calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast value at each focus lens position in at least the second target focus adjustment evaluation area, thereby acquiring a focus adjustment evaluation value for each focus position; determining a target focus position based on the focus adjustment evaluation value for each focus position, and adjusting the position of the focus lens to the target focus position; An automatic focus adjustment control method comprising:
2. The automatic focus adjustment control method includes: obtaining a contrast value at each focus lens position of the target interim area of the image captured at each focus lens position; Calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast value at each focus lens position in at least the second target focus adjustment evaluation area, calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast value at each focus lens position in the second target focus adjustment evaluation area and a contrast value at each focus lens position in the target provisional area, a weighted value of the contrast value of the target provisional area is smaller than a weighted value of the contrast value of the second target focus adjustment evaluation area; 2. The autofocus control method according to claim 1.
3. Before determining the tentative target area in the first target focus adjustment evaluation area, the automatic focus adjustment control method further includes determining whether the face area includes eyeglasses; Determining a target provisional area in the first target focus adjustment evaluation area includes: If the face region includes glasses, determining that the target provisional region includes a glasses region; determining that the target provisional region includes an eye region if the face region does not include eyeglasses; Including, 2. The autofocus control method according to claim 1.
4. Determining the first target focus adjustment evaluation area includes: identifying features of the facial region, the features including at least one of the eyes, nose, and mouth; determining the first target focus adjustment evaluation area based on at least the position of the feature, and dividing the first target focus adjustment evaluation area into a plurality of sub-areas; Including, 4. The autofocus control method according to claim 3.
5. Determining whether the face region includes eyeglasses includes: obtaining a minimum contrast value in the plurality of sub-regions and a contrast value in a sub-region adjacent to the eye; determining a target detection threshold; determining whether the face region includes eyeglasses based on a current first contrast ratio, the ratio of a contrast value of a subregion adjacent to the eyes to the acquired minimum contrast value, and the current first contrast ratio and the target detection threshold; Including, 5. The autofocus control method according to claim 4.
6. determining the target detection threshold determining a first detection threshold corresponding to a large amount of defocus and a second detection threshold corresponding to a small amount of defocus; determining a current defocus amount of the imaging device based on the first target focus adjustment evaluation area; selecting one of the first detection threshold and the second detection threshold according to a current amount of defocus of the imaging device, and setting the selected one as the target detection threshold; Including, 6. The autofocus control method according to claim 5.
7. Determining a first detection threshold corresponding to a large amount of defocus and a second detection threshold corresponding to a small amount of defocus includes: determining the first detection threshold and the second detection threshold based on a preset ratio value, a first mapping relationship, a second mapping relationship, and a third mapping relationship; the first mapping relationship includes a mapping relationship between a focus lens position and a second contrast ratio, the second contrast ratio being a ratio between a maximum contrast value and a minimum contrast value; the second mapping relationship includes a mapping relationship between a focus lens position and a first contrast ratio when eyeglasses are present; and the third mapping relationship includes a mapping relationship between a focus lens position and a first contrast ratio when eyeglasses are not present, the first contrast ratio being a ratio between a minimum contrast value and a contrast value of a sub-region adjacent to the eye.
7. The autofocus control method according to claim 6.
8. determining the first detection threshold and the second detection threshold based on a preset ratio value, a first mapping relationship, a second mapping relationship, and a third mapping relationship; dividing a focus lens position range defined in the first mapping relationship into a first focus lens position range and a second focus lens position range, wherein the first focus lens position range is a focus lens position range in the first mapping relationship that corresponds to a second contrast ratio that is equal to or greater than the preset ratio value, and the second focus lens position range is a focus lens position range in the first mapping relationship that corresponds to a second contrast ratio that is smaller than the preset ratio value; determining a minimum first contrast ratio in a first contrast ratio range corresponding to the first focus lens position range in the second mapping relationship, and determining a maximum first contrast ratio in the first contrast ratio range corresponding to the first focus lens position range in the third mapping relationship, wherein one first contrast ratio is selected within a range that is smaller than the minimum first contrast ratio and larger than the maximum first contrast ratio, and is set as the first detection threshold; determining a minimum first contrast ratio in a first contrast ratio range corresponding to the second focus lens position range in the second mapping relationship, and determining a maximum first contrast ratio in the first contrast ratio range corresponding to the second focus lens position range in the third mapping relationship, wherein one first contrast ratio is selected within a range smaller than the minimum first contrast ratio and larger than the maximum first contrast ratio, and is set as the second detection threshold; Including, 8. The autofocus control method according to claim 7.
9. determining a current defocus amount of the imaging device based on the first target focus adjustment evaluation area, obtaining a maximum contrast value in the plurality of sub-regions; determining a current second contrast ratio based on a ratio between the acquired maximum contrast value and the acquired minimum contrast value, and determining a current amount of defocus of the imaging device based on the current second contrast ratio and a preset ratio value; Including, 7. The autofocus control method according to claim 6.
10. Determining whether the face region includes eyeglasses based on the current first contrast ratio and the target detection threshold includes: determining that the face region includes eyeglasses if the first contrast ratio is greater than the target detection threshold; determining that the face region does not include eyeglasses if the first contrast ratio is less than the target detection threshold; Including, 6. The autofocus control method according to claim 5.
11. Determining whether the face region includes eyeglasses includes: Acquiring shooting information; determining whether the face area includes glasses only when it is determined that the shooting environment is low-illumination based on the shooting information; Including, 4. The autofocus control method according to claim 3.
12. When the face region includes glasses, determining that the target provisional region includes a glasses region includes: determining that the eyeglasses region includes a sub-region in which the eyes are located or further includes a sub-region adjacent to the eyes; determining that the target provisional region includes an eye region when the face region does not include glasses; determining that the eye region includes a sub-region in which the eye is located; 5. The autofocus control method according to claim 4.
13. Determining the first target focus adjustment evaluation region based on at least the position of the feature and dividing the first target focus adjustment evaluation region into a plurality of sub-regions includes: acquiring orientation information of the face region, the orientation information including a yaw angle and / or a pitch angle; determining the first target focus adjustment evaluation area based on the position and orientation information of the characteristic portion, and dividing the first target focus adjustment evaluation area into a plurality of sub-areas; Including, 5. The autofocus control method according to claim 4.
14. If the captured image includes a face region, determining a first target focus adjustment evaluation region includes: determining a focus adjustment evaluation area corresponding to the current focus lens position when the image captured at the current focus lens position includes the face area; determining positions of focus adjustment evaluation areas at a first preset focus lens position and a second preset focus lens position based on a position of a focus adjustment evaluation area at a current focus lens position, and determining an overlapping area between the focus adjustment evaluation area corresponding to the first preset focus lens position and the focus adjustment evaluation area corresponding to the second preset focus lens position as the first target focus adjustment evaluation area; a field angle of the first preset focus lens position is larger than a field angle of the current focus lens position, and a field angle of the second preset focus lens position is smaller than a field angle of the current focus lens position; 2. The autofocus control method according to claim 1.
15. Determining a target provisional area in the first target focus adjustment evaluation area includes: determining a focus adjustment evaluation area at the current focus lens position and a temporary area in the focus adjustment evaluation area based on an image captured at the current focus lens position; determining positions of the provisional area at a first preset focus lens position and a second preset focus lens position based on the position of the provisional area at the current focus lens position, wherein the angle of view at the first preset focus lens position is larger than the angle of view at the current focus lens position, and the angle of view at the second preset focus lens position is smaller than the angle of view at the current focus lens position; determining an overlapping area of an area including a provisional area corresponding to a current focus lens position, a provisional area corresponding to the first preset focus lens position, and a provisional area corresponding to the second preset focus lens position, and the first target focus adjustment evaluation area as the target provisional area; Including, 2. The autofocus control method according to claim 1.
16. Calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast value at each focus lens position in at least the second target focus adjustment evaluation area, correcting a contrast value of the second target focus adjustment evaluation area based on a luminance value at each focus lens position of the second target focus adjustment evaluation area to obtain a contrast correction value at each focus lens position of the second target focus adjustment evaluation area; Calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast correction value at each focus lens position in at least the second target focus adjustment evaluation area; Including, 2. The autofocus control method according to claim 1.
17. The automatic focus adjustment control method includes: The method further includes acquiring a contrast value and a brightness value at each focus lens position of the target provisional area of the image captured at each focus lens position, and correcting the contrast value of the target provisional area based on the brightness value at each focus lens position of the target provisional area to acquire a contrast correction value at each focus lens position of the target provisional area, Calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast correction value at each focus lens position in at least the second target focus adjustment evaluation area, calculating a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast correction value at each focus lens position in the second target focus adjustment evaluation area and a contrast correction value at each focus lens position in the target provisional area, The weighted value of the contrast correction value of the target provisional area is smaller than the weighted value of the contrast correction value of the second target focus adjustment evaluation area.
17. The autofocus control method according to claim 16.
18. The automatic focus adjustment control method includes: acquiring photographing information of the imaging device; determining the illuminance of the shooting environment based on the shooting information; determining a target correction method based on the illuminance of the photographing environment; further comprising Correcting the contrast value of the second target focus adjustment evaluation area based on the luminance value at each focus lens position of the second target focus adjustment evaluation area includes: correcting a contrast value of the second target focus adjustment evaluation area using the target correction method based on a luminance value at each focus lens position of the second target focus adjustment evaluation area; 18. The autofocus control method according to claim 17.
19. determining a target correction method based on the illuminance of the photographing environment; When the illuminance of the photographing environment is within a first preset illuminance range, the target correction manner is determined to perform correction according to a first correction formula, and the first correction formula is: [Equation 10] In the first correction formula, the contrast value is a contrast value before correction of the second target focus adjustment evaluation area or the target provisional area, and the luminance value is a luminance value of the second target focus adjustment evaluation area or the target provisional area; When the illuminance of the photographing environment is within a second preset illuminance range, the target correction manner is determined to perform correction according to a second correction formula, and the second correction formula is: [0011] In the second correction formula, the contrast value is the contrast value before correction of the second target focus adjustment evaluation area or the target provisional area, the luminance value is the luminance value of the second target focus adjustment evaluation area or the target provisional area, and the value within the second preset illuminance range is smaller than the value within the first preset illuminance range; Including, 20. The autofocus control method of claim 18.
20. An imaging device, The image sensor unit includes an image sensor unit, an optical lens unit, a lens driving unit, an image data generating unit, a face detection processing unit, an automatic focus adjustment unit, an image signal processing unit, and a focus adjustment evaluation value calculating unit, the imaging element unit is used to convert an optical signal into an image signal; the optical lens unit includes a focus lens and is used to focus light from a subject onto the image sensor unit; the lens driving unit is used to drive the focus lens to adjust the position of the focus lens, The image data generating unit is used to output an image based on the image signal, thus capturing the image; the face detection processor is used to identify a face region in the collected image; the automatic focus adjustment unit is used to determine a first target focus adjustment evaluation area when the captured image includes a face area, and the first target focus adjustment evaluation area and the face area at least partially overlap; the automatic focus adjustment unit is further used to determine a target provisional area in the first target focus adjustment evaluation area, the first target focus adjustment evaluation area including the target provisional area and a second target focus adjustment evaluation area excluding the target provisional area, and the target provisional area including at least one of an eye area, an eyeglass area, and a tooth area; the image signal processing unit is used to acquire a contrast value at each focus lens position of the second target focus adjustment evaluation area of the image collected at each focus lens position, the focus adjustment evaluation value calculation unit is used to calculate a corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on a contrast value at each focus lens position in at least the second target focus adjustment evaluation area, and to acquire a focus adjustment evaluation value for each focus position; the automatic focus adjustment unit is further used to determine a target focus position based on the focus adjustment evaluation value for each focus position, the lens driving unit is further used to adjust the position of the focus lens to the target focus position. An imaging device characterized by:
Citation Information
Patent Citations
Focus detection device and imaging apparatus
JP2019095807A
Cited By
Automatic focusing method and system for dental operation camera and storage medium
CN120881387A
Focusing contrast value determination method and device, equipment, storage medium and program product
CN121284402A