CN114302053B - Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium - Google Patents
Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium Download PDFInfo
- Publication number
- CN114302053B CN114302053B CN202111404455.6A CN202111404455A CN114302053B CN 114302053 B CN114302053 B CN 114302053B CN 202111404455 A CN202111404455 A CN 202111404455A CN 114302053 B CN114302053 B CN 114302053B
- Authority
- CN
- China
- Prior art keywords
- lens
- focusing
- step length
- preset
- function value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000011156 evaluation Methods 0.000 claims abstract description 67
- 230000006870 function Effects 0.000 claims description 111
- 238000004590 computer program Methods 0.000 claims description 14
- 230000009191 jumping Effects 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000005314 correlation function Methods 0.000 claims 2
- 230000009194 climbing Effects 0.000 description 9
- 230000000694 effects Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000004422 calculation algorithm Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000010845 search algorithm Methods 0.000 description 2
- 101000798109 Homo sapiens Melanotransferrin Proteins 0.000 description 1
- 101000967073 Homo sapiens Metal regulatory transcription factor 1 Proteins 0.000 description 1
- 101000967087 Homo sapiens Metal-response element-binding transcription factor 2 Proteins 0.000 description 1
- 101001030197 Homo sapiens Myelin transcription factor 1 Proteins 0.000 description 1
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 102100040514 Metal regulatory transcription factor 1 Human genes 0.000 description 1
- 102100040632 Metal-response element-binding transcription factor 2 Human genes 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000010355 oscillation Effects 0.000 description 1
- 230000000087 stabilizing effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Abstract
The invention is applicable to the technical field of automatic control, and provides a lens focusing method and device of image pickup equipment, the image pickup equipment and a storage medium, wherein the method comprises the following steps: determining the moving direction of the lens and the current focusing stage of the lens, acquiring a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, calculating the step length to be moved of the lens at the current position according to the current position information, the acquired preset step length and the step length fitting function, moving the lens according to the calculated step length to be moved and the determined moving direction, calculating a focusing evaluation function value of the current position where the lens is located after the lens is moved, judging whether the focusing evaluation function value of the current position where the lens is located is larger than that of the previous position, if yes, continuing to move the lens, otherwise, judging whether the current focusing stage does not reach the preset focusing stage, if not, reversely moving the lens, otherwise, setting the previous position as the focus position of the lens, and moving the lens to the focus position so as to complete focusing of the lens.
Description
Technical Field
The present invention relates to an automatic control technology field, and in particular, to a lens focusing method and apparatus for an image capturing device, and a storage medium.
Background
Along with the development of electronic technology, intelligent devices with photographing functions are more and more popular, in order to obtain good photographing quality, the intelligent devices with photographing functions need to focus an object to be photographed, manual focusing efficiency is low, and the requirement of users on intellectualization is difficult to meet, so how to realize automatic focusing in the photographing process is very important for the intelligent devices with photographing functions.
In the prior art, some automatic focusing searching methods exist, wherein a classical climbing algorithm is simple and easy to implement, has good focusing effect, is widely applied to the engineering field, and as shown in fig. 1, the principle of the climbing algorithm is that a climbing is started to change a focal length along a certain direction from a starting point by a certain larger step length, the focal length is compared by calculating focusing evaluation function values each time, when the falling edge of the gradient is detected, the step length is reduced to reversely climb, the climbing is repeatedly turned back until the step length is reduced to a preset termination step length, the climbing is stopped, and the peak value position in the last climbing process is the maximum value searched by the climbing algorithm. In the repeated turning-back process of the hill climbing algorithm, a good result can be obtained by reducing the step length for a plurality of times, the calculation amount and the real-time performance have room for improvement, and meanwhile, the picture is repeated between clear and fuzzy, and the picture change is not smooth.
Disclosure of Invention
The invention aims to provide a lens focusing method and device of an image pickup device, the image pickup device and a storage medium, and aims to solve the problem that the prior art cannot provide an effective lens focusing method, so that the lens focusing efficiency of the image pickup device is low.
In one aspect, the present invention provides a lens focusing method of an image pickup apparatus, the method including the steps of:
s11, determining the moving direction of a lens and the current focusing stage of the lens;
s12, acquiring a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, and calculating a step length to be moved of the lens at the current position according to the current position information, the acquired preset step length and the step length fitting function;
s13, moving the lens according to the calculated step length to be moved and the determined moving direction, and calculating a focusing evaluation function value of the current position of the lens after movement;
s14, judging whether the focusing evaluation function value of the current position of the lens is larger than the focusing evaluation function value of the previous position, if so, jumping to the step S12, otherwise jumping to the step S15;
s15, judging whether the current focusing stage does not reach a preset focusing stage, if so, reversely moving the lens and jumping to the step S11, otherwise, setting the previous position as the focal position of the lens, and moving the lens to the focal position to finish focusing of the lens.
In another aspect, the present invention provides a lens focusing apparatus of an image pickup apparatus, the apparatus comprising:
a movement parameter determining unit, configured to determine a movement direction of a lens and a current focusing stage of the lens;
the step length calculating unit is used for obtaining a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, and calculating a step length to be moved of the lens at the current position according to the current position information, the obtained preset step length and the step length fitting function;
the function value calculation unit is used for moving the lens according to the calculated step length to be moved and the determined moving direction, and calculating a focusing evaluation function value of the current position of the lens after the lens is moved;
a value judging unit, configured to judge whether a focus evaluation function value of a current position where the lens is located is greater than a focus evaluation function value of a previous position, and if yes, trigger the step length calculating unit to calculate a step length to be moved so as to continue moving the lens;
and the focusing unit is used for judging whether the current focusing stage does not reach the preset focusing stage or not when the focusing evaluation function value of the current position of the lens is not larger than the focusing evaluation function value of the previous position, if so, reversely moving the lens and triggering the movement parameter determining unit to continuously move the lens, otherwise, setting the previous position as the focal position of the lens, and moving the lens to the focal position to finish focusing of the lens.
In another aspect, the present invention also provides an image capturing apparatus including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the computer program.
In another aspect, the invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as described above.
The invention determines the moving direction of the lens and the current focusing stage of the lens when focusing the lens, acquires the preset step length of the current focusing stage and the step length fitting function of the movable area where the current position of the lens is located, calculates the step length to be moved of the lens at the current position according to the current position information, the acquired preset step length and the step length fitting function, moves the lens according to the calculated step length to be moved and the determined moving direction, calculates the focusing evaluation function value of the current position where the lens is located after movement, judges whether the focusing evaluation function value of the current position where the lens is located is larger than the previous position, if yes, continues to move the lens, if not, the current focusing stage does not reach the preset focusing stage, reversely moves the lens, otherwise, sets the previous position as the focus position of the lens, and moves the lens to the focus position so as to complete focusing of the lens, thereby improving the focusing efficiency of the lens.
Drawings
FIG. 1 is a schematic diagram of a conventional classical hill climbing algorithm for implementing a lens focusing process;
fig. 2 is a flowchart of an implementation of a lens focusing method of an image capturing apparatus according to the first embodiment of the present invention;
FIG. 3 is a diagram showing an exemplary division of a movable area according to an embodiment of the present invention;
fig. 4 is a comparison chart of focusing effects of three lens focusing methods according to the first embodiment of the present invention;
fig. 5 is a schematic structural diagram of a lens focusing apparatus of an image capturing apparatus according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of an image pickup apparatus according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The following describes in detail the implementation of the present invention in connection with specific embodiments:
embodiment one:
fig. 2 shows a flow of implementation of a lens focusing method of an image capturing apparatus according to the first embodiment of the present invention, and for convenience of explanation, only a portion related to the embodiment of the present invention is shown, and the detailed description is as follows:
in step S201, determining a moving direction of the lens and a current focusing stage of the lens;
the present invention is applicable to an image pickup apparatus including a lens and a focus motor to move the lens of the image pickup apparatus by driving the focus motor when focusing the lens. In the embodiment of the invention, when the image pickup device receives an instruction for focusing the lens, the moving direction of the lens and the current focusing stage of the lens are determined, wherein the instruction for focusing the lens received by the image pickup device can be generated by triggering when a user presses a shooting button of the image pickup device, or can be generated by triggering when the movement of the image pickup device or the change of an image pickup object is detected, so that the focusing of the lens is automatically triggered when the user needs or the image pickup object changes.
The initial position of the lens may be the origin position (i.e. the position 0 of the movable distance of the lens), and at this time, the moving direction of the lens is only one direction, i.e. the direction in which the moving distance increases. When determining the moving direction of the lens, in a preferred embodiment, the lens located at the initial position is moved to a preset distance, where the preset distance is a smaller distance, then, a focusing evaluation function value of the lens at the initial position and a focusing evaluation function value of the lens located at a position after the preset distance is moved are obtained, if the focusing evaluation function value of the lens located at the position after the movement is greater than the focusing evaluation function value of the lens at the initial position, the preset direction is determined as the moving direction of the lens, otherwise, the opposite direction of the preset direction is determined as the moving direction of the lens, so that the moving mode of the lens is rapidly and accurately determined, and further, the moving efficiency and focusing efficiency of the subsequent lens are improved. The preset direction may be a random direction, or may be set according to an initial position where the lens is located, so as to quickly enter a moving stage of the lens. The focus evaluation function value is used to evaluate a photographing effect of a lens of the image pickup apparatus at a position, for example, an image sharpness value of the position of the lens may be used as the focus evaluation function value, and specifically, a corresponding focus evaluation function may be selected according to the type of the lens, so as to accurately reflect the focusing effect of the position of the lens through the focus evaluation function value.
In the embodiment of the invention, the whole focusing process from the beginning of focusing to the ending of focusing of the lens is divided into a plurality of focusing stages, and the focusing of the lens is finally realized through the plurality of focusing stages, wherein the focusing stages of the lens comprise at least two. In each focusing stage, the moving direction of the lens does not change, i.e. as long as the moving direction is changed, the lens enters the next focusing stage. In order to improve the focusing efficiency, the number of focusing stages may be preset according to the optical characteristics of the lens, and preferably, the focusing stages of the lens include three, thereby improving the focusing efficiency of the lens. To facilitate distinguishing between the stages, each stage may be referred to herein, in turn, as a first focus stage, a second focus stage, a third focus stage, and so on, beginning with lens movement or focus, although other names may be used to illustrate the distinction. Specifically, when determining the current focusing stage of the lens, if the current focusing stage is the focusing stage after determining the moving direction of the lens for the first time, the current focusing stage may be referred to as the first focusing stage.
In step S202, a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located are obtained, and a step length to be moved of the lens at the current position is calculated according to the current position information, the obtained preset step length and the step length fitting function;
in the embodiment of the invention, the movable distance of the Lens is the distance between the maximum position to which the Lens can move from the original position (zero position) and the original position, the movable distance is divided into a preset number of movable areas, the movable areas comprise at least two movable areas, the length of each divided movable area can be the same or different, and the number of the movable areas can be determined according to parameters and parameter relations (such as a movement amount (Lens Shift) and a focusing distance (also called object distance)) in various types of lenses. Therefore, before the step fitting function of the movable area where the current position of the lens is located is acquired, the movable distance of the lens is divided into a preset number of movable areas in advance. Preferably, the number of movable areas is 3, so that the focusing efficiency of the lens is improved while simplifying the focusing process of the lens. As an example, as shown in fig. 3, the movable distance of the lens is equally divided into three movable areas, which are respectively referred to as first, second, and third movable areas from left to right in the drawing according to the lens position for convenience of description.
The preset step length of each focusing stage and the step length fitting function of the movable region can be set according to the optical characteristics of the lens, and the preset step length and the step length fitting function are used for calculating the moving step length of the lens in different focusing stages and different movable regions each time, wherein the preset step length of each focusing stage is not identical, and the step length fitting function of each movable region is not identical. Therefore, the step length of the lens is different in different movable areas and different focusing stages during each movement, so that the differential change of the step length during each movement of the lens is realized, and the position section where the best focusing point (focus position) is located can be conveniently and quickly positioned. The step fitting function of each movable region may be set when the movable distance of the lens is divided into a preset number of movable regions, or may be set at other times. Preferably, the preset step length of the nth focusing stage of the lens is larger than the preset step length of the n+1th focusing stage, and the nth focusing stage represent two adjacent focusing stages before and after the lens, so that the position interval of the best focusing point is rapidly positioned.
After determining the moving direction of the lens and the current focusing stage of the lens, acquiring a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, calculating the step length to be moved of the lens at the current position according to the current position information, the acquired preset step length and the step length fitting function, and moving the lens according to the calculated step length to be moved and the moving direction determined in the step S201. In a preferred embodiment, a step length to be moved of the lens at the current position is calculated by using the formula s=g (x) ×s, where S represents the calculated step length to be moved, x represents a distance between the current position and an origin position (zero position), g (x) represents a step length fitting function of a movable area where the current position is located, and S represents a preset step length in the current focusing stage. As an example, as shown in fig. 3, when the movable distance of the lens is divided into three movable areas and the focusing stage of the lens is three, the step fitting functions of the three areas may be expressed as s1_out=g1 (x) S1, s2_out=g2 (x) S2 and s3_out=g3 (x) S3, g1 (x), g2 (x), g3 (x) represent the step fitting functions of the first, second, and third movable areas, respectively, S1, S2, S3 represent the preset step sizes of the first, second, and third focusing stages, respectively, and S1> S2> S3.
In step S203, the lens is moved according to the calculated step length to be moved and the determined moving direction, and a focusing evaluation function value of the current position of the moved lens is calculated;
in step S204, it is determined whether the focus evaluation function value of the current position of the lens is greater than the focus evaluation function value of the previous position, if yes, the step S12 is skipped, otherwise the step S15 is skipped;
in the embodiment of the invention, the focusing evaluation function value of the previous position is the same as the focusing evaluation function value of the current position in the calculation mode, the calculated focusing evaluation function value is stored in the previous position, the focusing evaluation function value of the current position can be compared with the focusing evaluation function value of the previous position after the focusing evaluation function value of the current position is obtained, and whether the focusing evaluation function value of the current position is larger than the focusing evaluation function value of the previous position is judged. If the focus evaluation function value of the current position is greater than the focus evaluation function value of the previous position, the current position of the lens still does not reach the optimal focusing point, and the step S202 is skipped to continue to move the lens, and the moving direction of the lens is unchanged when the lens is continued to move, namely the moving direction of the lens is the same as that of the previous position, and the lens is in the same focusing stage as that of the lens of the previous position. If the focus evaluation function value of the current position is not greater than the focus evaluation function value of the previous position, it indicates that the previous position may be the best focus point of the lens, but in order to more precisely locate the best focus point, step S205 is further performed herein to determine whether the current focusing stage of the lens has not reached the preset focusing stage.
In step S205, it is determined whether the current focusing stage has not reached the preset focusing stage, if yes, the step is skipped to step S201, otherwise the step is skipped to step S206.
In the embodiment of the present invention, if the current focusing stage does not reach the preset focusing stage, it indicates that the focusing stage passed by the lens has not reached the preset number, and the previous position may not be the best focusing point of the lens, and focusing needs to be continued, and the step is skipped to step S201, and when the moving direction of the lens is determined in step S201, the moving direction of the lens is set to be the opposite direction of the previous position, and the lens enters the next focusing stage.
In step S206, the previous position is set as the focal position of the lens, and the lens is moved to the focal position to complete focusing of the lens.
In the embodiment of the invention, if the current focusing stage has reached the preset focusing stage, the focusing stage passed by the lens is indicated to reach the preset number, the previous position is considered as the best focusing point of the lens, at this time, the previous position is set as the focal position of the lens, and the lens is moved to the focal position, so as to complete focusing of the lens.
The embodiment of the invention determines the moving direction of the lens and the current focusing stage of the lens when focusing the lens, acquires the preset step length of the current focusing stage and the step length fitting function of the movable area where the current position of the lens is located, calculates the step length to be moved of the lens at the current position according to the current position information, the acquired preset step length and the step length fitting function, moves the lens according to the calculated step length to be moved and the determined moving direction, calculates the focusing evaluation function value of the current position where the lens is located after movement, judges whether the focusing evaluation function value of the current position where the lens is located is larger than the previous position, if yes, continues to move the lens, if not, judges whether the current focusing stage does not reach the preset focusing stage, if not, the lens is reversely moved, otherwise, the previous position is set as the focus position of the lens, and the lens is moved to the focus position, so as to finish focusing of the lens, thereby improving focusing efficiency of the lens.
In the embodiment of the invention, the step length of the first movement of the lens after the direction is determined is longest, and the step length is continuously reduced so as to position the optimal focusing point in the shortest time. As shown in fig. 4, fig. 4 shows focusing effects of three different focusing methods on the same image capturing apparatus, where MTF1 is an effect of a hill-climbing search algorithm using a larger fixed step, MTF2 is an effect of an embodiment of the present invention, and MTF3 is an effect of a hill-climbing search algorithm using a smaller fixed step. It can be seen that the oscillation amplitude is small and the stabilizing time is short in the process of searching the optimal focusing point in the embodiment of the invention.
Embodiment two:
fig. 5 shows the structure of a lens focusing apparatus of an image pickup apparatus provided in the second embodiment of the present invention, and for convenience of explanation, only the portions related to the embodiments of the present invention are shown, including:
a movement parameter determining unit 51 for determining a movement direction of the lens and a current focusing stage of the lens;
the step length calculating unit 52 is configured to obtain a preset step length in the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, and calculate a step length to be moved of the lens at the current position according to the current position information, the obtained preset step length and the step length fitting function;
a function value calculation unit 53, configured to move the lens according to the calculated step length to be moved and the determined movement direction, and calculate a focusing evaluation function value of the current position of the moved lens;
a value judging unit 54, configured to judge whether the focus evaluation function value of the current position of the lens is greater than the focus evaluation function value of the previous position, and if yes, trigger the step size calculating unit 52 to calculate a step size to be moved so as to continue moving the lens;
and a focusing unit 55, configured to, when the focus evaluation function value of the current position of the lens is not greater than the focus evaluation function value of the previous position, determine whether the current focusing stage has not reached the preset focusing stage, if so, reversely move the lens and trigger the movement parameter determining unit 51 to continue moving the lens, otherwise, set the previous position as the focal position of the lens, and move the lens to the focal position to complete focusing of the lens.
Preferably, the movement parameter determination unit 51 includes:
the function value obtaining unit is used for moving the lens at the initial position to a preset distance in a preset direction to obtain a focusing evaluation function value of the lens at the initial position and a focusing evaluation function value of the lens at the position after movement, wherein the preset direction is a random direction;
and the direction determining unit is used for determining the preset direction as the moving direction of the lens if the focusing evaluation function value of the position where the lens is located after moving is larger than the focusing evaluation function value of the initial position of the lens, and determining the opposite direction of the preset direction as the moving direction of the lens if the focusing evaluation function value of the position where the lens is located after moving is not larger than the focusing evaluation function value of the initial position of the lens.
In the embodiment of the present invention, each unit of the lens focusing device may be implemented by a corresponding hardware or software unit, and each unit may be an independent software or hardware unit, or may be integrated into one software or hardware unit, which is not used to limit the present invention. The specific embodiments of each unit may refer to the implementation one, and will not be described herein.
Embodiment III:
fig. 6 shows the structure of an image pickup apparatus provided in the third embodiment of the present invention, and for convenience of explanation, only the portions related to the embodiments of the present invention are shown.
The image pickup apparatus 6 of the embodiment of the present invention includes a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. The processor 60 implements the steps of the lens focusing method embodiment described above, such as steps S201 to S206 shown in fig. 2, when executing the computer program 62. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the units in the above-described embodiments of the apparatus, such as the functions of the units 51 to 55 shown in fig. 5.
The image pickup device of the embodiment of the invention can be electronic devices with specific image pickup functions such as cameras, mobile phones and the like. The steps of the image capturing apparatus 6, which are implemented when the processor 60 executes the computer program 62 to implement the lens focusing method, are referred to the description of the foregoing method embodiments, and will not be repeated here.
Fifth embodiment:
in an embodiment of the present invention, there is provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps in the above-described lens focusing method embodiment, for example, steps S201 to S206 shown in fig. 2. Alternatively, the computer program, when executed by a processor, implements the functions of the units in the above-described embodiments of the apparatus, such as the functions of the units 51 to 55 shown in fig. 5.
The computer readable storage medium of embodiments of the present invention may include any entity or device capable of carrying computer program code, recording medium, such as ROM/RAM, magnetic disk, optical disk, flash memory, and so on.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.
Claims (8)
1. A lens focusing method of an image pickup apparatus, the method comprising the steps of:
s11, determining the moving direction of a lens and the current focusing stage of the lens, and determining that the moving direction of the lens is the opposite direction of the moving direction of the lens at the previous position and the lens enters the next focusing stage if the lens is not positioned at the initial position when determining the moving direction of the lens and the current focusing stage of the lens;
s12, acquiring a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, and calculating a step length to be moved of the lens at the current position according to the current position information, the acquired preset step length and the step length fitting function, wherein the step length fitting function is a correlation function of the current position information and the step length to be moved;
s13, moving the lens according to the calculated step length to be moved and the determined moving direction, and calculating a focusing evaluation function value of the current position of the lens after movement;
s14, judging whether the focusing evaluation function value of the current position of the lens is larger than the focusing evaluation function value of the previous position, if so, jumping to the step S12, otherwise jumping to the step S15;
s15, judging whether the current focusing stage does not reach a preset focusing stage, if so, indicating that the focusing stage passed by the lens does not reach the preset number, at the moment, jumping to the step S11, otherwise, setting the previous position as the focal position of the lens, and moving the lens to the focal position to finish focusing of the lens;
the lens is characterized in that the step length to be moved is the longest for the first time, the follow-up steps are continuously reduced, the focusing stages of the lens comprise at least two, the preset step lengths of the focusing stages are not identical, the movable areas comprise at least two, the step length fitting functions of the movable areas are not identical, the preset step length of the N-th focusing stage of the lens is larger than the preset step length of the N+1-th focusing stage, and the N-th focusing stage represent the two adjacent focusing stages before and after the lens.
2. The lens focusing method as claimed in claim 1, wherein the step of determining the moving direction of the lens includes:
when the lens is located at an initial position, moving the lens located at the initial position to a preset distance in a preset direction, and acquiring a focusing evaluation function value of the lens at the initial position and a focusing evaluation function value of a position where the lens is located after movement, wherein the preset direction is a random direction;
if the focusing evaluation function value of the position of the lens after the movement is larger than the focusing evaluation function value of the initial position of the lens, determining the preset direction as the movement direction of the lens, otherwise, determining the opposite direction of the preset direction as the movement direction of the lens.
3. The lens focusing method of claim 1, wherein the focusing stages of the lens include three.
4. The lens focusing method of claim 1, wherein the step of calculating a step size to be moved of the lens at the current position according to the current position information, the acquired preset step size and a step size fitting function comprises:
calculating the step length to be moved of the lens at the current position by using a formula s=g (x) ×s, wherein S represents the calculated step length to be moved, x represents the coordinate of the current position within the movable distance of the lens, g (x) represents the step length fitting function of the movable area where the current position is located, and S represents the preset step length of the current focusing stage.
5. A lens focusing apparatus of an image pickup device, characterized by comprising:
a movement parameter determining unit, configured to determine a movement direction of a lens and a current focusing stage of the lens, and determine that the movement direction of the lens is a direction opposite to a movement direction of the lens at a previous position and the lens enters a next focusing stage if the lens is not located at an initial position when determining the movement direction of the lens and the current focusing stage of the lens;
the step length calculating unit is used for obtaining a preset step length of the current focusing stage and a step length fitting function of a movable area where the current position of the lens is located, and calculating a step length to be moved of the lens at the current position according to the current position information, the obtained preset step length and the step length fitting function, wherein the step length fitting function is a correlation function of the current position information and the step length to be moved;
the function value calculation unit is used for moving the lens according to the calculated step length to be moved and the determined moving direction, and calculating a focusing evaluation function value of the current position of the lens after the lens is moved;
a value judging unit, configured to judge whether a focus evaluation function value of a current position where the lens is located is greater than a focus evaluation function value of a previous position, and if yes, trigger the step length calculating unit to calculate a step length to be moved so as to continue moving the lens;
a focusing unit, configured to determine whether the current focusing stage does not reach a preset focusing stage when the focusing evaluation function value of the current position of the lens is not greater than the focusing evaluation function value of the previous position, if yes, indicate that the focusing stage passed by the lens does not reach a preset number, trigger the movement parameter determining unit at this time to continue moving the lens, otherwise set the previous position as the focal position of the lens, and move the lens to the focal position to complete focusing of the lens;
the lens is characterized in that the step length to be moved is the longest for the first time, the follow-up steps are continuously reduced, the focusing stages of the lens comprise at least two, the preset step lengths of the focusing stages are not identical, the movable areas comprise at least two, the step length fitting functions of the movable areas are not identical, the preset step length of the N-th focusing stage of the lens is larger than the preset step length of the N+1-th focusing stage, and the N-th focusing stage represent the two adjacent focusing stages before and after the lens.
6. The lens focusing apparatus according to claim 5, wherein the movement parameter determination unit includes:
the lens focusing device comprises a function value acquisition unit, a focusing evaluation function value acquisition unit and a focusing evaluation function value acquisition unit, wherein the function value acquisition unit is used for moving the lens positioned at an initial position to a preset distance in a preset direction when the lens is positioned at the initial position, and acquiring the focusing evaluation function value of the lens at the initial position and the focusing evaluation function value of the position after movement, wherein the preset direction is a random direction;
and the direction determining unit is used for determining the preset direction as the moving direction of the lens if the focusing evaluation function value of the position where the lens is located after moving is larger than the focusing evaluation function value of the initial position of the lens, otherwise determining the opposite direction of the preset direction as the moving direction of the lens.
7. An image capturing apparatus comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 4 when executing the computer program.
8. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111404455.6A CN114302053B (en) | 2021-11-24 | 2021-11-24 | Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111404455.6A CN114302053B (en) | 2021-11-24 | 2021-11-24 | Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114302053A CN114302053A (en) | 2022-04-08 |
CN114302053B true CN114302053B (en) | 2023-12-05 |
Family
ID=80965148
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111404455.6A Active CN114302053B (en) | 2021-11-24 | 2021-11-24 | Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114302053B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003029134A (en) * | 2001-07-17 | 2003-01-29 | Sanyo Electric Co Ltd | Autofocus camera |
CN104580917A (en) * | 2015-01-29 | 2015-04-29 | 广东本致科技有限公司 | Automatic fast focusing method and automatic fast focusing device |
CN105657238A (en) * | 2014-11-20 | 2016-06-08 | 广东欧珀移动通信有限公司 | Tracking focusing method and apparatus |
WO2017107840A1 (en) * | 2015-12-23 | 2017-06-29 | 北京奇虎科技有限公司 | Automatic focus control method and apparatus |
CN107664899A (en) * | 2017-10-19 | 2018-02-06 | 广东顺德工业设计研究院(广东顺德创新设计研究院) | The method, apparatus and system of auto-focusing |
CN112601015A (en) * | 2020-12-10 | 2021-04-02 | 烟台艾睿光电科技有限公司 | Automatic focusing method and automatic focusing system |
-
2021
- 2021-11-24 CN CN202111404455.6A patent/CN114302053B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003029134A (en) * | 2001-07-17 | 2003-01-29 | Sanyo Electric Co Ltd | Autofocus camera |
CN105657238A (en) * | 2014-11-20 | 2016-06-08 | 广东欧珀移动通信有限公司 | Tracking focusing method and apparatus |
CN104580917A (en) * | 2015-01-29 | 2015-04-29 | 广东本致科技有限公司 | Automatic fast focusing method and automatic fast focusing device |
WO2017107840A1 (en) * | 2015-12-23 | 2017-06-29 | 北京奇虎科技有限公司 | Automatic focus control method and apparatus |
CN107664899A (en) * | 2017-10-19 | 2018-02-06 | 广东顺德工业设计研究院(广东顺德创新设计研究院) | The method, apparatus and system of auto-focusing |
CN112601015A (en) * | 2020-12-10 | 2021-04-02 | 烟台艾睿光电科技有限公司 | Automatic focusing method and automatic focusing system |
Also Published As
Publication number | Publication date |
---|---|
CN114302053A (en) | 2022-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4664379B2 (en) | Electronic device and image data processing method for image data processing | |
CN108496350B (en) | Focusing processing method and device | |
US10061182B2 (en) | Systems and methods for autofocus trigger | |
US8514320B2 (en) | Electronic camera and focus control method which minimizes the time required for adjusting a focus | |
JP5446076B2 (en) | Digital camera | |
JP2008009341A (en) | Autofocus device and method, and imaging apparatus | |
KR20190104216A (en) | Focus method, terminal and computer readable storage media | |
CN110324536B (en) | Image change automatic sensing focusing method for microscope camera | |
JP2006017960A (en) | Imaging method and imaging apparatus | |
CN108254995B (en) | Automatic focusing method and system for large zoom lens | |
CN110336948B (en) | Method and device for focusing in preset area, storage medium and electronic device | |
CN114302053B (en) | Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium | |
CN111491105B (en) | Focusing method of mobile terminal, mobile terminal and computer storage medium | |
KR20200047971A (en) | Image capturing device to perform autofocus | |
CN114302052B (en) | Lens focusing method and device of image pickup apparatus, image pickup apparatus and storage medium | |
CN116980757A (en) | Quick focusing method, focusing map updating method, device and storage medium | |
CN110830726A (en) | Automatic focusing method, device, equipment and storage medium | |
JP6429724B2 (en) | Imaging apparatus and control method thereof | |
CN112492210A (en) | Photographing method and device, electronic equipment and storage medium | |
JP2013210572A (en) | Imaging device and control program of the same | |
JP5932340B2 (en) | Focus adjustment device | |
CN116233605B (en) | Focusing implementation method and device, storage medium and image pickup equipment | |
CN116418971A (en) | Flatness detection method and device for sensor, computer equipment and storage medium | |
CN117156268A (en) | Quick automatic focusing method and device and computer equipment | |
CN113170053A (en) | Imaging method, imaging device, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |