Movement lens control method and device, electronic equipment and storage medium

By determining the depth of field and the position of the focus motor in the movement lens, combined with different focusing clarity calculation methods, the problems of reduced sharpness and insufficient sharpness caused by extremely shallow depth of field are solved, achieving greater depth of field effect and better details Performance.

CN119450242APending Publication Date: 2025-02-14ZHEJIANG UNIVIEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310964649.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The extremely shallow depth of field leads to a decrease in sharpness and insufficient expressiveness of clarity and detail.

Method used

By determining the position of the candidate focus motor corresponding to the depth of field of the movement lens and the different candidate focus clarity, different focusing clarity calculation methods are used to evaluate the lens screen, and the position of the focus motor with the maximum focus clarity is obtained, and the target focus motor is determined based on the depth of field. position to control the movement lens.

Benefits of technology

The depth of field effect of the movement lens is expanded, the depth of field characteristics of the large aperture lens is maximized, the sharpness and clarity of the subject is improved, and the expressiveness of details is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450242A_ABST
    Figure CN119450242A_ABST
Patent Text Reader

Abstract

The invention discloses a movement lens control method and device, electronic equipment and a storage medium. The method comprises the following steps: determining the depth of field of a movement lens; candidate focusing motor positions corresponding to different candidate focusing definitions of the movement lens are determined, and the different candidate focusing definitions are the maximum focusing definitions in different focusing definition calculation modes obtained by evaluating a lens picture by adopting different focusing definition calculation modes when the movement lens performs automatic focusing; the different focusing definition calculation modes have different attention degrees on different areas of a lens picture; determining a target focusing motor position adopted by the movement lens according to the depth of field of the movement lens and the candidate focusing motor positions corresponding to the different candidate focusing definitions; and controlling the movement lens according to the target focusing motor position. According to the scheme, the problems that the sharpness of a shot subject is reduced and the definition and detail expressive force are insufficient due to extremely shallow depth of field can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a movement lens control method, device, electronic equipment and storage medium. Background Art

[0002] With the popularity of large aperture lenses in the video detection industry, the greater amount of light entering has greatly improved the image quality at night.

[0003] The larger the aperture, the smaller the depth of field; the smaller the aperture, the larger the depth of field. Although a large aperture can provide more light, it can produce a clear subject and a blurred background, and can effectively separate the subject from the background. However, sometimes the depth of field is extremely shallow, which may reduce the sharpness of the subject, and the clarity and details are not expressive enough. Summary of the invention

[0004] The present invention provides a movement lens control method, device, electronic equipment and storage medium to solve the problem that the sharpness of the photographed subject is reduced and the clarity and detail expression are insufficient due to the extremely shallow depth of field.

[0005] According to one aspect of the present invention, a movement lens control method is provided, the method comprising:

[0006] Determine the depth of field of the movement lens;

[0007] Determine the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, wherein the different candidate focus sharpnesses are maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and the different focus sharpness calculation methods have different attentions to different areas of the lens picture;

[0008] Determining a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses;

[0009] The movement lens is controlled according to the target focus motor position.

[0010] According to another aspect of the present invention, a movement lens control device is provided, the device comprising:

[0011] A first determination module is used to determine the depth of field of the movement lens;

[0012] A second determination module is used to determine the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, wherein the different candidate focus sharpnesses are the maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and the different focus sharpness calculation methods have different attention levels on different areas of the lens picture;

[0013] A third determination module is used to determine a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses;

[0014] A control module is used to control the movement lens according to the target focus motor position.

[0015] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the movement lens control method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the movement lens control method described in any embodiment of the present invention when executed.

[0020] The technical solution of the embodiment of the present invention determines the depth of field of the movement lens and determines the candidate focus motor positions of the movement lens corresponding to different candidate focus sharpnesses. The different candidate focus sharpnesses are the maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing. Different focus sharpness calculation methods have different attention to different areas of the lens picture. Therefore, according to the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus sharpnesses, a suitable target focus motor position can be determined to control the movement lens. By analyzing the object distance distribution under the lens picture scene of the movement lens, the focus motor positions that can produce the maximum focus sharpness obtained by different focus sharpness calculation methods are combined with the depth of field of the movement lens to obtain the focus motor position with the most depth of field and object distance, thereby expanding the depth of field effect of the movement lens and maximizing the depth of field characteristics of the large aperture lens.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flow chart of a movement lens control method provided according to an embodiment of the present invention;

[0024] Figure 2 is a diagram of a principle for evaluating focus clarity applicable to an embodiment of the present invention;

[0025] Figure 3 is a flow chart of another movement lens control method provided according to an embodiment of the present invention;

[0026] Figure 4 is a curve diagram of a focus motor position corresponding to a search for maximum focus clarity applicable to an embodiment of the present invention;

[0027] Figure 5 is a schematic diagram of the depth of field of a movement lens applicable to an embodiment of the present invention;

[0028] Figure 6a is a schematic diagram of central weight applicable to an embodiment of the present invention;

[0029] Figure 6b This is a schematic diagram of the upper left and upper right weights applicable to an embodiment of the present invention;

[0030] Figure 6c This is a schematic diagram of the lower left and lower right weights applicable to an embodiment of the present invention;

[0031] Figure 6d is a schematic diagram of the center weight representation applicable to the embodiment of the present invention;

[0032] Figure 7 is a flow chart of another movement lens control method provided by an embodiment of the present invention;

[0033] Figure 8 is a schematic diagram of an aperture motor position and a sharpness value curve according to an average weight applicable to an embodiment of the present invention;

[0034] Fig. 9 is a schematic diagram of an MTF curve of a lens applicable to an embodiment of the present invention;

[0035] Fig.10 is a schematic representation of m*n edge weights applicable to an embodiment of the present invention;

[0036] Fig.11 is a schematic diagram of an aperture motor position and a sharpness value curve according to an edge weight applicable to an embodiment of the present invention;

[0037] Fig.12 is a structural schematic diagram of a movement lens control device provided according to an embodiment of the present invention;

[0038] Fig.13 It is a structural schematic diagram of an electronic device for implementing the movement lens control method of an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0041] Figure 1 A flowchart of a movement lens control method is provided for an embodiment of the present invention. This embodiment is applicable to the situation where the exposure of the movement lens is controlled during operation. The method can be executed by a movement lens control device. The movement lens control device can be implemented in the form of hardware and / or software. The movement lens control device can be configured in any electronic device with a network communication function, and the electronic device can be a camera with a movement lens, etc.

[0042] like Figure 1 As shown, the movement lens control method of this embodiment may include the following process:

[0043] S110, determining the depth of field of the movement lens.

[0044] The movement lens can be called an integrated movement, which is mainly composed of a lens group, an imaging sensor, and a circuit board. The lens group includes a zoom lens and a focusing lens. The zoom lens and the focusing lens are driven by a zoom motor and a focusing motor respectively. The zoom motor moves to change the focal length, and the focusing motor moves to change the front and rear position of the focus.

[0045] The depth of field of a mobile lens refers to the range of distances in front of and behind the object measured by the imaging at the front of the mobile lens that can obtain a clear image. When the object is within this space, it is a distance from clear to blurred.

[0046] As an optional but non-limiting implementation, determining the depth of field of the camera lens includes:

[0047] The depth of field of the movement lens is determined based on the object distance of the movement lens, the position of the zoom motor used when the movement lens performs autofocus, and the aperture information used by the movement lens.

[0048] The depth of field of a movement lens is affected by the aperture used by the movement lens, the focal length of the movement lens (which can be indicated by the position of the movement lens's zoom motor), and the distance to the subject. The longer the focal length of the movement lens, the smaller the depth of field; the shorter the focal length of the movement lens, the greater the depth of field. The larger the aperture used by the movement lens, the smaller the depth of field; the smaller the aperture used by the movement lens, the greater the depth of field. The aperture size is generally indicated by F value, such as F1.0, F1.2, and F1.4. The smaller the F value, the larger the aperture, and the larger the F value, the smaller the aperture. The farther the distance between the movement lens and the subject, the greater the depth of field; the closer the distance between the movement lens and the subject, the smaller the depth of field.

[0049] S120, determining candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, where the different candidate focus sharpnesses are maximum focus sharpnesses obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and different focus sharpness calculation methods have different attentions on different areas of the lens picture.

[0050] See also Figure 2When the movement lens performs automatic focusing, the focus clarity of the lens image can be evaluated. The evaluation value of the focus clarity can be an evaluation parameter that reflects the focus clarity of the image. The clearer the image, the greater the evaluation value of the focus clarity (Focus Value, FV). When evaluating the focus clarity of the lens image of the movement lens, the lens image can usually be divided into multiple grid areas, and a focus clarity evaluation weight is assigned to each grid area to complete the focus clarity evaluation of the lens image; for example, a statistical information matrix for focus clarity evaluation is obtained by performing RAW image analysis on the lens image of the movement lens, and the statistical information matrix is ​​convolved with the weight matrix to obtain the final focus clarity evaluation value. The weight matrix is ​​generated by assigning focus clarity evaluation weights to each grid area.

[0051] When the movement lens performs automatic focusing, for the same lens picture, the focus clarity evaluation weights used in the lens picture are different, and the focus motor positions corresponding to the maximum focus clarity obtained when evaluating the focus clarity are different. It can be seen that when the attention paid to different areas in the lens picture is different, the focus clarity evaluation weights used to evaluate the focus clarity of the lens picture of the movement lens are also different. In other words, the focus motor positions corresponding to the maximum focus clarity obtained under different focus clarity calculation methods when evaluating the lens picture using different focus clarity calculation methods may be different, or may be partially the same. Different focus clarity calculation methods correspond to different clarity evaluation weights used to evaluate the clarity of each area in the lens picture when the movement lens performs automatic focusing.

[0052] S130, determining a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus sharpnesses.

[0053] Different focus clarity calculation methods pay different attention to different areas of the lens image. By using different focus clarity calculation methods to evaluate the clarity of the lens image, we can obtain the focus motor positions that correspond to different object distances that can make it focus clearly in the lens image. The focus motor positions that correspond to different areas of the lens image that can achieve maximum focus clarity are recorded as candidate focus motor positions corresponding to different candidate focus clearnesses. Finally, combined with the depth of field of the movement lens, it is determined which candidate focus motor positions are within the same depth of field. In this way, the candidate focus motor positions within the same depth of field can be guaranteed to optimize and screen out a target focus motor position that corresponds to a clear point that can take into account more object distances, which can solve the problem of reduced sharpness of the subject when the depth of field is shallow and insufficient expression of clarity and details.

[0054] S140, controlling the movement lens according to the target focus motor position.

[0055] During the automatic focusing of the movement lens, a target focus motor position corresponding to a clear point that can take into account more object distances can be determined, the focus motor of the movement lens can be controlled to continue automatic focusing according to the target focus motor position, and the movement lens can be controlled to expose after focusing is completed.

[0056] According to the technical solution of the embodiment of the present invention, when the movement lens performs automatic focusing, different focus clarity calculation methods are used to evaluate the lens picture to obtain the maximum focus clarity under different focus clarity calculation methods. Different focus clarity calculation methods have different attention to different areas of the lens picture, and then the movement lens can be controlled by determining a suitable target focus motor position based on the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus clearnesses. By analyzing the distribution of object distances under the lens picture scene of the movement lens, the focus motor positions that can produce maximum focus clarity obtained by different focus clarity calculation methods are combined with the depth of field of the movement lens to obtain the focus motor position with the most depth of field and object distance, thereby expanding the depth of field effect of the movement lens and maximizing the depth of field characteristics of the large aperture lens.

[0057] Figure 3 A flowchart of another movement lens control method is provided for an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining the candidate focus motor position corresponding to different candidate focus sharpness of the movement lens in the aforementioned embodiment on the basis of the above embodiment. This embodiment can be combined with various optional solutions in one or more of the above embodiments.

[0058] like Figure 3 As shown, the movement lens control method of this embodiment may include the following process:

[0059] S310, determining the depth of field of the movement lens.

[0060] S320, determining a candidate focus motor position search interval used when the movement lens performs automatic focus fine adjustment, the candidate focus motor position search interval is a focus motor position configuration corresponding to the maximum focus clarity obtained by the movement lens after automatic focus coarse adjustment, the coarse focus adjustment uses a first focus motor adjustment step for automatic focusing, and the fine focus adjustment uses a second focus motor adjustment step for automatic focusing, and the first focus motor adjustment step is greater than the second focus motor adjustment step.

[0061] The automatic focusing algorithm is used when the movement lens is automatically focused, which can be divided into coarse focus adjustment and fine focus adjustment. Coarse focus adjustment uses a larger first focus motor adjustment step and a larger focus motor position search interval to preliminarily determine the focus motor position that can produce a higher focus clarity in the focus motor position search interval. Fine focus adjustment mainly uses a smaller second focus motor adjustment step. Based on the focus motor position corresponding to the maximum focus clarity obtained from the coarse focus adjustment result, a smaller focus motor position search interval is set, which is recorded here as the candidate focus motor position search interval, so as to accurately search for the focus motor position with the maximum focus clarity within the range. The first focus motor adjustment step can be a fixed-length step or a dynamically adjusted non-fixed-length step.

[0062] For example, see Figure 4 In the process of coarse automatic focusing adjustment of the movement lens, when the focus motor of the movement lens is moved, the evaluation value of the focus clarity when moving to each focus motor position for focusing can be calculated frame by frame, and a curve FV can be constructed with the horizontal axis being the focus motor position and the vertical axis being the focus clarity evaluation value FV value. Optionally, a full-range search and hill climbing algorithm can be used to search for the focus motor position Focus that can produce the maximum focus clarity during the coarse automatic focusing adjustment of the movement lens. coarse , and then you can use Focus coarse Configure the candidate focus motor position search interval used when generating the movement lens for automatic focus fine adjustment.

[0063] As an optional but non-limiting implementation, determining the candidate focus motor position search interval used when the movement lens performs automatic focus fine adjustment may include steps A1-A3:

[0064] Step A1, determining the focus motor position corresponding to the maximum focus clarity obtained by the movement lens through automatic focus coarse adjustment.

[0065] Step A2, determining the depth of field step length of the movement lens, the depth of field step length being half of the difference in the focus motor position when the front depth of field and the back depth of field corresponding to the depth of field of the movement lens each satisfy a preset focus clarity.

[0066] Step A3, adding or subtracting an offset adjustment is performed on the focus motor position corresponding to the maximum focus clarity obtained by the coarse adjustment of the automatic focus according to the preset multiple value of the depth of field step of the movement lens, so as to determine the candidate focus motor position search interval used when the movement lens performs the automatic focus fine adjustment.

[0067] See also Figure 5 , the focus motor position corresponding to the maximum focus clarity obtained by the automatic focus coarse adjustment of the movement lens Focus coarseBased on the depth of field step of the movement lens, the focus motor position corresponding to the maximum focus clarity is Focus coarse Float up and down to define the candidate focus motor position search interval used when the movement lens performs automatic focus fine adjustment:

[0068] [Focus coarse -Focus A ,Focus coarse +Focus A ]

[0069] Among them, Focus A =i*Focus DOF , Focus DOF Indicates the depth of field step of the core lens under the object distance and aperture used by the core lens. i=1,2,…,n, generally i can be selected as 2.

[0070] See also Figure 5 The depth of field step size used by the movement lens can be measured by the following method: the depth of field of the movement lens at different apertures Fno (Fnumber, F value) and zoom motor positions (corresponding to the focal length Focal of the movement lens) is known, and it is obtained by confirming that the foreground depth of field and the back depth of field of the movement lens correspond to half of the difference between the focus motor positions that meet the preset focus clarity.

[0071] Focus DOF (Fno, Focal) = | Focus 前景深 -Focus 后景深 | / 2.

[0072] Among them, Focus 前景深 Indicates the focus motor position that can meet the preset focus clarity corresponding to the foreground depth when the movement lens performs automatic focusing. 后景深 Indicates the focus motor position that can meet the preset focus clarity corresponding to the depth of field when the movement lens is automatically focusing.

[0073] S330, controlling the focus motor of the movement lens to perform fine focus adjustment in the candidate focus motor position search interval, and determining the candidate focus motor positions of the movement lens corresponding to different candidate focus sharpnesses.

[0074] Among them, different candidate focus sharpnesses are the maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing. Different focus sharpness calculation methods pay different attention to different areas of the lens picture.

[0075] During the automatic focus fine-tuning of the movement lens, the focus clarity evaluation crowd corresponding to the designed different focus clarity calculation methods is used, and the corresponding focus clarity evaluation value of the movement lens focusing at each focus motor position in the candidate focus motor position search interval is calculated. Finally, the focus motor position corresponding to the maximum focus clarity calculated by using different focus clarity calculation methods in the candidate focus motor position search interval is obtained, which is recorded as the candidate focus motor position corresponding to different candidate focus clarity.

[0076] As an optional but non-limiting implementation, determining the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens may include steps B1-B3:

[0077] Step B1, determining a first focus motor position corresponding to a first focus clarity obtained by evaluating a lens image using a first focus clarity calculation method when the movement lens performs automatic focusing, wherein when evaluating the lens image, the first focus clarity calculation method pays more attention to a central area of ​​the lens image than to an edge area, and both the central area and the edge area have a degree of attention, or when evaluating the lens image, the first focus clarity calculation method pays more attention to a lower half of the lens image than to an upper half.

[0078] The first focus clarity calculation method may be to select the weight of the focus area when focusing on the local position in the middle of the lens picture, such as the center weight. When evaluating the lens picture, the focus on the center area of ​​the lens picture is greater than the focus on the edge area, and the focus on the area of ​​the lens picture decreases from the middle position to the edge position. Figure 6a The first focus clarity calculation method is set to central weight. The weight distribution level and size are not limited. The middle area has a high weight value and the edge area has a low weight value. Figure 6a The m*n weight table used in this case is Weight 1 .

[0079] Optionally, the first focus clarity calculation method may also be to focus on the weight of the global position of the lens picture, such as an average weight, so that the degree of attention paid to each area of ​​the lens picture is equal or approximately the same when evaluating the lens picture.

[0080] Step B2, determining the second focus motor position corresponding to the second focus clarity obtained by respectively using different second focus clarity calculation methods to evaluate the lens image when the movement lens performs automatic focusing, each second focus clarity calculation method only pays attention to a local area in the lens image when evaluating the lens image, and different second focus clarity calculation methods correspond to different local areas of interest, and the first focus clarity and the second focus clarity are the maximum focus clarity obtained by using their respective focus clarity calculation methods during automatic focusing.

[0081] This solution adds focus clarity evaluation weights for special areas. This part of the weight is mainly used to detect the distribution of object distances in the lens image. The weight value of the concerned local area is set to a high value, and the weight value of the unconcerned local area is 0, that is, only the local area in the lens image is concerned, and no attention is paid to other local areas. The focus clarity evaluation weight distribution and weight value of different local areas can be set on the software of the actual device, or the algorithm built-in weight distribution and weight table can be used.

[0082] See also Figure 6b-6d Different second focus clarity calculation methods have different local areas of concern in the lens picture when evaluating the lens picture, and each second focus clarity calculation method only pays attention to a local area in one direction when evaluating the lens picture, while no attention is paid to local areas in other directions. Exemplarily, the lens picture allows the local areas in the lower left, upper right, lower right, upper right and middle directions of the lens picture to be configured with attention. Combined with the context, the above direction configuration is only an example, and an interface can be provided to the user to dynamically adjust the attention of different areas in the lens picture to form different second focus clarity calculation methods.

[0083] See also Figure 6b-6d , different second focus clarity calculation methods configure the focus clarity evaluation weight distribution and weight value when evaluating the focus clarity of the lens image. The weight distribution and weight value of m*n are designed as follows. The weight distribution of the local area of ​​interest is top left (TopLeft, referred to as TL), top right (TopRight, referred to as TR), bottom left (BottonLeft, referred to as BL), bottom right (BottonRight, referred to as BR), center (Centor, referred to as C). The weight distribution size of the local area of ​​interest is set to 4*4. The size of the area can be set separately. The built-in weight table mainly limits the position of the local area of ​​interest. The weight tables are: Weight TL 、Weight TR 、Weight BL 、Weight BR 、Weight C .

[0084] During the automatic focus fine-tuning of the movement lens, the focus clarity evaluation weight distribution and weight value of the designed first focus clarity calculation method, as well as the focus clarity evaluation weight distribution and weight value of different second focus clarity calculation methods, are used to calculate the focus clarity evaluation value corresponding to each focus motor position, and finally the focus motor position corresponding to the maximum focus clarity calculated by different focus clarity calculation methods within the candidate focus motor position search interval is obtained. Focus motor position corresponding to the maximum focus clarity calculated by the first focus clarity calculation method Focus Fine , the focus motor position corresponding to the maximum focus clarity calculated by the second focus clarity calculation method is the focus motor position Focus in the upper left area TL , the focus motor position in the upper right area is Focus TR , the focus motor position in the lower left area is Focus BL , the focus motor position in the lower right area is Focus BR , the focus motor position of the center area Focus c .

[0085] Step B3: determine the first focus motor position and the second focus motor position as candidate focus motor positions corresponding to different candidate focus sharpnesses.

[0086] S340, determining a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus sharpnesses.

[0087] S350, controlling the movement lens according to the target focus motor position.

[0088] According to the technical solution of the embodiment of the present invention, when the movement lens performs automatic focusing, different focus clarity calculation methods are used to evaluate the lens picture to obtain the maximum focus clarity under different focus clarity calculation methods. Different focus clarity calculation methods have different attention to different areas of the lens picture, and then the movement lens can be controlled by determining a suitable target focus motor position based on the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus clearnesses. By analyzing the distribution of object distances under the lens picture scene of the movement lens, the focus motor positions that can produce maximum focus clarity obtained by different focus clarity calculation methods are combined with the depth of field of the movement lens to obtain the focus motor position with the most depth of field and object distance, thereby expanding the depth of field effect of the movement lens and maximizing the depth of field characteristics of the large aperture lens.

[0089] Figure 7A flowchart of another movement lens control method is provided for an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining the target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus sharpnesses in the above-mentioned embodiment on the basis of the above-mentioned embodiment. This embodiment can be combined with various optional schemes in one or more of the above-mentioned embodiments.

[0090] like Figure 7 As shown, the movement lens control method of this embodiment may include the following process:

[0091] S710, determine the depth of field of the movement lens.

[0092] S720, determining candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, where the different candidate focus sharpnesses are maximum focus sharpnesses obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and different focus sharpness calculation methods have different attentions on different areas of the lens picture.

[0093] S730. Determine a reference focus motor position from the candidate focus motor positions corresponding to different candidate focus sharpnesses. The reference focus motor position is a maximum focus sharpness obtained by evaluating a lens image using a reference focus sharpness calculation method when the movement lens performs automatic focusing. The reference focus sharpness calculation method is a focus sharpness calculation method in which, when evaluating the lens image, a degree of attention is paid to a central area of ​​the lens image more than to an edge area.

[0094] S740: Determine a target focus motor position search interval according to the depth of field of the movement lens and the reference focus motor position.

[0095] As an optional but non-limiting implementation, the target focus motor position search interval is determined according to the depth of field of the movement lens and the reference focus motor position, including steps C1-C2:

[0096] Step C1, determining the depth of field step length of the movement lens, where the depth of field step length is half of the difference in the focus motor position when the front depth of field and the back depth of field corresponding to the depth of field of the movement lens each meet the preset focus clarity.

[0097] Step C2: performing addition and subtraction offset adjustment on the reference focus motor position according to the depth of field step of the movement lens to determine the target focus motor position search interval.

[0098] According to Focus TL , Focus TR , Focus BL , Focus BR and Focusc , the focus motor position differences between the local areas of interest to the movement lens can be analyzed.

[0099] To achieve a large depth of field, the focusing effect can take into account more object distances. Fine And the depth of field step length of the aperture used by the movement lens Focus DOF Based on the focus TL , Focus TR , Focus BL , Focus BR and Focus c Which focus motor position is in the reference focus motor position Focus Fine The target focus motor position search interval is within the reference range, and the conditions are:

[0100] (Focus Fine -Focus DOF )≤Focus≤(Focus Fine +Focus DOF )

[0101] S750: Determine the target focus motor position used by the movement lens according to the candidate focus motor positions located in the target focus motor position search interval.

[0102] If none of the candidate focus motor positions is within the target focus motor position search interval, the target focus motor position used for fine-tuning the movement lens focus is Focus newFine =Focus Fine .

[0103] If there are candidate focus motor positions located in the target focus motor position search interval, each candidate focus motor position located in the target focus motor position search interval can be recorded as:

[0104] Focus i =(Focus 1 、Focus 2 …Focus n ).

[0105] Where i = 1, 2, ..., n, n ≤ the number of local areas in the lens image that can be set to focus, (Focus 1 ,Focus 2 ,…,Focus n )∈(Focus TL ,Focus TR ,Focus BL ,Focus BR ,Focusc ).

[0106] As an optional but non-limiting implementation, determining the target focus motor position used by the movement lens according to the candidate focus motor position located in the target focus motor position search interval may include steps D1-D2:

[0107] Step D1, determining the candidate focus motor position weights of the candidate focus motor positions within the target focus motor position search interval, wherein the candidate focus motor position weights are configured based on the weights of the adopted focus clarity calculation method.

[0108] Step D2: taking a weighted average of the candidate focus motor positions within the target focus motor position search interval according to the weights of the candidate focus motor positions to obtain a target focus motor position used by the movement lens.

[0109] According to Focus Fine and Focus i , calculate the new target focus motor position according to the weight. If you want to get closer to the edge, increase the edge w 1 …w n If you want to be closer to the center, increase the center w 0 The weight of the data. Generally, the weight value can be set to 1 to obtain the average weight result.

[0110]

[0111] The clarity evaluation value is not an absolute indicator. The clarity evaluation values ​​of different weighted areas cannot be directly summed up to get the best focus motor position. This method avoids the above problem. By calculating the focus motor position of each area, the focus motor position that can take into account more object distances within the depth of field range is finally obtained by summing the weights of the focus motor positions of different areas.

[0112] S760, controlling the movement lens according to the target focus motor position.

[0113] According to the technical solution of the embodiment of the present invention, when the movement lens performs automatic focusing, different focus clarity calculation methods are used to evaluate the lens picture to obtain the maximum focus clarity under different focus clarity calculation methods. Different focus clarity calculation methods have different attention to different areas of the lens picture, and then the movement lens can be controlled by determining a suitable target focus motor position based on the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus clearnesses. By analyzing the distribution of object distances under the lens picture scene of the movement lens, the focus motor positions that can produce maximum focus clarity obtained by different focus clarity calculation methods are combined with the depth of field of the movement lens to obtain the focus motor position with the most depth of field and object distance, thereby expanding the depth of field effect of the movement lens and maximizing the depth of field characteristics of the large aperture lens.

[0114] As an optional but non-limiting implementation, the movement lens is controlled according to the target focus motor position, including steps E1-E2:

[0115] Step E1, determining the aperture information used by the movement lens, where the aperture information used by the movement lens is used to enable the movement lens to maintain the focus clarity effect.

[0116] Step E2: Control the movement lens according to the target focus motor position and the aperture information used by the movement lens.

[0117] During focusing, the automatic exposure is suspended and adjusted to ensure that the position judgment of the focus motor is not disturbed by exposure. After the focus motor position is determined after focusing is completed, the focus motor of the movement lens can be controlled to continue automatic focusing according to the target focus motor position, and the automatic exposure is resumed and adjusted. The algorithm will adjust the exposure according to the aperture size used by the movement lens, and finally obtain a set of suitable exposure parameters, and control the movement lens to expose after focusing is completed.

[0118] Based on the above embodiment, optionally, the movement lens control method of this embodiment may further include the following steps F1-F2:

[0119] Step F1, determining the candidate aperture size of the movement lens and the corresponding candidate aperture motor position, the candidate aperture size is the aperture motor position corresponding to the maximum focus clarity obtained by controlling the aperture motor to move when the movement lens performs automatic focusing so as to evaluate the lens image using the third focus clarity calculation method, and the third focus clarity calculation method pays attention to the edge area of ​​the lens image and does not pay attention to the center area when evaluating the lens image.

[0120] See also Figure 8, when controlling the aperture by referring to the method of controlling the focus motor, it is necessary to set the weight. If the average weight is used and the aperture step length is adjusted, a curve consisting of the aperture step number and the clarity value can be obtained. The horizontal axis is the aperture motor, and the aperture size increases as the aperture motor position increases. Since the picture brightness has a positive correlation with the clarity evaluation value, that is, as the aperture increases, the clarity evaluation value also increases. When the aperture size increases to a certain extent, the picture details basically no longer change, and the clarity value will no longer change. Since this relationship is a monotonic relationship, it is impossible to determine the regional maximum value. Therefore, the conventional average weight is not suitable for adjusting the aperture.

[0121] See also Fig. 9 , from the lens MTF (Modulation Transfer Function) curve, we can see that the image quality at the edge of the lens will degrade faster than the center. Fig.10 The edge weight of m*n is greater than the center weight. In this example, the edge weight is 1 and the center weight is 0.

[0122] See also Fig.10 The third focus clarity calculation method is to use edge weights to evaluate the edge area of ​​the lens image and the center area when evaluating the lens image. The edge weights are used to adjust the aperture to obtain a curve of the aperture step number and the focus clarity value. The obtained curve is as follows: Fig.11 The peak of the focus clarity value appears closer to the center. The number of rows of edge weight values ​​and the weight of a specific area can be adjusted based on the actual depth of field performance of the lens.

[0123] Step F2: determining the aperture information used by the movement lens according to the candidate aperture sizes and the corresponding candidate aperture motor positions.

[0124] Candidate aperture size Iris obtained based on the edge weight corresponding to the third focus clarity calculation method and the automatic exposure algorithm A , the corresponding candidate aperture motor position is Iris MotorA The aperture motor that drives the movement lens fixes the automatic exposure parameters, searches for the aperture motor position with the highest focus clarity in a certain small step length, and obtains the final aperture motor position Iris MotorB And the corresponding aperture size Iris B , as the aperture information used by the movement lens, the automatic exposure algorithm is restored after the aperture control is completed to compensate for the exposure difference caused by the aperture change.

[0125] In order to improve efficiency and solve the problem of dark images when searching at small apertures, the search range of the aperture motor is introduced. Figure 8 and Fig.11It can be seen that both positions are close to the optimal aperture position, and the aperture position obtained by the general automatic exposure algorithm is also close to the optimal aperture position recommended by the lens. Therefore, based on the aperture of automatic exposure, a certain range of Iris is set on the left and right. Range , the interval is as follows. Among them, Iris Range It can be 1 / 4 of the entire aperture motor controllable range.

[0126] [Iris MotorA -Iris Range ,Iris MotorA +Iris Range ]

[0127] At this point, the entire focus motor and aperture adjustment is completed, achieving the goal of taking into account multiple object distances and optimizing depth of field effects.

[0128] Fig.12 A structural block diagram of a movement lens control device is provided for an embodiment of the present invention. This embodiment can be applied to the situation where the exposure of the movement lens is controlled during operation. The movement lens control device can be implemented in the form of hardware and / or software. The movement lens control device can be configured in any electronic device with a network communication function, and the electronic device can be a camera with a movement lens, etc.

[0129] like Fig.12 As shown, the movement lens control device of this embodiment may include:

[0130] A first determination module 1210 is used to determine the depth of field of the movement lens;

[0131] The second determination module 1220 is used to determine the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, wherein the different candidate focus sharpnesses are the maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and the different focus sharpness calculation methods have different attention levels on different areas of the lens picture;

[0132] A third determination module 1230 is used to determine a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses;

[0133] The control module 1240 is used to control the movement lens according to the target focus motor position.

[0134] Based on the above embodiment, optionally, determining the depth of field of the movement lens includes:

[0135] The depth of field of the movement lens is determined according to the object distance of the movement lens, the position of the zoom motor used when the movement lens performs automatic focusing, and the aperture information used by the movement lens.

[0136] Based on the above embodiment, optionally, determining the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens includes:

[0137] Determine a candidate focus motor position search interval used when the movement lens performs automatic focus fine adjustment, the candidate focus motor position search interval is a focus motor position configuration corresponding to the maximum focus clarity obtained by the movement lens through automatic focus coarse adjustment, the coarse focus adjustment uses a first focus motor adjustment step length for automatic focusing, the fine focus adjustment uses a second focus motor adjustment step length for automatic focusing, and the first focus motor adjustment step length is greater than the second focus motor adjustment step length;

[0138] The focus motor of the movement lens is controlled to perform focus fine adjustment in the candidate focus motor position search interval, and the candidate focus motor positions of the movement lens corresponding to different candidate focus sharpnesses are determined.

[0139] Based on the above embodiment, optionally, determining a candidate focus motor position search interval used when the movement lens performs automatic focus fine adjustment includes:

[0140] Determine the focus motor position corresponding to the maximum focus clarity obtained by the movement lens through automatic focus coarse adjustment;

[0141] Determine the depth of field step of the movement lens, where the depth of field step is half of the difference between the front depth of field and the back depth of field corresponding to the depth of field of the movement lens so that each of them satisfies a preset focus clarity;

[0142] The focus motor position corresponding to the maximum focus clarity obtained by the automatic focus coarse adjustment is adjusted by adding or subtracting an offset through the preset multiple value of the depth of field step of the movement lens, and the candidate focus motor position search interval used when the movement lens performs automatic focus fine adjustment is determined.

[0143] Based on the above embodiment, optionally, determining the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens includes:

[0144] Determine a first focus motor position corresponding to a first focus clarity obtained by evaluating a lens picture using a first focus clarity calculation method when the movement lens performs automatic focusing, wherein the first focus clarity calculation method pays more attention to a central area of ​​the lens picture than to an edge area when evaluating the lens picture, and both the central area and the edge area have a degree of attention;

[0145] Determine a second focus motor position corresponding to a second focus clarity obtained by respectively using different second focus clarity calculation methods to evaluate the lens picture when the movement lens performs automatic focusing, wherein each second focus clarity calculation method only pays attention to a local area in the lens picture when evaluating the lens picture, and different second focus clarity calculation methods correspond to different local areas with attention, and the first focus clarity and the second focus clarity are maximum focus clarity obtained by using their respective focus clarity calculation methods during automatic focusing;

[0146] The first focus motor position and the second focus motor position are determined as candidate focus motor positions corresponding to different candidate focus sharpnesses.

[0147] On the basis of the above embodiment, optionally, determining the target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses includes:

[0148] Determining a reference focus motor position from the candidate focus motor positions corresponding to the different candidate focus sharpnesses, the reference focus motor position being a maximum focus sharpness obtained by evaluating a lens picture using a reference focus sharpness calculation method when the movement lens performs automatic focusing, the reference focus sharpness calculation method being a focus sharpness calculation method in which, when evaluating the lens picture, a degree of attention paid to a central area of ​​the lens picture is greater than a degree of attention paid to an edge area;

[0149] Determining a target focus motor position search interval according to the depth of field of the movement lens and a reference focus motor position;

[0150] The target focus motor position used by the movement lens is determined according to the candidate focus motor positions located in the target focus motor position search interval.

[0151] Based on the above embodiment, optionally, determining a target focus motor position search interval according to the depth of field of the movement lens and a reference focus motor position includes:

[0152] Determine the depth of field step length of the movement lens, wherein the depth of field step length is half of the difference between the front depth of field and the back depth of field corresponding to the depth of field of the movement lens so that each of them satisfies a preset focus clarity;

[0153] The reference focus motor position is adjusted by adding or subtracting an offset according to the depth of field step of the movement lens to determine a target focus motor position search interval.

[0154] Based on the above embodiment, optionally, determining the target focus motor position used by the movement lens according to the candidate focus motor position located in the target focus motor position search interval includes:

[0155] determining a candidate focus motor position weight of a candidate focus motor position located within the target focus motor position search interval, wherein the candidate focus motor position weight is configured based on a weight of the adopted focus clarity calculation method;

[0156] The candidate focus motor positions within the target focus motor position search interval are weighted averaged according to the candidate focus motor position weights to obtain the target focus motor position used by the movement lens.

[0157] Based on the above embodiment, optionally, controlling the movement lens according to the target focus motor position includes:

[0158] Determine aperture information used by the movement lens, where the aperture information used by the movement lens is used to enable the movement lens to maintain a focus clarity effect;

[0159] The movement lens is controlled according to the target focus motor position and the aperture information used by the movement lens.

[0160] Based on the above embodiment, optionally, the movement lens control method further includes:

[0161] Determine a candidate aperture size of the movement lens and a corresponding candidate aperture motor position, wherein the candidate aperture size is an aperture motor position corresponding to a maximum focus clarity obtained by controlling the aperture motor to move when the movement lens performs automatic focusing so as to evaluate the lens picture using a third focus clarity calculation method, wherein the third focus clarity calculation method pays attention to the edge area of ​​the lens picture and does not pay attention to the center area when evaluating the lens picture;

[0162] The aperture information used by the movement lens is determined according to the candidate aperture sizes and the corresponding candidate aperture motor positions.

[0163] The technical solution of the embodiment of the present invention determines the depth of field of the movement lens and determines the candidate focus motor positions of the movement lens corresponding to different candidate focus sharpnesses. The different candidate focus sharpnesses are the maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing. Different focus sharpness calculation methods have different attention to different areas of the lens picture. Therefore, according to the depth of field of the movement lens and the candidate focus motor positions corresponding to different candidate focus sharpnesses, a suitable target focus motor position can be determined to control the movement lens. By analyzing the object distance distribution under the lens picture scene of the movement lens, the focus motor positions that can produce the maximum focus sharpness obtained by different focus sharpness calculation methods are combined with the depth of field of the movement lens to obtain the focus motor position with the most depth of field and object distance, thereby expanding the depth of field effect of the movement lens and maximizing the depth of field characteristics of the large aperture lens.

[0164] The movement lens control device provided in the embodiment of the present invention can execute the movement lens control method provided in any embodiment of the present invention mentioned above, and has the corresponding functions and beneficial effects of executing the movement lens control method. For detailed process, please refer to the relevant operations of the movement lens control method in the above embodiment.

[0165] Fig.13 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0166] like Fig.13As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0167] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0168] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the movement lens control method.

[0169] In some embodiments, the movement lens control method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the movement lens control method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the movement lens control method in any other appropriate manner (e.g., by means of firmware).

[0170] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0171] The computer programs for implementing the movement lens control method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0172] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0173] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0174] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0175] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0176] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0177] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A movement lens control method, characterized in that: The method comprises: Determine the depth of field of the movement lens; Determine the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, wherein the different candidate focus sharpnesses are maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and the different focus sharpness calculation methods have different attentions to different areas of the lens picture; Determining a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses; The movement lens is controlled according to the target focus motor position.

2. The method according to claim 1, characterized in that: Determining the candidate focus motor positions corresponding to the movement lens at different candidate focus sharpnesses includes: Determine the focus motor position corresponding to the maximum focus clarity obtained by the movement lens through automatic focus coarse adjustment; Determine the depth of field step of the movement lens, where the depth of field step is half of the difference between the front depth of field and the back depth of field corresponding to the depth of field of the movement lens so that each of them satisfies a preset focus clarity; The focus motor position corresponding to the maximum focus clarity obtained by the coarse adjustment of the automatic focus is adjusted by adding or subtracting an offset according to the preset multiple value of the depth of field step of the movement lens, so as to determine a search interval of the candidate focus motor position used when the movement lens performs the fine adjustment of the automatic focus; The focus motor of the movement lens is controlled to perform focus fine adjustment in the candidate focus motor position search interval, and the candidate focus motor positions of the movement lens corresponding to different candidate focus sharpnesses are determined.

3. The method according to claim 1 or 2, characterized in that: Determining the candidate focus motor positions corresponding to the movement lens at different candidate focus sharpnesses includes: Determine a first focus motor position corresponding to a first focus clarity obtained by evaluating a lens picture using a first focus clarity calculation method when the movement lens performs automatic focusing, wherein the first focus clarity calculation method pays more attention to a central area of ​​the lens picture than to an edge area when evaluating the lens picture, and both the central area and the edge area have a degree of attention; Determine a second focus motor position corresponding to a second focus clarity obtained by respectively using different second focus clarity calculation methods to evaluate the lens picture when the movement lens performs automatic focusing, wherein each second focus clarity calculation method only pays attention to a local area in the lens picture when evaluating the lens picture, and different second focus clarity calculation methods correspond to different local areas with attention, and the first focus clarity and the second focus clarity are maximum focus clarity obtained by using their respective focus clarity calculation methods during automatic focusing; The first focus motor position and the second focus motor position are determined as candidate focus motor positions corresponding to different candidate focus sharpnesses.

4. The method according to claim 1, characterized in that Determining a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses includes: Determining a reference focus motor position from the candidate focus motor positions corresponding to the different candidate focus sharpnesses, the reference focus motor position being a maximum focus sharpness obtained by evaluating a lens picture using a reference focus sharpness calculation method when the movement lens performs automatic focusing, the reference focus sharpness calculation method being a focus sharpness calculation method in which, when evaluating the lens picture, a degree of attention paid to a central area of ​​the lens picture is greater than a degree of attention paid to an edge area; Determining a target focus motor position search interval according to the depth of field of the movement lens and a reference focus motor position; The target focus motor position used by the movement lens is determined according to the candidate focus motor positions located in the target focus motor position search interval.

5. The method according to claim 4, characterized in that According to the depth of field of the movement lens and the reference focus motor position, a target focus motor position search interval is determined, including: Determine the depth of field step length of the movement lens, wherein the depth of field step length is half of the difference between the front depth of field and the back depth of field corresponding to the depth of field of the movement lens so that each of them satisfies a preset focus clarity; The reference focus motor position is adjusted by adding or subtracting an offset according to the depth of field step of the movement lens to determine a target focus motor position search interval.

6. The method according to claim 4, characterized in that Determining a target focus motor position used by the movement lens according to a candidate focus motor position located within the target focus motor position search interval includes: determining a candidate focus motor position weight of a candidate focus motor position located within the target focus motor position search interval, wherein the candidate focus motor position weight is configured based on a weight of the adopted focus clarity calculation method; The candidate focus motor positions within the target focus motor position search interval are weighted averaged according to the candidate focus motor position weights to obtain the target focus motor position used by the movement lens.

7. The method according to claim 1, characterized in that Controlling the movement lens according to the target focus motor position includes: Determine aperture information used by the movement lens, where the aperture information used by the movement lens is used to enable the movement lens to maintain a focus clarity effect; The movement lens is controlled according to the target focus motor position and the aperture information used by the movement lens.

8. The method according to claim 1 or 7, characterized in that: The method further comprises: Determine a candidate aperture size of the movement lens and a corresponding candidate aperture motor position, wherein the candidate aperture size is an aperture motor position corresponding to a maximum focus clarity obtained by controlling the aperture motor to move when the movement lens performs automatic focusing so as to evaluate the lens picture using a third focus clarity calculation method, wherein the third focus clarity calculation method pays attention to the edge area of ​​the lens picture and does not pay attention to the center area when evaluating the lens picture; The aperture information used by the movement lens is determined according to the candidate aperture sizes and the corresponding candidate aperture motor positions.

9. A movement lens control device, characterized in that: The device comprises: A first determination module is used to determine the depth of field of the movement lens; A second determination module is used to determine the candidate focus motor positions corresponding to different candidate focus sharpnesses of the movement lens, wherein the different candidate focus sharpnesses are the maximum focus sharpnesses under different focus sharpness calculation methods obtained by evaluating the lens picture using different focus sharpness calculation methods when the movement lens performs automatic focusing, and the different focus sharpness calculation methods have different attention levels on different areas of the lens picture; A third determination module is used to determine a target focus motor position used by the movement lens according to the depth of field of the movement lens and the candidate focus motor positions corresponding to the different candidate focus sharpnesses; A control module is used to control the movement lens according to the target focus motor position.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the movement lens control method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the movement lens control method according to any one of claims 1 to 8 when executed.