CN113938599B - Electric lens focusing method and device, electronic equipment and storage medium - Google Patents

Electric lens focusing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113938599B
CN113938599B CN202010673661.6A CN202010673661A CN113938599B CN 113938599 B CN113938599 B CN 113938599B CN 202010673661 A CN202010673661 A CN 202010673661A CN 113938599 B CN113938599 B CN 113938599B
Authority
CN
China
Prior art keywords
focusing
target
motor
movement
determining
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
Application number
CN202010673661.6A
Other languages
Chinese (zh)
Other versions
CN113938599A (en
Inventor
毛栊哗
史飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202010673661.6A priority Critical patent/CN113938599B/en
Publication of CN113938599A publication Critical patent/CN113938599A/en
Application granted granted Critical
Publication of CN113938599B publication Critical patent/CN113938599B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Lens Barrels (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses an electric lens focusing method, an electric lens focusing device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining the moving direction of the focusing motor in a first movement interval according to the current position of the focusing motor; if the image definition degree accords with the preset condition in the moving process of the current position according to the moving direction, determining a target focusing position according to the image definition degree, determining a moving parking position, and recording the reversing time of the parking position; controlling the focusing motor to move from the movable stop position to the target focusing position and braking when the target focusing position is reached; determining the reverse time of the parking position, and determining the target duration by adopting a preset function; and applying a reverse voltage to the focusing motor, and stopping applying the reverse voltage after the target time length so as to adjust the focusing motor to the target focusing position. The embodiment of the invention solves the problem of focusing overshoot of the electric lens caused by too fast movement of the direct current motor, and improves the focusing accuracy of the electric lens in real scenes.

Description

Electric lens focusing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of video monitoring, in particular to an electric lens focusing method and device, electronic equipment and a storage medium.
Background
The thermal imaging technology refers to that an infrared radiation energy distribution pattern of a measured target is received by an optical imaging lens and a thermal imaging detector and reflected on a photosensitive element of the thermal imaging detector, so that an infrared thermal imaging image is obtained, and the thermal imaging image corresponds to a thermal distribution field of the surface of the measured target object. In colloquial terms, an infrared thermal imaging system is a system that converts invisible infrared energy emitted by an object into a visible thermal image.
Thermal imaging optical lenses are generally classified into fixed focus lenses and zoom lenses. For a zoom lens, a driving method of a lens motor may be classified into a stepping motor lens and a direct current motor lens. However, since the stepping motor has small driving capability, and the thermal imaging zoom lens has large volume and large load, most of the thermal imaging zoom lenses use a direct current motor. When the direct current motor moves, the movement speed is relatively high, and the relatively high focusing speed can be realized by matching with an algorithm. However, when focusing is finished, the motor moving at high speed is suddenly stopped, so that motor movement overshoot is caused, and a focusing result is not ideal.
Disclosure of Invention
The embodiment of the invention provides an electric lens focusing method, an electric lens focusing device, electronic equipment and a storage medium, so as to achieve the aim of improving the focusing accuracy of an electric lens.
In a first aspect, an embodiment of the present invention provides an electric lens focusing method, including:
determining the moving direction of the focusing motor in a first movement interval according to the current position of the focusing motor;
if the image definition degree accords with the preset condition in the moving process of the current position according to the moving direction, determining a target focusing position according to the image definition degree, determining a moving parking position, and recording the reversing time of the parking position;
controlling the focusing motor to move from the movable stop position to the target focusing position and braking when the target focusing position is reached;
determining the reverse time of the parking position, and determining the target duration by adopting a preset function;
and applying a reverse voltage to the focusing motor, and stopping applying the reverse voltage after the target time length so as to adjust the focusing motor to the target focusing position.
In a second aspect, an embodiment of the present invention provides an electric lens focusing apparatus, including:
the first determining module is used for determining the moving direction of the focusing motor in the first movement interval according to the current position of the focusing motor;
The second determining module is used for determining a target focusing position according to the image definition degree if the image definition degree accords with a preset condition in the process that the current position moves along the moving direction, determining a moving stop position and recording the stop position reversing time;
the motion control module is used for controlling the focusing motor to move from the movable stop position to the target focusing position and braking when the target focusing position is reached;
the target duration determining module is used for determining the reverse time of the parking position and determining the target duration by adopting a preset function;
and the overshoot processing module is used for applying reverse voltage to the focusing motor and stopping applying the reverse voltage after the target duration so as to adjust the focusing motor to the target focusing position.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the motorized lens focusing methods according to any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements an electric lens focusing method according to any of the embodiments of the present invention.
In the embodiment of the invention, when the focusing motor is controlled to move in the first movement section according to the determined movement direction, the target focusing position and the movement stop position are determined according to the definition degree of the acquired image and the preset condition, the stop position reversing time is recorded, and then the target time length is determined according to the stop position reversing time and the preset function, so that after the focusing motor is controlled to move from the movement stop position to the target focusing position and brake, the energy of overshoot of the focusing motor is counteracted by applying the reverse voltage of the target time length to the focusing motor, namely the problem of focus overshoot caused by too fast movement of the direct current motor of the electric lens is solved, and the final motor of the focusing motor stops at the target focusing position, thereby improving the automatic focusing accuracy of the electric lens.
Drawings
FIG. 1a is a flowchart of an electric lens focusing method according to a first embodiment of the present invention;
fig. 1b is a schematic diagram of a movement direction and a limit movement interval of a focusing motor according to a first embodiment of the present invention;
FIG. 2a is a flowchart of an electric lens focusing method according to a second embodiment of the present invention;
fig. 2b is a schematic diagram of a trend of FV value rising and falling when the focusing motor in the second embodiment of the present invention moves the focusing position F along the near-focus direction;
Fig. 2c is a schematic diagram of a variation trend of continuously decreasing FV value when the focusing motor in the second embodiment of the present invention moves the focusing position F along the near-focus direction;
fig. 2d is a schematic diagram of a trend of continuously increasing FV value when the focusing motor in the second embodiment of the present invention moves in the near-focus direction;
fig. 3a is a flow chart of an electric lens focusing method in a third embodiment of the present invention;
FIG. 3b is a schematic diagram of searching for a target focus position in a first movement interval in a third embodiment of the present invention;
fig. 3c is a schematic view of a focus motor in a third embodiment of the present invention after braking at a target focus position;
FIG. 3d is a graph showing a speed change of the focus motor after braking at a mobile parking position in accordance with the third embodiment of the present invention;
fig. 3e is a speed variation curve of the focus motor after braking at the target focus position in the third embodiment of the present invention;
FIG. 4 is a logic flow diagram of a method of motorized lens focusing according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electric lens focusing apparatus in a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device in a sixth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1a is a flowchart of an electric lens focusing method according to an embodiment of the present invention, where the method is applicable to auto-focusing a lens driven by a dc motor, and the method may be performed by an electric lens focusing apparatus, which may be implemented in software and/or hardware, and may be integrated on an electronic device, such as a camera with an electric lens.
As shown in fig. 1a, the electric lens focusing method specifically includes the following steps:
s101, determining the moving direction of the focusing motor in a first movement section according to the current position of the focusing motor.
Before the electric lens is focused, since the optimal focusing position is unknown, a first movement section and a movement direction of the focusing motor need to be determined before the focusing motor is started to search for the optimal focusing position, wherein the first movement section is used for limiting the movement range of the focusing motor after the focusing motor is started.
In an alternative embodiment, the first movement interval and the movement direction are determined from the current position of the focus motor in a limit movement interval, wherein the limit movement interval is used to determine the maximum and minimum positions to which the focus motor can move. For example, referring to fig. 1b, a schematic diagram of a movement direction and a limit movement interval of a focusing motor is shown, where a horizontal axis Focus represents a focusing position of the focusing motor, a vertical axis FV (Focus Value) represents an image sharpness evaluation value representing an image sharpness, which is generally calculated by using a high-frequency component in an image or an image gray gradient, and the greater the FV value, the clearer the image. Determining the current position of a focusing motor as F and a preset limit movement interval [ F ] of the focusing motor min ,F max ]The method comprises the steps of carrying out a first treatment on the surface of the Wherein F is min F for the minimum movement position of the focusing motor max The position to which the focusing motor moves to the maximum; if F is less than or equal to (F) min +F max ) And/2, the first movement interval is [ F, F max ]The moving direction is the far focus direction, i.e. the focusing motor needs to move from the current position F to the moving object F max Moving; if F > (F) min +F max ) And/2, the first movement interval is [ F min ,F]The moving direction is the near focus direction, i.e. the focusing motor moves from the current position F to the moving object F min And (5) moving.
S102, if the image definition degree accords with a preset condition in the process that the current position moves along the moving direction, determining a target focusing position according to the image definition degree, determining a moving parking position, and recording the reversing time of the parking position.
The image definition degree refers to the definition degree of the image which is acquired in real time and calculated in the process that the focusing motor moves in the current position according to the moving direction, and the image definition degree can be represented by an image definition evaluation value FV.
The preset conditions include a condition for judging whether or not there is a maximum value of the image sharpness, and if it is judged that the maximum value of the image sharpness has occurred, the focus position corresponding to the maximum value is taken as the target focus position. For example, referring to fig. 1b, the target focal position is the focal position corresponding to the abscissa of the peak point.
The moving stop position refers to a position where the focusing motor starts braking in a first movement section after the target focusing position is determined. Optionally, after determining the target focusing position, if the sharpness of a certain image collected by the electric lens is equal to a preset threshold (i.e. meets a preset condition), the focusing position of the collected image is taken as a mobile parking position, and braking is started at the position. The braking means that the connection between the driving chip and the focusing motor is kept, and the driving chip is controlled not to input voltage to the focusing motor. Thus, the focusing motor forms a discharging loop through the driving circuit, reverse electromotive force is generated at two ends of the focusing motor, and current flowing in the focusing motor is reversed. The reverse current may generate an opposite force in the rotational direction of the focus motor, thereby acting as a brake. Further, the motor can rotate a small angle to be in a static state.
After the focusing motor is braked at the movable stop position, the driving chip immediately applies reverse voltage to control the focusing motor to move from the movable stop position to the target focusing position in order to shorten the focusing time, but the focusing motor which runs at high speed suddenly brakes to generate movement overshoot, namely, the focusing motor can continue to move for a period of time along the moving direction, then the focusing motor can finish reversing and returns to the movable stop position. Therefore, the parking position reversal time refers to the time that elapses after the focus motor returns to the moving parking position again because the overshoot continues to move from the moving parking position in the moving direction.
S103, controlling the focusing motor to move from the movable parking position to the target focusing position, and braking when the target focusing position is reached.
When the focus motor is controlled to move from the moving stop position to the target focus position, it is necessary to determine in real time whether the focus motor has moved to the target focus position. In an alternative embodiment, the real-time position of the focusing motor is acquired in real time by high frequency, and the real-time position is compared with the target focusing position, and if the real-time position is the same as the target focusing position, the target focusing position is determined to be reached. In another alternative embodiment, the image sharpness corresponding to the image collected by the electric lens is obtained in real time, and compared with the image sharpness corresponding to the target focusing position, if the image sharpness is the same as the image sharpness, the target focusing position is determined to be reached.
And when the focusing motor reaches the target focusing position, braking is carried out so that the focusing motor finally stops at the target focusing position, and accurate focusing is realized. But because there is an overshoot of the focus motor, S104-S105 are required to eliminate the influence of the overshoot motion on the focus result.
S104, determining the reverse time of the parking position, and determining the target duration by adopting a preset function.
The preset function is a time function of the reverse time of the parking position, the reverse time of the parking position is input into the preset function, and the target duration can be determined according to the result, wherein the target duration is the duration of applying reverse voltage to the focusing motor.
And S105, applying a reverse voltage to the pair Jiao Dianji, and stopping applying the reverse voltage after a target time period so as to adjust the focusing motor to the target focusing position.
When the focusing motor brakes at the target focusing position, motion overshoot occurs due to sudden braking of the focusing motor running at high speed, and if no corresponding overshoot processing flow exists, the focusing motor can slide forwards continuously due to the overshoot, so that the target focusing position is missed, and focusing virtual focus is caused. Therefore, in order to avoid the influence caused by the overshoot, the inventor creatively proposes that when the focusing motor brakes at the target focusing position, the reverse voltage is applied to the regulator Jiao Dianji, and the reverse voltage is stopped to be applied after the target time length so as to eliminate the influence of the overshoot of the focusing motor, and after the reverse voltage is stopped to be applied, the focusing motor can continue to rotate a small angle to be in a static state at the target focusing position, namely, finally, the focusing motor stops at the target focusing position, thereby realizing accurate focusing.
In the embodiment of the invention, when the focusing motor is controlled to move in the first movement interval according to the determined movement direction, the target focusing position and the movement stop position are determined according to the definition degree of the acquired image and the preset condition, the stop position reversing time is recorded, and then the target duration is determined according to the stop position reversing time and the preset function, so that the focusing motor is controlled to move from the movement stop position to the target focusing position, and after braking is carried out, the energy of overshoot of the focusing motor is counteracted by applying the reverse voltage of the target duration to the focusing motor, namely the problem that the focusing motor finally stops at the target focusing position due to the fact that the direct current motor moves too fast is solved, and the automatic focusing accuracy of the electric lens is improved.
Example two
Fig. 2 is a flowchart of an electric lens focusing method according to a second embodiment of the present invention, where the method is optimized based on the foregoing embodiment, and referring to fig. 2, and includes:
s201, determining the moving direction of the focusing motor in the first movement section according to the current position of the focusing motor.
S202, acquiring images acquired by the electric lens in real time in the process that the current position moves according to the moving direction, and calculating the image definition of each image.
In the embodiment of the invention, two trend abnormal conditions of the focusing motor need to be processed in advance before searching the target focusing position. (1) The current round focusing first passes through the process of searching the target focusing position, and the focusing motor is shortThere is no start-up in time, and the trend of the image sharpness evaluation value FV in this time may cause abnormality due to the screen being stationary. (2) If the target focusing position is searched for the second time, the initial position F is recorded 0 And high-frequency acquisition of the real-time motor position F t . Because there is an overshoot when the direction of movement of the focus motor is suddenly reversed, the tendency of the image sharpness evaluation value FV is also abnormal in a short time.
Therefore, in order to avoid the two abnormal situations, before the image acquired by the electric lens is acquired in real time, the method further comprises: acquiring an initial position of a focusing motor and a real-time position of the focusing motor; judging whether the initial position and the real-time position meet preset conditions or not; if yes, executing the operation of acquiring the image acquired by the electric lens in real time. Wherein, judging whether the initial position and the real-time position meet the preset condition comprises: if the moving direction determined in S201 is the far focus direction, F needs to be satisfied t >F 0 The method comprises the steps of carrying out a first treatment on the surface of the If the moving direction determined in S201 is the near-focus direction, F needs to be satisfied t <F 0
In order to quickly search a target focusing position, a focusing motor acquires images acquired by an electric lens in real time in the process that the current position moves according to the moving direction, and calculates the image definition of each image. Alternatively, when each frame of image is acquired, the frame of image is input to a Sobel filter, and the Sobel filter can output the sharpness of the image according to the detected edge condition in the image, and the sharpness can be represented by an image sharpness evaluation value FV.
S203, determining a change trend curve of the image definition according to the calculation result.
Optionally, the image sharpness evaluation value FV obtained by calculating the image acquired each time is compared with the previous frame. By comparing the image definition evaluation values FV of the continuous multi-frame images, a change trend curve of the image definition degree can be obtained. Illustratively, when the focus motor moves in the near-focus direction at the focus position F, the change trend of the image clarity includes three kinds:
(1) The trend of change is firstly ascending and then descending, and the trend is most ideal. As shown in fig. 2b, which shows a schematic diagram of a trend of the FV value rising and falling as the focus position F moves in the near-focus direction, two arrows indicate the trend change (i.e., rising and falling).
(2) The change trend is continuously declined, or the change trend in the movement interval is not obvious. As shown in fig. 2c, which shows a schematic diagram of a trend of continuously decreasing FV value when the focus position F is moved in the near-focus direction, in which case the target focus position cannot be found, a reverse search is required, and the operations of S201-S203 are performed in return when the reverse search is performed.
(3) The trend of change continuously rises, as shown in fig. 2d, which shows a schematic diagram of the trend of change in which FV value continuously rises when the focus motor moves in the near-focus direction at the focus position F. This is an abnormal trend, and when the current FV and the initial FV rise above a certain threshold, the operation of searching the target focus position can be exited in advance, and it is determined as a hardware problem.
S204, if the change trend curve meets a first preset condition, determining a peak point of the change trend curve, taking the image definition degree corresponding to the peak point as a target image definition degree, and taking a focusing position corresponding to the peak point as a target focusing position.
The first preset condition is that the change trend curve satisfies the change trend of the rising and falling when searching the target focusing position, that is, satisfies the change trend shown in fig. 2 b. At this time, the image sharpness (i.e., FV value) corresponding to the peak point of the variation trend curve can be regarded as the target image sharpness (i.e., FV best ) The focus position corresponding to the peak point is taken as the target focus position (i.e. E best )。
And S205, if the difference value between the image definition degree of a certain acquired image and the target image definition degree meets a second preset condition, taking the focusing position when the image is acquired as a mobile parking position.
After determining the focus position of the object, only the sharpness of the acquired image and the sharpness of the object image (i.e. FV best ) The difference between them is fullIf the second preset condition is satisfied, for example, the difference is smaller than the preset threshold, the process of searching the focus position of the target can be exited in advance, that is, searching of all focus positions in the first movement section is not needed. Exemplary, if the movement direction of the focusing motor is the far focus direction, the first movement section is [ F, F max ]If the focusing motor is moving to the focusing position F 1 Sharpness FV of image acquired 1 And FV (FV) 1 And FV (FV) best The difference value of (2) is smaller than a preset threshold value and can be at a focusing position F 1 The process of searching the focus position of the target is exited, namely, the focus position F is obtained 1 As a mobile rest position and braking is performed at this position.
It should be noted that, after the focusing motor is braked at the moving stop position, in order to shorten the focusing time, the driving chip immediately applies a reverse voltage to control the focusing motor to move from the moving stop position to the target focusing position, but because the focusing motor running at a high speed suddenly brakes, a movement overshoot occurs, that is, the focusing motor continues to move for a period of time along the moving direction, the focusing motor can complete the reverse direction and returns to the moving stop position. Therefore, it is necessary to record the stop reverse time of the focus motor, which is the time that the focus motor has returned to the moving stop position after continuing to move in the moving direction from the moving stop position due to the overshoot.
S206, controlling the focusing motor to move from the movable parking position to the target focusing position, and braking when the target focusing position is reached.
Optionally, when the focusing motor is controlled to move from the movable parking position to the target focusing position, images acquired by the electric lens can be obtained in real time, and the image definition degree of each image is calculated, and the specific calculation method is referred to the above embodiment and is not repeated here; after the image definition degree of one image is obtained, comparing the image definition degree of the image with the target image definition degree, and determining whether the focusing motor reaches the target focusing position according to the comparison result. For example, when the image sharpness of the image is equal to or a difference between the image sharpness of the image and the target image sharpness is smaller than a preset value, it is determined that the focus motor has moved to the target focus position.
S207, determining the reverse time of the parking position, and determining the target duration by adopting a preset function.
And S208, applying a reverse voltage to the pair Jiao Dianji, and stopping applying the reverse voltage after the target time period so as to adjust the focusing motor to the target focusing position.
In the embodiment of the invention, the image acquired by the electric lens is acquired in real time when the real-time position and the initial position of the focusing motor are judged to meet the preset conditions, so that the problem of abnormal change trend of the definition of the image is avoided; the method has the advantages that the mode that the image definition degree is compared with the image definition degree at the target focusing position is adopted, the image definition degree moves towards the target focusing position, the return stroke difference of the focusing motor is avoided, and the focusing time is shortened.
Example III
Fig. 3a is a flowchart of an electric lens focusing method according to a third embodiment of the present invention, where the method is optimized based on the above embodiment, and referring to fig. 3a, the method includes:
s301, determining the moving direction of the focusing motor in the first movement section according to the current position of the focusing motor.
S302, determining the movement speed of the focusing motor according to the imaging frame rate of the electric lens and the depth of field of the electric lens, so that the focusing motor moves according to the movement speed.
The movement speed of the focusing motor has an important influence on the focusing effect, and if the movement speed is too high, the image acquired in one movement time of the focusing motor is insufficient, or the focusing position with the highest image definition is missed, so that before the focusing motor moves, the optimal movement speed of the focusing motor needs to be determined, so that the focusing motor moves at a uniform speed according to the optimal movement speed. The inventor finds that the focusing motor can avoid influencing the focusing effect due to the movement speed only by ensuring that the focusing motor moves by half of the depth of field at most in the time of collecting one frame of image by the lens. Thus, the optimal movement speed of the focusing motor can be determined according to the frame rate of lens imaging and the depth of field of the lens. For example, according to the depth of field of the lens, the movement interval of the focusing motor, i.e. the movement range of the focusing motor, in which the image is kept clear in the depth of field range can be known; according to the frame rate, one frame of imaging time can be known; and then the quotient of half of the movement range of the focusing motor and one frame of imaging time can be used as the optimal movement speed of the focusing motor.
S303, if the image definition degree accords with a preset condition in the process that the current position moves along the moving direction, determining a target focusing position according to the image definition degree, determining a moving stop position, and recording the stop position reversing time.
Exemplary, see FIG. 3b, which shows a schematic diagram of searching for a target focus position in a first movement interval, where F 1 To move the rest position, the focusing motor is at F 1 After starting braking, because the overshoot will continue to move forward, and at F m The focus motor starts to move reversely and returns to F 1 . While the anti-overshoot preprocessing in the figure, i.e. recording the slave F 1 Motion to F m And then return to F 1 I.e. the dock-position reversal time. It follows that the rest position reversal time includes a first time t that elapses from when the focus motor continues to move from the moving rest position in the moving direction until when the focus motor starts to move in the reverse direction 1 And a second time t elapsed from the reverse movement of the focus motor to the movement stop position 2 . I.e. the rest position reversal time is equal to t 1 +t 2
S304, controlling the focusing motor to move from the movable parking position to the target focusing position, and braking when the target focusing position is reached.
Optionally, before controlling the focusing motor to move from the moving stop position to the target focusing position, an optimal movement speed of the focusing motor can be determined according to an imaging frame rate of the electric lens and a depth of field of the electric lens, so that the focusing motor moves at a constant speed according to the optimal movement speed.
Further, in order to ensure that the focusing mechanism can be moved to the target focusing position, the focusing mechanism can be further moved to the target focusing position according to the moving stop position, the target focusing position and the preset return stroke differenceDetermining a second movement interval of the focusing motor returning to the target focusing position; and controlling the focusing motor to move according to the second movement interval so as to return to the target focusing position. Exemplary, referring to FIG. 3b, if the direction of movement from the mobile park position to the target focus position is the afocal direction, the second range of motion is [ F 1 ,F best +ΔF]The method comprises the steps of carrying out a first treatment on the surface of the If the direction of movement from the movement stop position to the target focus position is the near focus direction, the second movement section is [ F best -ΔF,F 1 ]Where Δf is the maximum return difference provided by the motor manufacturer. It should be noted that, the speed when the focusing motor is controlled to move in the first movement section according to the moving direction is the same as the speed when the focusing motor moves from the second movement section, and is equal to the optimal movement speed calculated according to the imaging frame rate and the depth of field, so that the focusing motor is ensured to move at a uniform speed in the whole focusing process, and the increase of focusing time caused by the deceleration of the focusing motor in the prior art is avoided.
S305, determining the reverse time of the parking position, and determining the target duration by adopting a preset function.
And S306, applying a reverse voltage to the pair Jiao Dianji, and stopping applying the reverse voltage after a target time period so as to adjust the focusing motor to the target focusing position.
Exemplary, see FIG. 3c, which shows a schematic view after braking at the target focus position, where F best For the target focus position, the focusing motor is at F best After braking, immediately applying reverse voltage to the focusing motor, the focusing motor overshoots and can drive the motor from F best Move to F a At F a Reverse direction, i.e. focusing motor at F a Since the reverse voltage starts to move reversely, the voltage is moved to F b When the focusing motor is in a position, the power supply is stopped, and the focusing motor can continue to rotate a small angle to be in a static state at the target focusing position. From the above, it can be seen that to eliminate the influence of the focus overshoot of the focus motor, the focus motor is set at the target focus position F best After starting braking, the reverse voltage needs to be applied and the application is stopped after a target period of time, wherein the target period of time is equal to t 1 +t 31 ,t 1 The value and t recorded in S303 1 Equal in value, thereby requiring only t 31 And (3) obtaining the product.
Further, see below, a method of solving the target duration is presented. Referring to fig. 3b, the focus motor is in the mobile rest position F 1 At braking, the speed is equal to V 0 ,t 1 And t 2 Is a relatively small time, and the acceleration of the focusing motor does not change much in a short time, and can be approximately regarded as a constant value. The focusing motor provides a positive acceleration, denoted a, when energized. The motor has motion resistance, and a reverse resistance acceleration is marked as a 0 . Motor at F 1 Position braking and starting the reverse motion until the overshoot reversal is completed, a motor speed profile as shown in fig. 3d can be obtained, where F m The speed at the position is 0, and the focusing motor returns to F 1 At a speed of V 1 。t 1 Distance of movement in time and t 2 The distance of movement in time is equal. Therefore, according to the distance and acceleration calculation formula, it can be known that:
0.5×(a+a 0 )t 1 2 =0.5×(a-a 0 )t 2 2
calculating to obtain a and a 0 Is the relation of:
referring to fig. 3c, the focusing motor actually has a power-on time t 1 +t 31 Focusing motor at F best At a braking speed of V 0 At F a At a speed of 0, at F b At a speed of V 2 Return to F best The speed at that point is 0. For example, referring to fig. 3e, a schematic diagram of a motor speed profile after braking of the focus motor at a target focus position is shown.
According to t 1 Distance of movement in time and t 32 +t 31 The distance of movement in time is equal. And unknown velocity V 2 Can pass through t 31 Acceleration a-a of (a) 0 And t 32 Is a deceleration acceleration a of (a) 0 And jointly obtaining. Thus, the following joint calculation formula can be obtained:
(a-a 0 )×t 31 =(a 0 )×t 32
0.5×(a+a 0 )t 1 2 =0.5×(a-a 0 )t 31 2 +0.5×(a 0 )t 32 2
preset function->
It should be noted that, the above-mentioned derivation process determines a preset function, and further, the precondition for determining the target duration based on the preset function is that: the focusing motor is moving at a constant speed, i.e. the speed of the focusing motor when braking at the moving rest position is equal to the speed of the focusing motor when braking at the target focusing position. If the focusing motor does not move at a uniform speed, a preset function can be determined through other calculation formulas, and then the target duration is calculated based on the determined preset function, wherein the other calculation formulas are not particularly limited.
Further, when the recorded parking position is reversed by time t 1 +t 2 When the motor is inaccurate, in order to prevent the situation that the motor is largely reversed and the image is blurred due to the fact that the motor movement steps are too large due to the applied reverse voltage, an abnormal protection strategy is adopted when the reverse voltage is applied, namely, the motor minimum movement step length is applied reversely to the pair Jiao Dianji, and the motor minimum movement step length is stopped to be applied after the target time length, wherein the motor minimum movement step length can be determined according to the factory parameters of the focusing motor.
In the embodiment of the invention, the optimal movement speed of the focusing motor is calculated through the depth of field and the imaging frame rate, so that the phenomenon that the image acquired by the focusing motor in one movement time is insufficient or the focusing position with the highest image definition is missed due to the fact that the movement speed of the focusing motor is too high is avoided; and calculating the time length of applying the reverse voltage required by the focusing motor after the target focusing position is braked through a preset function and the stopping position reversing time, so as to overcome the focusing overshoot of the focusing motor, and finally stop the focusing motor at the target focusing position, thereby improving the focusing accuracy.
Example IV
Fig. 4 is a logic flow diagram of an electric lens focusing method according to a fourth embodiment of the present invention, where the method is optimized based on the above embodiment. Referring to fig. 4, the method includes six steps:
first, preparation before focusing.
The method mainly comprises the steps of determining a moving interval and a moving direction (including a far focus direction and a near focus direction) of a focusing motor according to the current position of the focusing motor; and meanwhile, calculating the optimal movement speed of the focusing motor according to the depth of field of the electric lens and the imaging frame rate of the lens. For specific detailed implementation procedures, refer to the above embodiments, and are not described herein again.
And secondly, starting and confirming the motor.
Before searching the target focusing position, two trend abnormal conditions exist in the motor, and the motor needs to deal with the trend abnormal conditions in advance. Optionally, an initial position F of the focusing motor is obtained 0 And focusing motor real-time position F t The method comprises the steps of carrying out a first treatment on the surface of the The moving direction determined in the first step is the far focus direction and satisfies F t >F 0 At the time of or in the first step, the determined moving direction is the near-focus direction and satisfies F t <F 0 And when the image is detected, the focusing motor breaks through the overshoot limit, so that continuous image acquisition can be started, and the change trend of the image definition can be determined.
And thirdly, searching a target focusing position.
And searching a target focusing position, namely searching a focusing position with the maximum FV value by adopting a method based on comparing the image definition evaluation values FV of two adjacent frames of images according to the moving direction and the moving speed of the focusing motor in the first moving interval. Optionally, after FV values of multiple frames of continuous images are compared, a change trend of FV values can be obtained, and then a target focusing position can be determined based on the change trend of FV values, and after the target focusing position is searched, braking can be performed at the determined moving stopping position so as to exit the searching of the target focusing position in advance. If the obtained FV value has a less obvious trend, it is indicated that the motor does not find the target focus position in the current moving direction, the reverse movement of the focusing motor needs to be controlled to continue searching, and when the reverse movement is needed, the operation is started from the first step.
Fourth, overshoot prevention pretreatment.
After the focusing motor is braked at the moving stop position, because the focusing motor overshoots, the stop position reversal time of the focusing motor is recorded through overshoot prevention preprocessing, namely, the first time which is passed when the focusing motor starts to reversely move and the second time which is passed when the focusing motor reversely moves to the moving stop position are recorded, wherein the stop position reversal time is recorded when the focusing motor moves to the moving stop position continuously moves along the moving direction.
And fifthly, returning to the target focusing position.
After the overshoot prevention preprocessing, the focusing motor is controlled to move from the movable stop position to the target focusing position, and optionally, the definition degree FV of the image acquired in real time and the image definition degree FV corresponding to the target focusing position are controlled best When the two are infinitely close, the focusing motor is considered to be moved to the target focusing position. By way of example, the FV fluctuation in static state of the focusing motor can be obtained by the FV fluctuation ratio x ", thus approximating FV best The threshold of (2) may be determined to be 100% -x%.
And sixthly, overshoot prevention processing.
After the focusing motor returns to the target focusing position and is braked, if no other processing flow exists, the motor overshoots and continues to slide forwards, so that the target focusing position is missed, and virtual focus is focused. Therefore, the focusing motor is powered on immediately after braking, the minimum motion step length of the motor is reversely applied according to the current position and the motion direction, and the motor power-on time is defined as the target time length, wherein the target time length is determined according to the stop position reverse time recorded in the fourth step and by adopting a preset function, and the specific calculation process is referred to the above embodiment and is not repeated herein. After the focusing motor is electrified for the target time, the focusing motor is finally stopped at the target focusing position based on self resistance, namely the influence of the focusing motor caused by overshoot is eliminated.
The embodiment of the invention solves the problem of focusing overshoot of the electric lens caused by too fast movement of the direct current motor, and improves the success rate of focusing of the electric lens in real scenes.
Example five
Fig. 5 is a schematic structural diagram of an electric lens focusing apparatus according to a fifth embodiment of the present invention, which is applicable to a case of auto-focusing a lens driven by a dc motor, and which includes, referring to fig. 5:
a first determining module 501, configured to determine a moving direction of the focus motor in a first movement interval according to a current position of the focus motor;
a second determining module 502, configured to determine, if the image sharpness meets a preset condition during the movement of the current position according to the movement direction, a target focusing position according to the image sharpness, determine a movement stop position, and record a stop position inversion time;
a motion control module 503 for controlling the focus motor to move from the moving stop position to the target focus position and to perform braking when the target focus position is reached;
a target duration determining module 504, configured to determine a dock location inversion time, and determine a target duration by using a preset function;
the overshoot processing module 505 is configured to apply a reverse voltage to the focusing motor, and stop applying the reverse voltage after a target period of time, so as to adjust the focusing motor to a target focusing position.
On the basis of the above embodiment, optionally, the first determining module is specifically configured to:
determining the position F of a focusing motor and a preset limit movement interval [ F ] of the focusing motor min ,F max ]The method comprises the steps of carrying out a first treatment on the surface of the Wherein F is min F for the minimum movement position of the focusing motor max The position to which the focusing motor moves to the maximum;
if F is less than or equal to (F) min +F max ) And/2, the first movement interval is [ F, F max ]The moving direction is the far focus direction;
if F > (F) min +F max ) And/2, the first movement interval is [ F min ,F]The moving direction is the near-focus direction.
On the basis of the above embodiment, optionally, the second determining module includes:
the image definition calculating unit is used for acquiring images acquired by the electric lens in real time in the process that the current position moves according to the moving direction and calculating the image definition of each image;
the change trend curve determining unit is used for determining a change trend curve of the image definition according to the calculation result;
the target focusing position determining unit is used for determining peak points of the change trend curve if the change trend curve meets a first preset condition, taking the image definition degree corresponding to the peak points as target image definition degree and taking the focusing position corresponding to the peak points as target focusing position;
The mobile parking position determining unit is used for taking the focusing position when the image is acquired as the mobile parking position if the difference value between the image definition degree of the acquired image and the target image definition degree meets a second preset condition.
On the basis of the above embodiment, optionally, the apparatus further includes:
the position acquisition module is used for acquiring the initial position of the focusing motor and the real-time position of the focusing motor;
the judging module is used for judging whether the initial position and the real-time position meet preset conditions or not;
and the acquisition module is used for executing the operation of acquiring the image acquired by the electric lens in real time if the judgment result is yes.
On the basis of the above embodiment, optionally, the stop position reversing time includes a first time t that elapses when the focus motor starts to move reversely, from the moving stop position to the focus motor continuing to move in the moving direction 1 And the focus motor moves reversely toA second time t elapsed to move the rest position 2
On the basis of the above embodiment, optionally, the target duration determining module is specifically configured to:
the target duration is calculated according to the following formula:
wherein F (,) is a preset function,/>
on the basis of the above embodiment, optionally, the apparatus further includes:
And the movement speed determining module is used for determining the movement speed of the focusing motor according to the imaging frame rate of the electric lens and the depth of field of the electric lens before controlling the focusing motor to move from the current position according to the movement direction or before controlling the focusing motor to move from the movement stop position to the target focusing position so as to enable the focusing motor to move according to the movement speed.
Based on the above embodiment, optionally, the motion control module includes:
the second movement interval determining unit is used for determining a second movement interval of the focusing motor returning to the target focusing position according to the mobile parking position, the target focusing position and the preset return difference;
and the movement control unit is used for controlling the focusing motor to move according to the second movement interval so as to return to the target focusing position.
On the basis of the above embodiment, optionally, the apparatus further includes:
the image definition calculating module is used for acquiring images acquired by the electric lens in real time and calculating the image definition of each image when the focusing motor is controlled to move from the movable stop position to the target focusing position;
and the target focusing position determining module is used for comparing the image definition degree of the image with the target image definition degree after obtaining the image definition degree of one image, and determining whether the focusing motor reaches the target focusing position according to the comparison result.
On the basis of the above embodiment, optionally, the overshoot processing module is specifically configured to:
and reversely applying a motor minimum motion step length to the focusing motor, and stopping applying after the target duration.
The electric lens focusing device provided by the embodiment of the invention can execute the electric lens focusing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example six
Fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention. Fig. 6 shows a block diagram of an exemplary electronic device 12, optionally a mobile terminal, suitable for use in implementing embodiments of the invention. The electronic device 12 shown in fig. 6 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 6, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing an electric lens focusing method provided by an embodiment of the present invention, the method including:
determining the moving direction of the focusing motor in a first movement interval according to the current position of the focusing motor; if the image definition degree accords with the preset condition in the moving process of the current position according to the moving direction, determining a target focusing position according to the image definition degree, determining a moving parking position, and recording the reversing time of the parking position; controlling the focusing motor to move from the movable stop position to the target focusing position and braking when the target focusing position is reached; determining the reverse time of the parking position, and determining the target duration by adopting a preset function; and applying a reverse voltage to the focusing motor, and stopping applying the reverse voltage after the target time length so as to adjust the focusing motor to the target focusing position.
Example seven
The seventh embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the motorized lens focusing method applied to a mobile terminal as provided in the embodiments of the present invention, the method comprising:
Determining the moving direction of the focusing motor in a first movement interval according to the current position of the focusing motor; if the image definition degree accords with the preset condition in the moving process of the current position according to the moving direction, determining a target focusing position according to the image definition degree, determining a moving parking position, and recording the reversing time of the parking position; controlling the focusing motor to move from the movable stop position to the target focusing position and braking when the target focusing position is reached; determining the reverse time of the parking position, and determining the target duration by adopting a preset function; and applying a reverse voltage to the focusing motor, and stopping applying the reverse voltage after the target time length so as to adjust the focusing motor to the target focusing position.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (11)

1. A method of motorized lens focusing, the method comprising:
determining the moving direction of the focusing motor in a first movement interval according to the current position of the focusing motor;
if the image definition degree accords with a preset condition in the process that the current position moves along the moving direction, determining a target focusing position according to the image definition degree, determining a moving stop position, and recording the stop position reversing time; wherein the rest position reversal time includes the movement of the focus motor from the moving rest position along the movement The moving direction continues to move until the first time t when the focusing motor starts to move reversely 1 And a second time t elapsed from the reverse movement of the focus motor to the mobile rest position 2
Controlling a focusing motor to move from the movable stop position to a target focusing position, and braking when the focusing motor reaches the target focusing position;
the target duration is calculated according to the following formula:wherein F (,) is a preset function, < ->
And applying a reverse voltage to the focusing motor, and stopping applying the reverse voltage after a target time length so as to adjust the focusing motor to the target focusing position.
2. The method of claim 1, wherein determining a direction of movement of the focus motor within the first range of motion based on a current position of the focus motor comprises:
determining the position F of a focusing motor and a preset limit movement interval [ F ] of the focusing motor min ,F max ]The method comprises the steps of carrying out a first treatment on the surface of the Wherein F is min F for the minimum movement position of the focusing motor max The position to which the focusing motor moves to the maximum;
if F is less than or equal to (F) min +F max ) And/2, the first movement interval is [ F, F max ]The moving direction is the far focus direction;
if F>(F min +F max ) And/2, the first movement interval is [ F ] min ,F]The moving direction is the near-focus direction.
3. The method according to claim 1, wherein if the image clarity degree meets a preset condition during the movement of the current position in the movement direction, determining the target focus position according to the image clarity degree, and determining the movement stop position, comprises:
in the process that the current position moves according to the moving direction, acquiring images acquired by the electric lens in real time, and calculating the image definition degree of each image;
determining a change trend curve of the image definition according to the calculation result;
if the change trend curve meets a first preset condition, determining a peak point of the change trend curve, taking the image definition degree corresponding to the peak point as a target image definition degree, and taking a focusing position corresponding to the peak point as a target focusing position;
and if the difference value between the image definition degree of a certain acquired image and the target image definition degree meets a second preset condition, taking the focusing position when the image is acquired as the mobile parking position.
4. The method of claim 1, wherein prior to acquiring the image captured by the motorized lens in real-time, the method further comprises:
Acquiring an initial position of a focusing motor and a real-time position of the focusing motor;
judging whether the initial position and the real-time position meet preset conditions or not;
if yes, executing the operation of acquiring the image acquired by the electric lens in real time.
5. The method of claim 1, wherein prior to controlling the focus motor to move from the current position in the direction of movement or prior to controlling the focus motor to move from the movement-stopped position to a target focus position, the method further comprises:
and determining the movement speed of the focusing motor according to the imaging frame rate of the electric lens and the depth of field of the electric lens, so that the focusing motor moves according to the movement speed.
6. The method of claim 1, wherein controlling movement of the focus motor from the movement park position to the target focus position comprises:
determining a second movement interval of the focusing motor returning to the target focusing position according to the mobile parking position, the target focusing position and a preset return stroke difference;
and controlling the focusing motor to move according to the second movement interval so as to return to the target focusing position.
7. A method according to claim 3, wherein upon controlling the focus motor to move from the mobile home position to a target focus position, the method further comprises:
Acquiring images acquired by an electric lens in real time, and calculating the image definition of each image;
after the image definition degree of one image is obtained, comparing the image definition degree of the image with the target image definition degree, and determining whether the focusing motor reaches the target focusing position according to a comparison result.
8. The method of claim 1, wherein applying a reverse voltage to the focus motor and ceasing to apply the reverse voltage after a target period of time comprises:
and reversely applying a motor minimum movement step length to the focusing motor, and stopping applying after the target duration.
9. An electric lens focusing apparatus, the apparatus comprising:
the first determining module is used for determining the moving direction of the focusing motor in the first movement interval according to the current position of the focusing motor;
the second determining module is used for determining a target focusing position according to the image definition degree if the image definition degree accords with a preset condition in the process that the current position moves along the moving direction, determining a moving parking position and recording the reversing time of the parking position; wherein the rest position is reversed The time includes the first time t that the focusing motor continues to move along the moving direction from the moving stopping position until the focusing motor starts to move reversely 1 And a second time t elapsed from the reverse movement of the focus motor to the mobile rest position 2
The motion control module is used for controlling the focusing motor to move from the movable stop position to the target focusing position and braking when the target focusing position is reached;
the target duration determining module is used for calculating the target duration according to the following formula: wherein F (,) is a preset function, < ->
And the overshoot processing module is used for applying reverse voltage to the focusing motor and stopping applying the reverse voltage after the target duration so as to adjust the focusing motor to the target focusing position.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the motorized lens focusing method of any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the motorized lens focusing method according to any one of claims 1-8.
CN202010673661.6A 2020-07-14 2020-07-14 Electric lens focusing method and device, electronic equipment and storage medium Active CN113938599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010673661.6A CN113938599B (en) 2020-07-14 2020-07-14 Electric lens focusing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010673661.6A CN113938599B (en) 2020-07-14 2020-07-14 Electric lens focusing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113938599A CN113938599A (en) 2022-01-14
CN113938599B true CN113938599B (en) 2024-03-08

Family

ID=79273875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010673661.6A Active CN113938599B (en) 2020-07-14 2020-07-14 Electric lens focusing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113938599B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114143469B (en) * 2022-01-29 2022-05-10 浙江华创视讯科技有限公司 Lens control method, system, electronic device and storage medium
CN114640792B (en) * 2022-02-09 2024-04-05 浙江大华技术股份有限公司 Position adjustment method and device, electronic equipment and storage medium
CN114460791A (en) * 2022-03-07 2022-05-10 合肥英睿系统技术有限公司 Focusing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4857947A (en) * 1986-12-08 1989-08-15 Nikon Corporation Position controlling device in a lens driving apparatus for camera
US5057859A (en) * 1990-11-23 1991-10-15 Olympus Optical Co., Ltd. Camera having high-precision stop function for movable unit
CN104902174A (en) * 2015-05-19 2015-09-09 广东欧珀移动通信有限公司 Method for controlling rotation of camera, and terminal
CN107529011A (en) * 2017-08-23 2017-12-29 珠海安联锐视科技股份有限公司 A kind of motorized zoom lenses control system and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130100334A1 (en) * 2011-10-20 2013-04-25 Broadcom Corporation Method and System for an Adaptive Auto-Focus Algorithm
JP6268459B2 (en) * 2012-02-02 2018-01-31 パナソニックIpマネジメント株式会社 Motor control device and imaging device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4857947A (en) * 1986-12-08 1989-08-15 Nikon Corporation Position controlling device in a lens driving apparatus for camera
US5057859A (en) * 1990-11-23 1991-10-15 Olympus Optical Co., Ltd. Camera having high-precision stop function for movable unit
CN104902174A (en) * 2015-05-19 2015-09-09 广东欧珀移动通信有限公司 Method for controlling rotation of camera, and terminal
CN107529011A (en) * 2017-08-23 2017-12-29 珠海安联锐视科技股份有限公司 A kind of motorized zoom lenses control system and method

Also Published As

Publication number Publication date
CN113938599A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
CN113938599B (en) Electric lens focusing method and device, electronic equipment and storage medium
CN110278383B (en) Focusing method, focusing device, electronic equipment and storage medium
EP3627821B1 (en) Focusing method and apparatus for realizing clear human face, and computer device
CN110381261B (en) Focusing method, focusing device, computer-readable storage medium and electronic equipment
US9288378B2 (en) Autofocus apparatus
CN109951644B (en) Control method, control device and electronic device
JP2011257699A5 (en) Imaging apparatus, control method therefor, and storage medium
US20160360092A1 (en) Focusing method, and image capturing device for implementing the same
US8000591B2 (en) Automatic focusing apparatus
US9165364B1 (en) Automatic tracking image pickup system
CN113934098A (en) Projection equipment, automatic focusing method and device of projection equipment
WO2017157154A1 (en) Auto-focusing method and apparatus
US9591201B2 (en) AF controller, lens apparatus including the AF controller and image pickup apparatus
US11394873B2 (en) Control apparatus, control method, and recording medium
CN111491105B (en) Focusing method of mobile terminal, mobile terminal and computer storage medium
CN110830726B (en) Automatic focusing method, device, equipment and storage medium
JP5873336B2 (en) Focus adjustment device
CN113163114A (en) Image focusing method, device, equipment and medium
CN113163112B (en) Fusion focus control method and system
CN104601886A (en) Control method and device for infrared image motor focusing operation
JPH11331828A (en) Automatic tracking device
CN104228705B (en) Utilize the device and method of vector tracking driver&#39;s attention
Srivastava et al. Design and implementation of a real-time autofocus algorithm for thermal imagers
US8571403B2 (en) Autofocus system
CN113055584B (en) Focusing method based on fuzzy degree, lens controller and camera module

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