Autofocus control method and imaging device

The autofocus control method improves focus accuracy by identifying and separating target regions affected by light reflection and blinking, enhancing autofocus performance in digital cameras with face recognition.

JP2026049152AActive Publication Date: 2026-03-18ACUTELOGIC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2026-03-18

AI Technical Summary

Technical Problem

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 illuminance environments.

Method used

An autofocus control method that identifies and separates target focus evaluation regions, including eye, eyeglasses, and teeth areas, calculates contrast values, and adjusts the focus lens position based on these regions to improve accuracy.

Benefits of technology

The method significantly reduces the influence of reflective surfaces and blinking on autofocus operations, enabling high-precision and stable focusing on human faces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026049152000001_ABST
    Figure 2026049152000001_ABST
Patent Text Reader

Abstract

The present invention provides an autofocus control method and an imaging device. [Solution] The method includes: collecting an image of a subject; determining a first target focus adjustment evaluation area if the image includes a face area; determining a target provisional area and a second target focus adjustment evaluation area excluding the target provisional area in the first target focus adjustment evaluation area, wherein the target provisional area includes at least one of the eye area, glasses area and teeth area; adjusting the focus lens position and collecting an image after the adjustment; obtaining contrast values ​​at each focus lens position in the second target focus adjustment evaluation area; calculating the corresponding focus adjustment evaluation value in the first target focus adjustment evaluation area based on at least the contrast values ​​in the second target focus adjustment evaluation area; determining the target focus position based on the focus adjustment evaluation value and adjusting the focus lens position to the target focus position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autofocus technology, and particularly to an autofocus control method and an imaging device.

Background Art

[0002] Digital cameras equipped with a face recognition function have become widespread. By detecting a person's face area from the captured image and automatically focusing on that person's face area, a good photo can be taken. Also, a technique for detecting eyes in a person's face area and adjusting the focus so that the eyes are in focus has been proposed. According to the patent literature, it has been shown that by detecting the eye area from the face information detected by the face recognition means and obtaining focus information from the detected eye area, it is possible to focus on the vicinity of the eyes in the face.

[0003] However, in conventional imaging devices, when including the eyes as the object of autofocus adjustment, there are problems such as the autofocus adjustment operation being affected by light reflection in glasses or pupils, or blinking, and the focus accuracy deteriorating. Particularly in a low illuminance environment, the influence becomes large and cannot be ignored.

Prior Art Documents

Patent Documents

[0004] Japanese Patent Laid-Open No. 2001-215403

Summary of the Invention

Problems to be Solved by the Invention

[0005] In order to solve the above-described technical problems, this application provides an autofocus control method and an imaging device, which reduce the influence of the autofocus adjustment operation being affected by light reflection in glasses or pupils, or blinking, etc., and can focus with high precision and stability.

Means for Solving the Problems

[0006] In a first aspect of this application, an automatic focus control method is provided for application to an imaging device including a focus lens. The automatic focus control method includes: collecting an image of a subject at the current focus lens position; determining a first target focus evaluation region if the collected image includes a face region, wherein the first target focus evaluation region and the face region overlap at least partially; determining a target provisional region in the first target focus evaluation region, wherein the first target focus evaluation region includes a target provisional region and a second target focus evaluation region excluding the target provisional region, and the target provisional region includes at least one of the eye region, eyeglasses region and teeth region; and adjusting the focus lens position. This includes collecting an image of the subject after sorting, obtaining the contrast value at each focus lens position of the second target focus adjustment evaluation region of the image collected at each focus lens position, calculating the corresponding focus adjustment evaluation value at each focus lens position of the first target focus adjustment evaluation region based on at least the contrast value at each focus lens position of the second target focus adjustment evaluation region to obtain a focus adjustment evaluation value for each focus position, and determining the 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 this application provides an imaging device. The imaging device includes an image sensor unit, an optical lens unit, a lens drive unit, an image data generation unit, a face detection processing unit, an autofocus adjustment unit, an image signal processing unit, and a focus adjustment evaluation value calculation unit. The image sensor 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 drive unit is used to drive the focus lens to adjust its position. The image data generation unit is used to output an image based on the image signal and therefore collects an image. The face detection processing unit is used to identify a face region in the collected image. The autofocus adjustment unit is used to determine a first target focus adjustment evaluation region if the collected image includes a face region, and the first target focus adjustment evaluation region and the face region overlap at least partially. The autofocus unit is further used to determine the target provisional area in the first target focus evaluation area, and therefore the first target focus evaluation area includes the target provisional area and the second target focus evaluation area excluding the target provisional area, and the target provisional area includes at least one of the eye area, eyeglasses area and teeth area. The image signal processing unit is used to obtain the contrast value at each focus lens position in the second target focus evaluation area of ​​the image collected at each focus lens position. The focus evaluation value calculation unit is used to calculate the corresponding focus evaluation value at each focus lens position in the first target focus evaluation area based on the contrast value at each focus lens position in at least the second target focus evaluation area, and to obtain the focus evaluation value for each focus position. The autofocus unit is further used to determine the target focus position based on the focus evaluation value for each focus position. The lens drive unit is further used to adjust the position of the focus lens to the target focus position.

[0008] The autofocus control method and imaging apparatus provided in this application can significantly reduce the influence of the target provisional region on the autofocus operation by accurately identifying and determining a target provisional region, obtaining a second target focus evaluation region, calculating a corresponding focus evaluation value for the first target focus evaluation region based on at least the contrast value of the second target focus evaluation region, and performing an autofocus operation based on the focus evaluation value. This improves the accuracy of determining the target focus position, improves the accuracy of autofocus, and enables high-precision and stable focusing on human faces. [Brief explanation of the drawing]

[0009] To clearly illustrate the technical solutions of the embodiments of this application, the drawings necessary to illustrate the embodiments will be briefly described below. However, obviously, the drawings described are only for some embodiments of this application, and those skilled in the art can obtain other drawings based on these without any creative effort. [Figure 1] This is a schematic diagram showing the mapping relationship between the focus lens position and the focus adjustment evaluation value in related technologies. [Figure 2] This is a flowchart of the autofocus control method provided by the embodiment of this application. [Figure 3] This is a flowchart illustrating the subdivided steps in one example of step S2. [Figure 4] This is a schematic diagram showing images collected according to the embodiments of this application. [Figure 5] This is a schematic diagram showing a first target focus adjustment evaluation region and a plurality of sub-regions provided by the embodiments of this application. [Figure 6] This is a flowchart illustrating the breakdown of steps in one example of step S3. [Figure 7] This is a schematic diagram showing an image including eyeglasses, provided by the embodiments of this application. [Figure 8] This is a schematic diagram showing an image without eyeglasses, provided by the embodiments of this application. [Figure 9] This is a schematic diagram of the numbers obtained by numbering multiple sub-regions in Figures 7 and 8. [Figure 10] This is a schematic diagram showing an image that does not include the face region, as provided by the embodiments of this application. [Figure 11] This is a schematic diagram of the numbers obtained by numbering multiple sub-regions of the third target focus adjustment evaluation region in Figure 10. [Figure 12] This is a flowchart of the subdivided steps in one example of step S31. [Figure 13] This is a schematic diagram of an image taken when the person is not wearing glasses, as provided by the embodiments of this application. [Figure 14] This is a schematic diagram of an image taken while wearing eyeglasses, as provided by the embodiments of this application. [Figure 15] This is a schematic diagram showing the mapping relationship between the focus lens position and the first contrast ratio, as provided by the embodiments of this application. [Figure 16] This is a schematic diagram of an image taken when the person is not wearing glasses, as provided by the embodiments of this application. [Figure 17] This is a schematic diagram of an image taken while wearing eyeglasses, as provided by the embodiments of this application. [Figure 18] This is a schematic diagram showing the mapping relationship between the focus lens position and the second contrast ratio, as provided by the embodiments of this application. [Figure 19] This is a flowchart of the subdivided steps in one example of step S322. [Figure 20] This is a flowchart of the subdivided steps in one example of step S3222. [Figure 21] This is a schematic diagram showing the first and second focus lens position ranges provided by the embodiments of this application. [Figure 22] This is a schematic diagram showing the first and second detection thresholds provided by the embodiments of this application. [Figure 23]Schematic diagram showing a first focus lens position range and a second focus lens position range provided by another embodiment of the present application. [Figure 24] Schematic diagram showing a first detection threshold and a second detection threshold provided by another embodiment of the present application. [Figure 25] Schematic diagram of the change in the angle of view caused by the movement of the focus lens in the related art. [Figure 26] Subdivided step flowchart in another exemplification of step S2. [Figure 27] Schematic diagram showing a focus adjustment evaluation region 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] Subdivided step flowchart in another exemplification of step S3. [Figure 29] Schematic diagram showing that when the focus lens moves according to an embodiment of the present application, the glasses area shifts. [Figure 30] Schematic diagram enlarging the subject shown in FIG. 29. [Figure 31] Schematic diagram of a target provisional region and a second target focus adjustment evaluation region of an overlapping region provided by an embodiment of the present application. [Figure 32] Schematic diagram showing the mapping relationship between the focus lens position, the luminance value, and the focus adjustment evaluation value in the related art. [Figure 33] Subdivided step flowchart in one exemplification of step S6. [Figure 34] Schematic diagram of the focus adjustment evaluation value after correction using the first correction formula provided by an embodiment of the present application. [Figure 35] Schematic diagram of the focus adjustment evaluation value after correction using the second correction formula provided by an embodiment of the present application. [Figure 36] Schematic diagram showing the structure of an imaging device provided by an embodiment of the present application.

Mode for Carrying Out the Invention

[0010] The technical solutions of the embodiments of this application will be described clearly and completely below with reference to the drawings of the embodiments of this application. Clearly, the embodiments described are only a selection of embodiments of this application, not all embodiments. All other embodiments that can be obtained by a person skilled in the art without creative effort based on the embodiments of this application are within the scope of protection of this application.

[0011] The terms "first," "second," "third," and "fourth" used in the specification of this application are used solely to distinguish the objects being described and not to describe a specific order. The directions or positional relationships indicated by terms such as "top," "bottom," and "inside" used in the specification of this application are directions or positional relationships shown in the drawings and are merely for the purpose of describing and simplifying the explanation of the invention, and are not intended to indicate or imply that the devices or elements referred to necessarily have a specific direction, or are configured or operated in a specific direction, and therefore should not be understood as limitations on the invention.

[0012] In the description of this application, the term “connection” should be understood in a broad sense unless otherwise explicitly stated and limited. For example, it may be a fixed connection, a removable 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 will be able to understand the specific meaning of the above terms in the present invention, depending on the specific circumstances.

[0013] In conventional autofocus systems, a common method involves moving the focus lens, determining the focus adjustment evaluation value, and setting the focus lens position corresponding to the maximum focus adjustment evaluation value as the in-focus position. See Figure 1. Figure 1 is a schematic diagram showing the mapping relationship between the focus lens position and the focus adjustment evaluation value in related technologies. As shown in Figure 1, the first curve 100 shows the mapping relationship between the focus lens position and the focus adjustment evaluation value for a normal subject, and the second curve 101 shows the mapping relationship between the focus lens position and the focus adjustment evaluation value when light hits the lens or frame of eyeglasses or the pupil of the eye and reflected light is generated. In the first curve 100, the focus adjustment evaluation value is maximum at a focus lens position of 400, which is 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 ​​to the left and right of 400. Therefore, if the focus lens position is 400 and the focus adjustment evaluation value is not at its maximum, setting 400 as the in-focus position results in a decrease in the accuracy of autofocus. This is because when the highly luminous reflective portion of light moves out of focus, it becomes blurred, expanding the area affected by this blurring.

[0014] The embodiments of this application provide an autofocus control method that can improve the accuracy of autofocus adjustment by taking into account the influence of reflected light on the autofocus operation when light hits eyeglasses, eyes, and teeth.

[0015] Please refer to Figure 2. Figure 2 is a flowchart of the autofocus control method provided by an embodiment of the present application. As shown in Figure 2, the autofocus control method includes the following steps S1 to S7.

[0016] Step S1: Collect an image of the subject at the current focus lens position.

[0017] Step S2, if the collected image includes a facial region, a first target focus evaluation region is determined, wherein the first target focus evaluation region and the facial region overlap at least partially.

[0018] Step S3: Determine the provisional target area in the first target accommodation evaluation area, wherein the first target accommodation evaluation area includes the provisional target area and the second target accommodation evaluation area excluding the provisional target area, and the provisional target area includes at least one of the eye area, eyeglasses area and teeth area.

[0019] Step S4: Adjust the focus lens position and collect an image of the subject after the adjustment.

[0020] Step S5: The contrast values ​​at each focus lens position are obtained for the second target focus adjustment evaluation region of the images collected at each focus lens position.

[0021] In step S6, based on the contrast values ​​at each focus lens position in at least the second target focus evaluation region, the corresponding focus evaluation values ​​at each focus lens position in the first target focus evaluation region are calculated to obtain the focus evaluation values ​​for each focus position.

[0022] Step S7: Based on the focus adjustment evaluation value for each focus position, the target focus position is determined, and the position of the focus lens is adjusted to the target focus position.

[0023] The autofocus control method and imaging apparatus provided in this application can significantly reduce the influence of the target provisional region on the autofocus operation by accurately identifying and determining a target provisional region, obtaining a second target focus evaluation region, calculating a corresponding focus evaluation value for the first target focus evaluation region based on at least the contrast value of the second target focus evaluation region, and performing an autofocus operation based on the focus evaluation value. This improves the accuracy of determining the target focus position, improves the accuracy of autofocus, and enables high-precision and stable focusing on human faces.

[0024] In some embodiments, the autofocus control method further includes obtaining the contrast value at each focus lens position of the target provisional region of the image collected at each focus lens position. Calculating the corresponding focus evaluation value at each focus lens position of the first target focus evaluation region based on the contrast values ​​at each focus lens position of at least the second target focus evaluation region includes calculating the corresponding focus evaluation value at each focus lens position of the first target focus evaluation region based on the contrast values ​​at each focus lens position of the second target focus evaluation region and the contrast values ​​at each focus lens position of the target provisional region, wherein the weighted value of the contrast values ​​of the target provisional region is smaller than the weighted value of the contrast values ​​of the second target focus evaluation region.

[0025] By reducing the weighting of the target provisional region when calculating the focus adjustment evaluation value, the influence of the target provisional region on the calculation of the focus adjustment evaluation value can be reduced, thereby improving the accuracy of autofocus.

[0026] In some embodiments, obtaining a focus adjustment evaluation value for each focus position by calculating the 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 the second target focus adjustment evaluation area includes calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based solely on the contrast value at each focus lens position in the second target focus adjustment evaluation area.

[0027] By calculating the focus adjustment evaluation value based solely on the contrast value of the second target focus adjustment evaluation region, that is, by eliminating the target provisional region and thus eliminating its influence on the calculation of the focus adjustment evaluation value, the accuracy of autofocus can be improved.

[0028] Please refer to Figure 3. Figure 3 is a flowchart of the subdivided steps in one example of step S2. In some embodiments, determining the first target focus adjustment evaluation region, as shown in Figure 3, specifically includes the following subdivided steps S21-S22.

[0029] S21. Identifying a feature area of ​​the face region, wherein the feature area includes at least one of the eyes, nose, and mouth.

[0030] S22, a first target focus adjustment evaluation region is determined based on the location of at least the characteristic region, and the first target focus adjustment evaluation region is divided into multiple sub-regions.

[0031] By detecting multiple feature points in the facial region, it is possible to identify specific feature areas. For example, the multiple feature points may include four eye feature points, one nose feature point, and two mouth feature points.

[0032] Please refer to Figure 4. Figure 4 is a schematic diagram showing an image collected by an embodiment of the present application. As shown in Figure 4, the detected feature points are indicated by triangles. In the four eye feature points 800, two eye feature points 800 are located at the ends of the right eye, and the other two eye feature points 800 are located at the ends of the left eye. The nose feature point 801 is located near the nose, and the two mouth feature points 802 are located at the ends of the mouth. In another embodiment, there are two nose feature points 801 located at the ends of the nose. Furthermore, the number and location 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 a first target focus adjustment evaluation region based on the position of at least a feature area, and dividing the first target focus adjustment evaluation region into a plurality of sub-regions, includes obtaining orientation information of the face region, wherein the orientation information includes yaw angle and / or pitch, and determining a first target focus adjustment evaluation region based on the position and orientation information of the feature area, and dividing the first target focus adjustment evaluation region into a plurality of sub-regions.

[0034] In some embodiments, determining a first target focus adjustment evaluation region based on the position and orientation information of a feature region, and dividing the first target focus adjustment evaluation region into a plurality of sub-regions, includes determining the width, height, and center position of the first target focus adjustment evaluation region, and dividing the first target focus adjustment evaluation region into a predetermined number of rows and a predetermined number of columns to obtain a plurality of sub-regions arranged in an array.

[0035] Specifically, as shown in Figure 4, the two eye feature points 800 located at either end of the left or right eye are the medial eye feature point 800a and the lateral eye feature point 800b, respectively. The medial eye feature point 800a of the left eye is closer to the right eye than the lateral eye feature point 800b of the left eye, and the medial eye feature point 800a of the right eye is closer to the left eye than the lateral eye feature point 800b of the right eye. The distance between the two lateral eye feature points 800b is defined as the horizontal width of the first target focus accommodation evaluation region. The vertical height of the first target focus accommodation evaluation region is calculated using the following formula.

number

[0036] Please refer to Figure 5. Figure 5 is a schematic diagram showing a first target focus adjustment evaluation region and its sub-regions provided by an embodiment of the present application. As shown in Figure 5, the distance between the two outer eye feature points 800b is defined as the horizontal width of the first target focus adjustment evaluation region (indicated as W in Figure 5). The number of rows in the sub-regions is set to 7, and the number of columns in the sub-regions is set to 3, i.e., N1 is 7 and N2 is 3. The vertical height of the first target focus adjustment evaluation region (indicated as H in Figure 5) is calculated by the following formula.

number

[0037] As described above, since the first target focus adjustment evaluation area 1000 and its multiple sub-areas 400 are set based on the position of the eye, the areas of the eye and glasses can be set with high precision.

[0038] Please refer to Figure 6. Figure 6 is a flowchart of the subdivided steps in one example of step S3. In some embodiments, determining the target provisional area in the first target focus adjustment evaluation area 1000, as shown in Figure 6, specifically includes the following subdivided steps S31 to S33.

[0039] S31, determine whether the face region includes glasses. If the face region includes glasses, execute S32 below. If the face region does not include glasses, execute S33 below.

[0040] S32, it is confirmed that the target provisional area includes the eyeglasses area.

[0041] S33, it is confirmed that the target provisional area includes the target area.

[0042] Generally, when wearing glasses, the glasses cover the eyes, and the target provisional area is set to include the area covered by the glasses, thereby simultaneously reducing the influence of the eyes and glasses on the autofocus adjustment mechanism.

[0043] In some embodiments, if the face region includes eyeglasses, determining that the target provisional region includes the eyeglasses region means determining that the eyeglasses region includes a sub-region 400 where the eyes are located, or further includes a sub-region 400 adjacent to the eyes. If the face region does not include eyeglasses, determining that the target provisional region includes the eye region means determining that the eye region includes a sub-region 400 where the eyes are located.

[0044] Please refer to Figure 7. Figure 7 is a schematic diagram showing an image including eyeglasses, provided by an embodiment of the present application. As shown in Figure 7, when it is determined that the face region includes eyeglasses, i.e., when it is determined that eyeglasses are being worn, the sub-region 400e where the eyes are located and the sub-region 400f adjacent to a portion of the eyes are defined as the eyeglasses region 2000. The 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 defined 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 the tooth region. If the face region includes teeth, determining that the target provisional region includes the tooth region specifically includes determining that the tooth region includes the sub-region 400 where the teeth are located. Whether or not the face region includes teeth can be determined by color segmentation or the like.

[0046] Please refer to Figure 8. Figure 8 is a schematic diagram showing an image without glasses, as provided by an embodiment of this application. As shown in Figure 8, if it is determined that the face region does not include glasses, i.e., that glasses are not being worn, the sub-region 400e where the eyes are located is defined as the eye region 2100. The 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 defined as the second target focus adjustment evaluation region 6000.

[0047] In some embodiments, the first target focus adjustment evaluation region 1000 further includes regions other than the face region, for example, the left and right neck regions 400g shown in Figures 7 and 8. The target provisional region 5000 further includes regions 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 sub-regions 400g of the neck. Also, as shown in Figure 8, the target provisional region 5000 includes the eye region 2100 and the left and right sub-regions 400g of the neck.

[0048] When calculating the focus adjustment evaluation value for the first target focus adjustment evaluation region 1000, weighted values ​​corresponding to multiple sub-regions 400 are set in advance, and the focus adjustment evaluation value is calculated based on the corresponding weighted values ​​and contrast values.

[0049] Please refer to Figure 9. Figure 9 is a schematic diagram of the numbers obtained by numbering the multiple sub-regions 400 in Figures 7 and 8. As shown in Figure 9, the numbers of the multiple sub-regions 400 shown in Figures 7 and 8 are 0 to 20. When glasses are worn, the weighted values ​​of the multiple sub-regions 400 are {1,1,1,0,1,0,0,0,0,0,2,0,1,2,1,1,2,1,0,1,0} in ascending order of number. When glasses are not worn, the weighted values ​​of the multiple sub-regions 400 are {1,1,1,1,1,1,0,1,0,1,2,1,1,2,1,1,2,1,0,1,0} in ascending order of number. 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 adjustment operation. In several other embodiments, the influence of these regions on autofocus operation is reduced by setting the weighting value of the target provisional region 5000 to be smaller than the weighting value of the second target focus adjustment evaluation region 6000. For example, when glasses are worn, the weighting values ​​of the multiple sub-regions 400 are in ascending order of number {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}. When glasses are not worn, the weighting values ​​of the multiple sub-regions 400 are in ascending order of number {1,1,1,1,1,1,0.1,1,0.1,1,2,1,1,2,1,1,2,1,0.1,1,0.1}.

[0050] In some embodiments, the focus adjustment evaluation value of the first target focus adjustment evaluation region 1000 can be calculated using the following formula.

number

number

[0051] In some embodiments, the image collected by the imaging device does not include the face region. See Figure 10. Figure 10 is a schematic diagram showing an image that does not include the face region, as provided by an embodiment of the present application. As shown in Figure 10, the collected image does not include the face region. When the collected image does not include the face region, the central region of the image is defined as the third target focus adjustment evaluation region 3000, and the third target focus adjustment evaluation region 3000 is divided into a plurality of sub-regions. When calculating the corresponding focus adjustment evaluation value of the third target focus adjustment evaluation region 3000, the weighted value of the central sub-region may be higher than the weighted value of the peripheral sub-regions in the plurality of sub-regions of the third target focus adjustment evaluation region 3000. For example, the weighted values ​​of the plurality of sub-regions of the third target focus adjustment evaluation region 3000 gradually decrease outward along the radial direction. In some other embodiments, the weighted values ​​of the plurality of sub-regions of the third target focus adjustment evaluation region 3000 are the same.

[0052] Please refer to Figure 11. Figure 11 is a schematic diagram of the numbers obtained by numbering multiple sub-regions of the third target focus adjustment evaluation region 3000 in Figure 10. As shown in Figure 11, the numbers of the multiple sub-regions shown in Figure 11 are 0 to 8. The weighted values ​​of the multiple sub-regions are {1, 1, 1, 1, 4, 1, 1, 1, 1} in ascending order of number.

[0053] In some embodiments, the focus adjustment evaluation value of the third target focus adjustment evaluation region 3000 can be calculated using the following formula.

number

number

[0054] Refer to Figure 12. Figure 12 is a flowchart of the subdivided steps in one example of step S31. In some embodiments, determining whether or not the face region includes eyeglasses, as shown in Figure 12, specifically involves the following subdivided steps S311 to S313.

[0055] S311, obtain the minimum contrast value in multiple sub-regions 400 and the contrast value of sub-region 400f adjacent to the eye.

[0056] S312, Determine the target detection threshold.

[0057] In S313, the ratio of the contrast value of the sub-region 400f adjacent to the eye to the acquired minimum contrast value is taken as the current first contrast ratio, and based on the current first contrast ratio and the target detection threshold, it is determined whether or not the face region includes glasses.

[0058] In step S311, obtaining the contrast value of the sub-region 400f adjacent to the eye can mean obtaining the contrast value of the sub-region 400h between the eyes (see Figure 7), or obtaining the contrast value of another sub-region 400f adjacent to the eye, for example, a sub-region 400 located above, below, or outside the eye and adjacent to the eye. When glasses are worn, the glasses frame is usually located between and around the eyes, and the glasses frame increases the contrast value of sub-region 400. The ratio of the minimum contrast value to the contrast value of the sub-region 400f adjacent to the eye can be used to determine whether the facial region of the collected image includes glasses, i.e., whether glasses were worn.

[0059] The contrast values ​​of multiple sub-regions 400 of the first target focus adjustment evaluation region 1000 can be obtained, the minimum contrast value can be determined from the multiple contrast values, and the sub-region 400 corresponding to the minimum contrast value can be determined.

[0060] Please refer to Figure 13. Figure 13 is a schematic diagram of an image taken when the wearer is not wearing glasses, as provided by an embodiment of the present application. By obtaining the contrast values ​​of multiple sub-regions 400, it is determined that the contrast value of the first sub-region 400a is the minimum, and 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 Figure 14. Figure 14 is a schematic diagram of an image taken when the wearer is wearing glasses, as provided by an embodiment of the present application. By obtaining the contrast values ​​of multiple sub-regions 400, it is determined that the contrast value of the second sub-region 400b is the minimum, and the contrast value of the second sub-region 400b is C3, the contrast value of the sub-region 400h between the eyes is C4, and the first contrast ratio is C4 / C3.

[0061] Due to the eyeglass frames, the contrast value in the sub-region 400h between the eyes is significantly increased, and C4 is significantly larger than C2. Therefore, by calculating a first contrast ratio based on the contrast value in the sub-region 400h between the eyes and the minimum contrast value, and comparing the first contrast ratio with the target detection threshold, it is possible to determine whether or not eyeglasses are being worn.

[0062] Due to the eyeglass frame, the contrast value of other sub-regions 400f adjacent to the eye increases, and a first contrast ratio calculated based on the minimum contrast value and the contrast value of other sub-regions 400f adjacent to the eye can also be used to determine whether or not eyeglasses are being worn.

[0063] When determining whether or not glasses are being worn based on the first contrast ratio, the first contrast ratio changes according to the amount of focus shift. See Figure 15. Figure 15 is a schematic diagram showing the mapping relationship between the focus lens position and the first contrast ratio provided by an embodiment of the present application. As shown in Figure 15, the third curve 500 represents the mapping relationship between the focus lens position and the first contrast ratio when glasses are being worn, and the fourth curve 501 represents the mapping relationship between the focus lens position and the first contrast ratio when glasses are not being 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 focal point, and decreases as the focus lens position moves away from the focus lens position 400 near the focal point, i.e., as the focus lens position becomes smaller or larger than 400. Both the third curve 500 and the fourth curve 501 show that the first contrast ratio decreases as the focus lens position 400 near the focal point moves away. As can be seen from the third curve 500, when glasses are worn, the first contrast ratio is minimum at focus lens positions 200 and 600, and the minimum value of the first contrast ratio is approximately 20. As can be seen from the fourth curve 501, when glasses are not worn, the first contrast ratio corresponding to the focus lens position section 502 is greater than the minimum first contrast ratio when glasses are worn, i.e., it exceeds 20. Therefore, if the focus lens position is in the focus lens position section 502, judging whether or not glasses are worn based on the first contrast ratio will result in an error. In order to improve the accuracy of detecting whether or not glasses are worn, in the embodiment of this application, the amount of focus shift is used as the basis for judgment to accurately determine whether or not glasses are worn.

[0064] In the embodiments of this application, the amount of focus shift is determined based on a 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 highest contrast value and the sub-region 400 with the lowest contrast value. See Figures 16 and 17. Figure 16 is a schematic diagram of an image taken when the wearer is not wearing glasses, provided by the embodiments of this application. Figure 17 is a schematic diagram of an image taken when the wearer is wearing glasses, provided by the embodiments of this application. As shown in Figure 16, by obtaining the contrast values ​​of multiple sub-regions 400, it is determined that the first sub-region 400a has the minimum contrast value, and the contrast value of the first sub-region 400a is C1, the sub-region 400e where the eye is located has the maximum contrast value, and the contrast value of the sub-region 400e where the eye is located is C5, and the second contrast ratio is C5 / C1. As shown in Figure 17, by obtaining the contrast values ​​of multiple sub-regions 400, it is determined that the contrast value of the second sub-region 400b is the minimum, and the contrast value of the second sub-region 400b is C3. The contrast value of the sub-region 400e where the eye is located is the maximum, and the contrast value of the sub-region 400e where the eye is located is C6, and the second contrast ratio is C6 / C3.

[0065] Please refer to Figure 18. Figure 18 is a schematic diagram showing the mapping relationship between the focus lens position and the second contrast ratio provided by the embodiment of this application. As shown in Figure 18, the fifth curve 600 represents the mapping relationship between the focus lens position and the second contrast ratio when glasses are worn, and the sixth curve 601 represents the mapping relationship between the focus lens position and the second contrast ratio when glasses are not worn. Even when glasses are not worn, the contrast value C5 of the sub-region 400e where the eye is located is large, so the difference between the contrast ratio with glasses and the contrast ratio without glasses is smaller for the second contrast ratio than for the first contrast ratio. As shown in Figure 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 is greater than the maximum first contrast ratio in the mapping relationship between the focus lens position and the first contrast ratio when glasses 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 glasses 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 glasses are not worn is Cmax. In some embodiments, the preset ratio is greater than Cmax and 80 or less.

[0067] As shown in Figure 18, the preset ratio 602 is 60. In some other embodiments, the preset ratio 602 can be set to other values ​​as needed, and is not limited thereto.

[0068] If the second contrast ratio is less than or equal to a preset ratio, the amount of focus shift is large, and if the second contrast ratio is greater than the preset ratio, the amount of focus shift is small.

[0069] Refer to Figure 19. Figure 19 is a flowchart of the subdivision steps in one example of step S322. In some embodiments, determining the target detection threshold, as shown in Figure 19, specifically involves the following subdivision steps S3221 to S3223.

[0070] S3221, a first detection threshold corresponding to a large amount of focus shift and a second detection threshold corresponding to a small amount of focus shift are determined.

[0071] S3222, based on the first target focus adjustment evaluation area 1000, the amount of focus shift of the current imaging device is determined.

[0072] S3223, depending on the amount of focus shift of the current imaging device, one of the first detection threshold and the second detection threshold is selected as the target detection threshold.

[0073] If the image sensor's focus shift is small, the first detection threshold is selected and set as the target detection threshold. If the image sensor's focus shift is large, the second detection threshold is selected and set as the target detection threshold.

[0074] In the embodiment of this application, by determining detection thresholds corresponding to different amounts of focal shift and selecting the corresponding detection threshold according to the current amount of focal shift of the imaging device to determine whether or not glasses are being worn, it is possible to determine whether or not glasses are being worn based on the actual conditions of the imaging device, thereby improving the accuracy of glasses wear determination.

[0075] Refer to Figure 20. Figure 20 is a flowchart of the subdivided steps in one example of step S3222. In some embodiments, determining the amount of focus shift of the current imaging device based on the first target focus adjustment evaluation area 1000, as shown in Figure 20, specifically involves the following subdivided steps S32221 to S32222.

[0076] S32221 obtains the maximum contrast value in multiple sub-regions 400.

[0077] S32222, the ratio of the acquired maximum contrast value to the minimum contrast value is taken as the current second contrast ratio, and the amount of focus shift of the current imaging device is determined based on the current second contrast ratio and a preset ratio value.

[0078] If the ratio of the maximum contrast value to the minimum contrast value in multiple sub-regions 400 is smaller than a preset ratio, it is determined that the current imaging device has a large amount of focus shift, and a second detection threshold is selected as the target detection threshold. If the ratio of the maximum contrast value to the minimum contrast value in multiple sub-regions 400 is greater than or equal to a preset ratio, it is determined that the current imaging device has a small amount of focus shift, and a first detection threshold is selected as the target detection threshold.

[0079] In some embodiments, determining a first detection threshold corresponding to a large amount of focus shift and a second detection threshold corresponding to a small amount of focus shift includes determining the first and second detection thresholds based on a preset ratio, a first mapping relationship, a second mapping relationship, and a third mapping relationship.

[0080] The first mapping relationship includes the mapping relationship between the focus lens position and the second contrast ratio. As described above, the second contrast ratio is the ratio of the maximum contrast value to the minimum contrast value, as shown in the fifth curve 600 and the sixth curve 601 in Figure 18. The second mapping relationship includes the mapping relationship between the focus lens position and the first contrast ratio when glasses are present, as shown in the third curve 500 in Figure 15. The third mapping relationship includes the mapping relationship between the focus lens position and the first contrast ratio when glasses are absent, as shown in the fourth curve 501 in Figure 15. As previously mentioned, the first contrast ratio is the ratio of the minimum contrast value to the contrast value of the sub-region 400f adjacent to the eye.

[0081] In some embodiments, determining the first detection threshold and the second detection threshold based on the preset ratio, first mapping relationship, second mapping relationship, and third mapping relationship described above is: The method involves dividing the 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 corresponds to a second contrast ratio in the first mapping relationship that is greater than or equal to a preset ratio, and the second focus lens position range corresponds to a second contrast ratio in the first mapping relationship that is less than a preset ratio. The process involves determining the 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 the maximum first contrast ratio in a 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 less than the minimum first contrast ratio of the third curve 500 and greater than the maximum first contrast ratio of the fourth curve 501, and this is set as the first detection threshold. The method involves determining the 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 the maximum first contrast ratio in a first contrast ratio range corresponding to the second focus lens position range in the third mapping relationship, by selecting one first contrast ratio within a range that is less than the minimum first contrast ratio of the third curve 500 and greater than the maximum first contrast ratio of the fourth curve 501, and setting it as the second detection threshold.

[0082] Based on the mapping relationship between the focus lens position and the second contrast ratio when wearing glasses, the first and second focus lens position ranges can be determined. As shown in Figure 18, the preset ratio value 602 is 60, and 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 between P1 and P2, and the second contrast ratio corresponding to the first focus lens position range is 60 or greater. The second focus lens position range is obtained by combining focus lens positions less than P1 and focus lens positions greater than P2, and the second contrast ratio corresponding to the second focus lens position range is less than 60.

[0083] Based on the mapping relationship between the focus lens position and the second contrast ratio when glasses are not being worn, the first focus lens position range and the second focus lens position range can be determined. As shown in Figure 18, the preset ratio value 602 is 60, and 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 between P3 and P4, and the second contrast ratio corresponding to the first focus lens position range is 60 or greater. The second focus lens position range is obtained by combining focus lens positions less than P3 and focus lens positions greater than P4, and the second contrast ratio corresponding to the second focus lens position range is less than 60.

[0084] Based on the mapping relationship between the focus lens position and the second contrast ratio when eyeglasses are worn, the first focus lens position range and the second focus lens position range are determined, and based on the first focus lens position range and the second focus lens position range, the first detection threshold and the second detection threshold are determined. See Figure 21. Figure 21 is a schematic diagram showing the first focus lens position range and the second focus lens position range provided by the embodiment of this application. As shown in Figure 21, in the third curve 500, when the focus lens position is greater than or equal to P1 and less than or equal to P2, the corresponding minimum first contrast ratio is C5. In the fourth curve 501, when the focus lens position is greater than or equal to P1 and less than or equal to 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 or equal to P1 or greater than or equal to P2, the corresponding minimum first contrast ratio is C7. In the fourth curve 501, when the focus lens position is less than or equal to P1 or greater than or equal to 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 Figure 22. Figure 22 is a schematic diagram showing the first and second detection thresholds provided by the embodiment of this application. Figure 22 shows the first and second detection thresholds.

[0085] Based on the mapping relationship between the focus lens position and the second contrast ratio when glasses are not being worn, the first focus lens position range and the second focus lens position range can be determined. See Figure 23. Figure 23 is a schematic diagram showing the first focus lens position range and the second focus lens position range provided by another embodiment of this application. As shown in Figure 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 showing the first and second detection thresholds provided by another embodiment of this application. Figure 24 shows the first and second detection thresholds.

[0086] In some embodiments, the first detection threshold shown in Figure 24 is equal to the first detection threshold shown in Figure 22, and the second detection threshold shown in Figure 24 is equal to the second detection threshold shown in Figure 22.

[0087] In some embodiments, determining whether a face region includes glasses based on a current first contrast ratio and a target detection threshold includes determining that the face region includes glasses if the first contrast ratio is greater than the target detection threshold, and determining that the face region does not include glasses if the first contrast ratio is less than the target detection threshold.

[0088] If the amount of focus shift is small, the first detection threshold is selected as the target detection threshold. If the first contrast ratio is greater than the first detection threshold, the face region includes glasses, i.e., glasses are being worn. If the first contrast ratio is less than the first detection threshold, the face region does not include glasses, i.e., glasses are not being worn.

[0089] If the amount of focus shift is large, the second detection threshold is selected as the target detection threshold. If the first contrast ratio is greater than the second detection threshold, the face region includes glasses, i.e., glasses are being worn. If the first contrast ratio is less than the second detection threshold, the face region does not include glasses, i.e., glasses are not being worn.

[0090] In some embodiments, determining whether or not the face region includes glasses includes acquiring imaging information and, only if it is determined from the imaging information that the imaging environment is low-light, determining whether or not the face region includes glasses.

[0091] The imaging information may include the Brightness Value (BV) and / or the gain value of the image sensor of the imaging device. The Brightness Value allows for direct determination of whether the shooting environment is low-light. In addition, since the gain value of the image sensor increases in low-light shooting environments, the magnitude of the gain value can be used to determine whether the shooting environment is low-light.

[0092] In low-light shooting environments, light reflection cannot be ignored, and the effect of light reflection from glasses on the autofocus operation is even greater in low light conditions. Therefore, it is preferable to determine whether or not glasses are being worn only in low light conditions. This not only significantly improves the accuracy of focusing in low light conditions, but also simplifies the autofocus steps in high-light shooting environments and improves the efficiency of autofocus.

[0093] In technologies related to autofocus adjustment, changes in the angle of view caused by the movement of the focus lens also affect the autofocus adjustment operation. Patent document 2 (Japanese Patent Publication No. 2008-42405) addresses the problem of the shooting angle of view changing due to the movement of the focus lens in focus adjustment control by correcting the change in the angle of view of images taken at the closest focus lens position where the angle of view widens, using infinity, which has the narrowest angle of view, as a reference.

[0094] However, when performing autofocus adjustment, the focus adjustment evaluation area on the image sensor, which was set before the autofocus adjustment operation began, will be misaligned with the actual subject due to the change in the angle of view caused by the movement of the focus lens.

[0095] Please refer to Figure 25. Figure 25 is a schematic diagram of the change in field of view caused by the movement of the focus lens in the related technology. As shown in Figure 25, the initial position of the subject on the image is the first position 4000 before the autofocus operation is started. Then, when the autofocus operation is started and the focus lens moves, the field of view changes, and the position of the subject on the image moves to the second position 4001 along the arrow shown in Figure 25, i.e., a shift occurs. The change in field of view caused by the movement of the focus lens is similar to the state in which the image is enlarged / shrunk radially from the image center 1103 toward the periphery of the image, and the amount of shift increases as the subject approaches the periphery of the image. When the face region is not in the image center 1103, the effect of the change in field of view increases as the position of the face region moves away from the image center 1103. Even if a face is detected at the first position 4000 and the corresponding focus adjustment evaluation region 1000a is set, the movement of the focus lens causes the face region to move to the second position 4001 on the image, resulting in a shift relative to the first position 4000. After a positional shift occurs, the corresponding focus adjustment evaluation area 1000b also shifts relative to the focus adjustment evaluation area 1000a. Consequently, the calculation of the focus adjustment evaluation value for the first target focus adjustment evaluation area 1000 is affected, potentially reducing the accuracy of autofocus.

[0096] In the embodiment of this application, by considering the influence of the change in angle of view due to the movement of the focus lens on the calculation of the focus adjustment evaluation value, the influence of the change in angle of view on the autofocus operation can be reduced, which is particularly effective when the subject is not located in the center of the image.

[0097] Refer to Figure 26. Figure 26 is a flowchart of the subdivided steps in another example of step S2. In some embodiments, when the collected image includes a facial region, as shown in Figure 26, determining the first target focus adjustment evaluation region specifically includes the following subdivided steps S25-S26.

[0098] S25. If the image acquired at the current focus lens position includes a face region, the focus adjustment evaluation region corresponding to the current focus lens position is determined.

[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 defined as the first target focus adjustment evaluation area 1000.

[0100] The field of view at the first preset focus lens position is greater than the field of view at the current focus lens position, and the field of view at the second preset focus lens position is smaller than the field of view at the current focus lens position.

[0101] The angle of view at the first preset focus lens position can be the maximum angle of view of the imaging device, and the angle of view at the second preset focus lens position can be the minimum angle of view of the imaging device.

[0102] Based on the initial focus lens position and the range of movement of the focus lens during autofocus, the position of the face region in the image can be calculated based on data provided by the lens manufacturer or pre-measured data. Specifically, based on the current focus lens position and the range of movement of the focus lens, the position of the face region at a first preset focus lens position and the position of the face region at a second preset focus lens position can be calculated based on data provided by the lens manufacturer or pre-measured data.

[0103] Refer to Figure 27. Figure 27 is a schematic diagram showing the focus adjustment evaluation regions corresponding to the first preset focus lens position and the second preset focus lens position provided by the embodiment of this application. As shown in Figure 27, the position of the subject on the image is the third position 1100 at the current focus lens position, the position of the subject on the image is the fourth position 1101 at the first preset focus lens position, and the position of the subject on the image is the fifth position 1102 at the second preset focus lens position. Based on the image in which the subject is at the third position 1100, the focus adjustment evaluation region 1000c at the current focus lens position is determined, and further, the focus adjustment evaluation region 1000d at the first preset focus lens position and the focus adjustment evaluation region 1000e at the second preset focus lens position are determined. The overlapping region 1107 of the focus adjustment evaluation region 1000d at the first preset focus lens position and the focus adjustment evaluation region 1000e at the second preset focus lens position is defined as the first target focus adjustment evaluation region 1000.

[0104] In this way, even when the angle of view changes due to the movement of the focus lens, the first target focus adjustment evaluation area 1000 will not move out of the face area, and the influence of the change in the angle of view on the autofocus adjustment operation can be reduced, thus reducing the impact on the accuracy of autofocus adjustment.

[0105] Before determining the positions of the focus adjustment evaluation region at the first and second preset focus lens positions, the autofocus control method further includes determining whether the face region is in the central region of the image based on the image acquired at the current focus lens position. Determining the positions of the focus adjustment evaluation region at the first and second preset focus lens positions based on the position of the focus adjustment evaluation region at the current focus lens position includes determining the positions of the focus adjustment evaluation region at the first and second preset focus lens positions based on the position of the focus adjustment evaluation region at the current focus lens position if the face region is located outside the central region of the image acquired at the current focus lens position.

[0106] When the face area is not in the central region of the image, the accuracy of autofocus can be significantly improved by considering the effect of changes in the field of view on the autofocus operation.

[0107] When eyeglasses are worn, the angle of view changes due to the movement of the focus lens, causing the position of the eyeglasses area 200 to shift and affecting the autofocus adjustment operation. In the embodiment of this application, by considering the effect of the change in the angle of view due to the movement of the focus lens on the position of the eyeglasses area 2000, the influence on the calculation of the focus adjustment evaluation value can be reduced, and consequently, the influence of the change in the angle of view on the autofocus adjustment operation can be reduced.

[0108] Please refer to Figure 28. Figure 28 is a flowchart of the subdivided steps in another example of step S3. In some embodiments, determining the target provisional area 5000 in the first target focus adjustment evaluation area 1000, as shown in Figure 28, specifically includes the following subdivided steps S31 to S33.

[0109] S31. Based on the image collected at the current focus lens position, the focus adjustment evaluation region at the current focus lens position and the provisional region within the focus adjustment evaluation region are determined.

[0110] S32, Based on the position of the provisional region at the current focus lens position, the positions of the provisional region at the first preset focus lens position and the second preset focus lens position are determined.

[0111] S33, the area that overlaps 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 with the first target focus adjustment evaluation area 1000 is defined as the target provisional area 5000.

[0112] Refer to Figures 29 and 30. Figure 29 is a schematic diagram showing how the spectacle area 2000 shifts as the focus lens moves, as provided by an embodiment of this application. Figure 30 is a schematic enlarged view of the subject shown in Figure 29. As shown in Figure 30, the position of the subject on the image is the sixth position 1200 at the current focus lens position, the position of the subject on the image is the seventh position 1201 at the first preset focus lens position, and the position of the subject on the image is the eighth position 1202 at the second preset focus lens position. Based on the image where the subject is at the sixth position 1200, the focus adjustment evaluation area at the current focus lens position is determined, and further, the spectacle area 2000a at the current focus lens position is determined. Based on the spectacle area 2000a at the current focus lens position, the spectacle area 2000b at the first preset focus lens position and the spectacle area 2000c at the second preset focus lens position are determined. Region 1206, which includes the eyeglass region 2000a at the current focus lens position, the eyeglass region 2000b at the first preset focus lens position, and the eyeglass region 2000c at the second preset focus lens position, is as shown in Figure 30. In Figure 30, for the sake of simplicity, the region including the eyeglass region 2000a at the current focus lens position, the eyeglass region 2000b at the first preset focus lens position, and the eyeglass region 2000c at the second preset focus lens position is shown as a rectangle, but in some other embodiments, the region including the eyeglass region 2000a at the current focus lens position, the eyeglass region 2000b at the first preset focus lens position, and the eyeglass 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 the movement of the focus lens, the eyeglasses area 2000 will not move away from the eyeglasses, and the impact of the change in the angle of view on the autofocus operation can be reduced, thus reducing the impact on the accuracy of autofocus.

[0114] In some embodiments, before determining the provisional region at the first and second preset focus lens positions, the autofocus control method further includes determining whether the face region is in the central region of the image based on the image taken at the current focus lens position. Determining the positions of the provisional region at the first and second preset focus lens positions based on the position of the provisional region at the current focus lens position includes determining the positions of the provisional region at the first and second preset focus lens positions based on the position of the provisional region at the current focus lens position if the face region is located outside the central region of the image taken at the current focus lens position.

[0115] In some embodiments, the overlapping region 1107 is designated as the first target focus adjustment evaluation region 1000, and then the target provisional region 5000 and the second target focus adjustment evaluation region 6000 of the overlapping region 1107 are determined, and the 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 steps S31 to S33 described above, and then the second target focus adjustment evaluation region 6000 is determined.

[0116] Please refer to Figure 31. Figure 31 is a schematic diagram of the target provisional region 5000 and the second target focus adjustment evaluation region 6000 of the overlapping region 1107 provided by an embodiment of the present application. As shown in Figure 31, Figure 31 shows region 1206 including the focus adjustment evaluation region 1000c at the current focus lens position, the spectacle region 2000a at the current focus lens position, the spectacle region 2000b at the first preset focus lens position, and the spectacle region 2000c at the second preset focus lens position, and the overlapping region 1107. The portion of region 1206 in the overlapping region 1107 is designated as the target provisional region 5000 of the overlapping region 1107, and the region of the overlapping region 1107 excluding the target provisional region 5000 is designated as the second target focus adjustment evaluation region 6000 of the overlapping region 1107.

[0117] When calculating the focus adjustment evaluation value for the overlapping region 1107, the target provisional region 5000 of the overlapping region 1107 is excluded, or the weighting value of the target provisional region 5000 of the overlapping region 1107 is reduced, and the focus adjustment evaluation value for the overlapping region 1107 is calculated. For the specific calculation method, refer to the method for calculating the focus adjustment evaluation value described above.

[0118] In technologies related to autofocus adjustment, changes in brightness caused by the movement of the focus lens also affect the autofocus adjustment operation. Patent document (Japanese Patent Application Publication No. 2011-175119) describes a method for correcting the focus adjustment evaluation value by calculating a correction coefficient as the ratio of the focus adjustment evaluation value (contrast value) of the acquired brightness evaluation value to the focus adjustment evaluation value (contrast value) of the reference brightness value.

[0119] However, when correcting the focus adjustment evaluation value for brightness changes caused by the movement of the focus lens, different corrections are required for low-light or low-contrast subjects where noise components cannot be ignored, compared to normal illumination. Patent document (Japanese Patent Application Publication No. 2009-237327) shows a method for 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 (photon shot noise) mixed into the image data.

[0120] Please refer to Figure 32. Figure 32 is a schematic diagram showing the mapping relationship between focus lens position, luminance value, and focus adjustment evaluation value in the related technology. As shown in Figure 32, the seventh curve 1301 shows the mapping relationship between focus lens position and focus adjustment evaluation value, and the 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 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 that corresponds to the in-focus position.

[0121] In the embodiments of this application, when correcting the focus adjustment evaluation value considering the change in image brightness due to the movement of the focus lens, the accuracy of autofocus is improved by correcting the focus adjustment evaluation value using different methods for normal illumination and low illumination. This is particularly effective when the subject is a low-contrast face.

[0122] Refer to Figure 33. Figure 33 is a flowchart of the subdivided steps in one example of step S6. In some embodiments, calculating the 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, as shown in Figure 33, specifically includes the following subdivided steps S61, S62.

[0123] S61, based on the luminance values ​​at each focus lens position in the second target focus adjustment evaluation area 6000, the contrast values ​​of the second target focus adjustment evaluation area 6000 are corrected to obtain the corrected contrast values ​​at each focus lens position in the second target focus adjustment evaluation area 6000.

[0124] S62, based on the contrast correction values ​​at each focus lens position in at least the second target focus adjustment evaluation region 6000, the corresponding focus adjustment evaluation values ​​at each focus lens position in the first target focus adjustment evaluation region are calculated.

[0125] To obtain a contrast correction value for each focus lens position in the second target focus adjustment evaluation area 6000 by correcting the contrast value of the second target focus adjustment evaluation area 6000 based on the luminance value of the second target focus adjustment evaluation area 6000, specifically includes correcting the contrast value of each sub-area 400 based on the luminance value of the sub-area 400 of the second target focus adjustment evaluation area 6000, and obtaining a contrast correction value for the sub-area 400.

[0126] The autofocus control method further includes obtaining the contrast value and brightness value of the target provisional region 5000 at each focus lens position of the image collected at each focus lens position, correcting the contrast value of the target provisional region 5000 based on the brightness value at each focus lens position of the target provisional region 5000, and obtaining the contrast correction value at each focus lens position of the target provisional region 5000.

[0127] Correcting the contrast value of the target provisional region 5000 based on the luminance value at each focus lens position of the target provisional region 5000 and obtaining the contrast correction value at each focus lens position of the target provisional region 5000 includes correcting the contrast value of each sub-region 400 based on the luminance value of each sub-region 400 of the target provisional region 5000 and obtaining the contrast correction value of the sub-region 400.

[0128] Calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on the contrast correction value at each focus lens position in the second target focus adjustment evaluation area 6000 includes calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation area based on the contrast correction value at each focus lens position in the second target focus adjustment evaluation area 6000 and the contrast correction value at each focus lens position in the target provisional area 5000, wherein the weighted value of the contrast correction value in the target provisional area 5000 is smaller than the weighted value of the contrast correction value in the second target focus adjustment evaluation area 6000.

[0129] The autofocus control method further includes acquiring imaging information from an imaging device, determining the illumination of the shooting environment based on the imaging information, and determining the target correction method based on the illumination 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 of the imaging device. If the illuminance of the shooting environment is within a first preset illuminance range, it is determined that the illuminance of the shooting environment is normal, and if the illuminance of the shooting environment is within a second preset illuminance range, it is determined that the illuminance of the shooting environment is low. The values ​​within the second preset illuminance range are smaller than the values ​​within the first preset illuminance range.

[0131] Correcting the contrast value of the second target focus adjustment evaluation area 6000 based on the luminance value at each focus lens position in 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 luminance value at each focus lens position in the second target focus adjustment evaluation area 6000.

[0132] Correcting the contrast value of the target provisional region 5000 based on the luminance value at each focus lens position of the target provisional region 5000 includes correcting the contrast value of the target provisional region 5000 using a target correction method based on the luminance value at each focus lens position of the target provisional region 5000.

[0133] Determining the target correction method based on the illuminance of the shooting environment includes determining that if the illuminance of the shooting environment is within a first preset illuminance range, the target correction method will perform the correction based on a first correction formula, which is as follows:

number

[0134] In the first correction formula, the contrast value is the uncorrected contrast value of the second target focus adjustment evaluation area 6000 or target provisional area 5000, and the luminance value is the luminance value of the second target focus adjustment evaluation area 6000 or target provisional area 5000.

[0135] Determining the target correction method based on the illuminance of the shooting environment includes determining that if the illuminance of the shooting environment is within a second preset illuminance range, the target correction method will perform the correction based on a second correction formula, which is as follows:

number

[0136] In the second correction formula, the contrast value is the uncorrected contrast value of the second target focus adjustment evaluation area 6000 or target provisional area 5000, and the luminance value is the luminance value of the second target focus adjustment evaluation area 6000 or target provisional area 5000.

[0137] When calculating the focus adjustment evaluation value, the contrast correction value is used as the contrast value in the formula for calculating the focus adjustment evaluation value mentioned above, and the corrected focus adjustment evaluation value is calculated. That is,

number

[0138] Please refer to Figure 34. Figure 34 is a schematic diagram of the focus adjustment evaluation value after correction using the first correction formula provided by the embodiment of this application. As shown in Figure 34, the ninth curve 1304 shows 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, the correction makes the focus adjustment evaluation value horizontal and allows for accurate acquisition of the peak position, which is the focal position.

[0139] In some embodiments, when noise components are not negligible in low-light shooting environments, it is necessary to correct using a second correction formula. See Figure 35. Figure 35 is a schematic diagram of the focus adjustment evaluation value after correction using the second correction formula provided by embodiments of this application. As shown in Figure 35, the tenth curve 1307 shows 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 the case of low light, the focus adjustment evaluation value is overcorrected and not in a horizontal state after correction using the first correction formula. 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, and after correction using the second correction formula, the focus adjustment evaluation value can be made horizontal, and the peak position, which is the focal position, can be obtained with accuracy.

[0140] Please refer to Figure 36. Figure 36 is a schematic diagram showing the structure of the imaging device 1 provided by an embodiment of the application. As shown in Figure 36, the imaging device 1 includes an image sensor unit 10, an optical lens unit 20, a lens drive unit 30, an image data generation unit 40, a face detection processing unit 50, an autofocus adjustment unit 60, an image signal processing unit 70, and a focus adjustment evaluation value calculation unit 80.

[0141] The optical lens section 20 includes a focusing lens, which is used to concentrate light from the subject onto the image sensor section 10.

[0142] The lens drive unit 30 is used to drive the focus lens in order to adjust the position of the focus lens. The lens drive unit 30 drives the focus lens of the optical lens unit 20 based on the focus lens position data output from the autofocus adjustment unit 60.

[0143] The image sensor unit 10 is used to convert optical signals into image signals, generate raw data for each pixel corresponding to the optical image of the subject, and output the raw data to the image signal processing unit 70.

[0144] The image signal processing unit 70 performs image processing such as shading correction processing, exposure processing, white balance processing, and calculation of contrast and brightness values ​​for multiple sub-regions 400. The contrast value is calculated for each sub-region 400 in the multiple sub-regions 400 based on the high-frequency component signal extracted through a predetermined filter. The brightness value is calculated based on the sum of the individual pixel values ​​in each sub-region 400.

[0145] The image data generation unit 40 is used to output an image based on an image signal and therefore collects an image. Specifically, the image data generation unit 40 generates image data and outputs it externally by performing predetermined signal processing on the data of each pixel.

[0146] The face detection processing unit 50 is used to detect various facial feature data based on the image data output from the image data generation unit 40 and to identify the face region in the collected image.

[0147] The focus adjustment evaluation value calculation unit 80 is used to calculate the focus adjustment evaluation value by performing various correction and weighting calculations using the contrast value and brightness value of each sub-region 400.

[0148] The autofocus adjustment unit 60 is used to set a first target focus adjustment evaluation area 1000 and a target provisional area 5000, perform autofocus adjustment operation processing based on the focus adjustment evaluation value, and output focus lens position data to the lens drive unit 30.

[0149] In some embodiments, the autofocus unit 60 is used to determine a first target focus evaluation region 1000 when the acquired image includes a face region, and the first target focus evaluation region 1000 and the face region overlap at least partially. The autofocus unit 60 is further used to determine a target provisional region 5000 in the first target focus evaluation region 1000. The image signal processing unit 70 is used to obtain the contrast value at each focus lens position of the second target focus evaluation region 6000 of the image acquired at each focus lens position. The focus evaluation value calculation unit 80 is used to calculate the corresponding focus evaluation value at each focus lens position of the first target focus evaluation region 1000 based on the contrast value at each focus lens position of the second target focus evaluation region 6000, and to obtain the focus evaluation value for each focus position. The autofocus unit 60 is further used to determine the target focus position based on the focus evaluation value for each focus position. The lens drive unit 30 is further used to adjust the position of the focus lens to the target focus position.

[0150] The imaging device 1 and the autofocus control method correspond to each other, and for more details, you can refer to the contents of each embodiment of the autofocus control method, and the contents of the imaging device 1 and the autofocus control method are mutually referential.

[0151] Embodiments of the present invention further provide a storage medium. A computer program is stored in the storage medium, and a processor can implement the autofocus control method provided by any one of the embodiments described above by calling and executing the computer program. 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, read-only memory, random access memory, magnetic disk, or optical disk.

[0152] To briefly describe the embodiments of each method described above, they are all described as a combination of a series of operations. However, according to this application, some steps can be performed in other orders or simultaneously, so those skilled in the art should recognize that this application is not limited by the order of operations described. Furthermore, those skilled in the art should recognize that all embodiments described herein are preferred embodiments, and the relevant operations and modules are not necessarily required for this application.

[0153] In the embodiments described above, each embodiment has its own emphasis, and for parts not explained in detail in one embodiment, you can refer to the relevant descriptions in other embodiments.

[0154] While embodiments of this application are illustrated and described, those skilled in the art will understand that these embodiments can be modified, altered, substituted and transformed in various ways without departing from the principles and spirit of this application, and that the scope of this application is limited by the claims.

Claims

1. An automatic focus control method applied to an imaging device including a focus lens, To collect an image of the subject at the current focus lens position, If the collected image includes a facial region, a first target focus adjustment evaluation region is determined, wherein the first target focus adjustment evaluation region and the facial region overlap at least partially. The objective is to determine the provisional target region in the first target focus adjustment evaluation region, wherein the first target focus adjustment evaluation region includes the provisional target region and a second target focus adjustment evaluation region excluding the provisional target region, and the provisional target region includes at least one of the eye region, the eyeglass region, and the teeth region. Adjust the focus lens position and collect an image of the subject after the adjustment. The contrast values ​​at each focus lens position of the second target focus adjustment evaluation region of the images collected at each focus lens position are obtained, Based on the contrast values ​​at least at each focus lens position in the second target focus adjustment evaluation region, the corresponding focus adjustment evaluation values ​​at each focus lens position in the first target focus adjustment evaluation region are calculated, and the focus adjustment evaluation values ​​for each focus position are obtained. Based on the focus adjustment evaluation value for each focus position, the target focus position is determined, and the position of the focus lens is adjusted to the target focus position. An autofocus control method including the following.

2. The aforementioned autofocus control method is, The method further includes obtaining the contrast value at each focus lens position of the target provisional region of the image collected at each focus lens position, Calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation region based on the contrast value at each focus lens position in at least the second target focus adjustment evaluation region is: This includes calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation region based on the contrast values ​​at each focus lens position in the second target focus adjustment evaluation region and the contrast values ​​at each focus lens position in the target provisional region. The weighted value of the contrast value in the aforementioned target provisional region is smaller than the weighted value of the contrast value in the second target focus adjustment evaluation region. The autofocus control method according to claim 1.

3. Before determining the target provisional area in the first target focus adjustment evaluation area, the autofocus adjustment control method further includes determining whether the face area includes eyeglasses. Determining the provisional target area in the first target focus adjustment evaluation area is: If the aforementioned facial region includes eyeglasses, it is determined that the aforementioned provisional target region includes the eyeglasses region. If the aforementioned facial region does not include eyeglasses, then it is determined that the aforementioned provisional target region includes the eye region. including, The autofocus control method according to claim 1.

4. Determining the first target focus adjustment evaluation region is Identifying a characteristic feature of the facial region, wherein the characteristic feature includes at least one of the eyes, nose, and mouth. The first target focus adjustment evaluation region is determined based at least on the position of the characteristic portion, and the first target focus adjustment evaluation region is divided into a plurality of sub-regions, including, The autofocus control method according to feature 3.

5. Determining whether the aforementioned facial region includes eyeglasses is: The minimum contrast value in the plurality of sub-regions and the contrast value of the sub-region adjacent to the eye are obtained, Determining the target detection threshold, The ratio of the contrast value of a sub-region adjacent to the eye to the acquired minimum contrast value is taken as the current first contrast ratio, and based on the current first contrast ratio and the target detection threshold, it is determined whether or not the face region includes glasses. including, The autofocus control method according to feature 4.

6. Determining the aforementioned target detection threshold is To determine a first detection threshold corresponding to a large amount of focus shift and a second detection threshold corresponding to a small amount of focus shift, Based on the first target focus adjustment evaluation region, the current amount of focus shift of the imaging device is determined, Depending on the current amount of focus shift of the imaging device, one of the first detection threshold and the second detection threshold is selected as the target detection threshold. including, The autofocus control method according to feature 5.

7. Determining a first detection threshold corresponding to a large amount of focal shift and a second detection threshold corresponding to a small amount of focal shift is necessary. This includes determining the first detection threshold and the second detection threshold based on a preset ratio, a first mapping relationship, a second mapping relationship, and a third mapping relationship. The first mapping relationship includes a mapping relationship between the focus lens position and a second contrast ratio, where the second contrast ratio is the ratio of the maximum contrast value to the minimum contrast value; the second mapping relationship includes a mapping relationship between the focus lens position and the first contrast ratio when glasses are present; the third mapping relationship includes a mapping relationship between the focus lens position and the first contrast ratio when glasses are absent, where the first contrast ratio is the ratio of the minimum contrast value to the contrast value of the sub-region adjacent to the eye. The autofocus control method according to claim 6.

8. Determining the first detection threshold and the second detection threshold based on a pre-set ratio, a first mapping relationship, a second mapping relationship, and a third mapping relationship is: The focus lens position range defined in the first mapping relationship is divided 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 greater than or equal to the preset ratio in the first mapping relationship, and the second focus lens position range is a focus lens position range corresponding to a second contrast ratio less than the preset ratio in the first mapping relationship. The process involves determining the 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 the maximum first contrast ratio in a 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 smaller than the minimum first contrast ratio and larger than the maximum first contrast ratio to be used as the first detection threshold. The process involves determining the minimum first contrast ratio in the first contrast ratio range corresponding to the second focus lens position range in the second mapping relationship, and determining the 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 that is less than the minimum first contrast ratio and greater than the maximum first contrast ratio to be used as the second detection threshold. including, The autofocus control method according to feature 7.

9. Based on the first target focus adjustment evaluation region, determining the current amount of focus shift of the imaging device is: To obtain the maximum contrast value in the aforementioned multiple sub-regions, The ratio of the acquired maximum contrast value to the minimum contrast value is taken as the current second contrast ratio, and the current amount of focus shift of the imaging device is determined based on the current second contrast ratio and a preset ratio value. including, The autofocus control method according to claim 6.

10. Determining whether the face region includes glasses based on the current first contrast ratio and the target detection threshold is: If the first contrast ratio is greater than the target detection threshold, it is determined that the face region includes glasses. If the first contrast ratio is smaller than the target detection threshold, it is determined that the face region does not include glasses. including, The autofocus control method according to feature 5.

11. Determining whether the aforementioned facial region includes eyeglasses is: To obtain shooting information, Only when it is determined from the aforementioned shooting information that the shooting environment is low-light, will it be determined whether or not the face area includes glasses. including, The autofocus control method according to feature 3.

12. If the aforementioned facial region includes eyeglasses, then determining that the aforementioned provisional target region includes the eyeglasses region means that The aforementioned spectacle region is determined to include a sub-region in which the eye is located, or to further include a sub-region adjacent to the eye, If the aforementioned facial region does not include eyeglasses, then it is determined that the aforementioned target provisional region includes the eye region. The eye region is determined to include a sub-region in which the eye is located. The autofocus control method according to feature 4.

13. Determining the first target focus adjustment evaluation region based at least on the position of the characteristic portion, and dividing the first target focus adjustment evaluation region into a plurality of sub-regions, The method involves obtaining orientation information of the face region, wherein the orientation information includes the yaw angle and / or pitch angle. Based on the position and orientation information of the characteristic portion, the first target focus adjustment evaluation region is determined, and the first target focus adjustment evaluation region is divided into a plurality of sub-regions. including, The autofocus control method according to feature 4.

14. If the collected image includes a facial region, determining the first target focus adjustment evaluation region is necessary. If the image acquired at the current focus lens position includes the face region, the focus adjustment evaluation region corresponding to the current focus lens position is determined. The method includes determining the positions of the focus adjustment evaluation region at a first preset focus lens position and a second preset focus lens position based on the position of the focus adjustment evaluation region at the current focus lens position, and defining the overlapping region between the focus adjustment evaluation region corresponding to the first preset focus lens position and the focus adjustment evaluation region corresponding to the second preset focus lens position as the first target focus adjustment evaluation region. The angle of view at the first preset focus lens position is greater 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. The autofocus control method according to claim 1.

15. Determining the provisional target area in the first target focus adjustment evaluation area is: Based on the image collected at the current focus lens position, the focus adjustment evaluation region at the current focus lens position and the provisional region within the focus adjustment evaluation region are determined. The method involves determining the positions of the provisional region at a first preset focus lens position and a second preset focus lens position based on the position of the provisional region at the current focus lens position, wherein the angle of view at the first preset focus lens position is greater 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. The target provisional region is defined as the region that overlaps with the first target focus adjustment evaluation region, which includes the provisional region corresponding to the current focus lens position, the provisional region corresponding to the first preset focus lens position, and the provisional region corresponding to the second preset focus lens position. including, The autofocus control method according to claim 1.

16. Calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation region based on the contrast value at each focus lens position in at least the second target focus adjustment evaluation region is: Based on the luminance values ​​at each focus lens position in the second target focus adjustment evaluation region, the contrast values ​​of the second target focus adjustment evaluation region are corrected to obtain contrast correction values ​​at each focus lens position in the second target focus adjustment evaluation region. Based on the contrast correction values ​​at each focus lens position in the second target focus adjustment evaluation region, the corresponding focus adjustment evaluation values ​​at each focus lens position in the first target focus adjustment evaluation region are calculated. including, The autofocus control method according to claim 1.

17. The aforementioned autofocus control method is, The process further includes obtaining the contrast and brightness values ​​at each focus lens position of the target provisional region of the image collected at each focus lens position, correcting the contrast value of the target provisional region based on the brightness value at each focus lens position of the target provisional region, and obtaining a contrast correction value at each focus lens position of the target provisional region. Calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation region based on the contrast correction value at each focus lens position in at least the second target focus adjustment evaluation region is: This includes calculating the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation region based on the contrast correction value at each focus lens position in the second target focus adjustment evaluation region and the contrast correction value at each focus lens position in the target provisional region. The weighted value of the contrast correction value for the aforementioned target provisional region is smaller than the weighted value of the contrast correction value for the aforementioned second target focus adjustment evaluation region. The autofocus control method according to claim 16.

18. The aforementioned autofocus control method is, To acquire imaging information from the aforementioned imaging device, Based on the aforementioned shooting information, the illuminance of the shooting environment is determined, The target correction method is determined based on the illumination of the aforementioned shooting environment, It further includes, Correcting the contrast value of the second target focus adjustment evaluation region based on the luminance value at each focus lens position of the second target focus adjustment evaluation region is: This includes correcting the contrast value of the second target focus adjustment evaluation region using the target correction method based on the luminance value at each focus lens position of the second target focus adjustment evaluation region. The autofocus control method according to claim 17.

19. Determining the target correction method based on the illumination of the aforementioned shooting environment is, When the illuminance of the shooting environment is within the first preset illuminance range, the target correction method is determined to perform the correction based on the first correction formula, and the first correction formula is [Number 10] In the first correction formula, the contrast value is the uncorrected contrast value of the second target focus adjustment evaluation region or the target provisional region, and the luminance value is the luminance value of the second target focus adjustment evaluation region or the target provisional region. When the illuminance of the shooting environment is within the second preset illuminance range, the target correction method is determined to perform the correction based on the second correction formula, and the second correction formula is: [Math 11] In the second correction formula, the contrast value is the uncorrected contrast value of the second target focus adjustment evaluation region or the target provisional region, the luminance value is the luminance value of the second target focus adjustment evaluation region or the target provisional region, and the value within the second preset illuminance range is smaller than the value within the first preset illuminance range. including, The autofocus control method according to claim 18.

20. An imaging device, It includes an image sensor unit, an optical lens unit, a lens drive unit, an image data generation unit, a face detection processing unit, an autofocus adjustment unit, an image signal processing unit, and a focus adjustment evaluation value calculation unit. The aforementioned image sensor unit is used to convert optical signals into image signals. The optical lens section includes a focusing lens and is used to concentrate light from the subject onto the image sensor. The lens drive unit is used to drive the focus lens in order to adjust the position of the focus lens. The image data generation unit is used to output an image based on the image signal, and therefore collects an image. The face detection processing unit is used to identify face regions in the collected image. The autofocus adjustment unit is used to determine a first target focus adjustment evaluation region when the collected image includes a face region, and the first target focus adjustment evaluation region and the face region overlap at least partially. The autofocus adjustment unit is further used to determine the provisional target area in the first target focus adjustment evaluation area, the first target focus adjustment evaluation area includes the provisional target area and a second target focus adjustment evaluation area excluding the provisional target area, and the provisional target area includes at least one of the eye area, the eyeglasses area and the teeth area. The image signal processing unit is used to acquire the 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 the corresponding focus adjustment evaluation value at each focus lens position in the first target focus adjustment evaluation region based on the contrast value at each focus lens position in the second target focus adjustment evaluation region, and to obtain the focus adjustment evaluation value for each focus position. The autofocus adjustment unit is further used to determine the target focus position based on the focus adjustment evaluation value for each focus position. The lens drive unit is further used to adjust the position of the focus lens to the target focus position. An imaging device characterized by the following features.