CN115980965A - Embedded-based telephoto lens automatic focusing system and method - Google Patents

Embedded-based telephoto lens automatic focusing system and method Download PDF

Info

Publication number
CN115980965A
CN115980965A CN202211368811.8A CN202211368811A CN115980965A CN 115980965 A CN115980965 A CN 115980965A CN 202211368811 A CN202211368811 A CN 202211368811A CN 115980965 A CN115980965 A CN 115980965A
Authority
CN
China
Prior art keywords
focusing
embedded
digital video
value
module
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.)
Pending
Application number
CN202211368811.8A
Other languages
Chinese (zh)
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.)
Beijing Institute of Technology BIT
Original Assignee
Beijing Institute of Technology BIT
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 Beijing Institute of Technology BIT filed Critical Beijing Institute of Technology BIT
Priority to CN202211368811.8A priority Critical patent/CN115980965A/en
Publication of CN115980965A publication Critical patent/CN115980965A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Lens Barrels (AREA)

Abstract

The invention relates to an embedded-based telephoto lens automatic focusing system and method, belongs to the field of image processing technology and detection application, and particularly relates to a variable-step traversal automatic focusing method and an embedded-development-based automatic focusing system for realizing the method. The method adopts the over-peak variable step length control and quick search focusing method, adopts the self-adaptive 'hill climbing method' to perform feedback control on the camera lens, has the advantages of rapidness in the large step length traversal algorithm and accuracy in the small step length traversal algorithm, and avoids the defects that the large step length algorithm is easy to oscillate at an extreme point and the small step length algorithm consumes time. The method greatly improves the focusing speed and the adaptability on the premise of ensuring the focusing precision, thereby ensuring the final focusing position to have the best definition.

Description

Embedded-based telephoto lens automatic focusing system and method
Technical Field
The invention relates to an embedded telephoto lens based automatic focusing system and method, belongs to the field of image processing technology and detection application, and particularly relates to a variable-step traversal automatic focusing method and an embedded development based automatic focusing system for realizing the method.
Background
In a video monitoring system, in order to realize rapid positioning of a monitored target, an automatic positioning and automatic focusing method is often required to be adopted for a pan-tilt camera system. In some security monitoring with a smaller monitoring range, a small, flexible and conveniently-installed integrated camera is often adopted, and an automatic focusing function is often built in the camera, so that the camera is very convenient and fast to use. However, in a monitoring system in a special situation (such as forest fire prevention monitoring, remote video monitoring in large-scale factories, ships and other environments), in order to obtain a large monitoring range, a long-focus electric two-variable or three-variable lens is required. Such lenses generally do not have an autofocus function and require manual focusing. In practical use, monitoring personnel firstly adjust the monitoring range of the image through zooming and then manually adjust the focal length through monitoring software until the image is clear. The adjustment process is long due to the long focal length, and the focusing precision is greatly influenced by the subjectivity of monitoring personnel.
Therefore, the digital image processing technology is used to solve the focusing problem of the telephoto lens, and reduce subjective influences of operators, thereby further improving the measurement accuracy, the measurement speed and the automation degree.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the system and the method are used for solving the problems of automatic focusing and zooming of the telephoto lens, realizing automatic focusing in the stroke range of the whole lens and at any position and improving the speed and the precision of lens focusing.
The technical solution of the invention is as follows:
the automatic focusing system based on the embedded telephoto lens comprises a video acquisition processing module, an embedded main control module, a power supply module, a communication module, a motor driving module, a zooming motor and a focusing motor, and peripheral equipment comprises an input wiring terminal, an output wiring terminal and an upper computer;
the video acquisition processing module is used for acquiring analog video signals output by the embedded telephoto lens, converting the acquired analog video signals into digital video signals and outputting the digital video signals to the embedded main control module;
the embedded main control module is used for receiving the digital video signals output by the video acquisition processing module, evaluating the definition of the received digital video signals to obtain a zooming control instruction and a focusing control instruction, and finally outputting the zooming control instruction and the focusing control instruction to the motor driving module;
the motor driving module is used for receiving a zooming control instruction and a focusing control instruction output by the embedded main control module, controlling a zooming motor of the telephoto lens according to the received zooming control instruction, controlling a focusing motor of the telephoto lens according to the received focusing control instruction, enabling the definition evaluation value of the current digital video signal to be maximum, realizing automatic focusing, obtaining focusing position, zooming position and speed information, and feeding back the obtained focusing position, zooming position and speed information to the embedded main control module;
the power supply module is used for supplying power and adopts a 12V direct current power supply;
the embedded telephoto lens based automatic focusing system further comprises a manual control module, and when the video acquisition processing module has a fault, the manual control module manually outputs a digital video signal to the embedded main control module;
the embedded main control module takes STM32F103C8T6 as a main control IC of the automatic focusing board;
the video acquisition processing module performs Sobel edge detection on the digital video signal by adopting SAA1117H and a field editable gate array (FPGA) chip EP2C8T144C8N in a matching way to obtain a real-time image definition index;
the power module adopts a low-power-consumption DCDC voltage reduction chip and an LDO (low dropout regulator), so that the power consumption of a control system is always strived to be as small as possible in practical application, and the power supply is safe and reliable as possible;
the communication module is provided with two communication circuits of RS485 and RS232, and is suitable for various application scenes;
the motor driving module selects a double H-bridge driver chip, and only a master control chip gives a PWM signal in the continuous variable focus lens, so that voltage can be output to control a lens stepping motor or a direct current motor;
the manual control module is composed of a triode and an MOS tube.
An embedded telephoto lens based automatic focusing method comprises the following steps:
firstly, a video acquisition processing module acquires an analog video signal output based on an embedded telephoto lens, converts the acquired analog video signal into a digital video signal and outputs the digital video signal to an embedded main control module;
secondly, after receiving the digital video signals output by the video acquisition processing module, the embedded main control module evaluates the definition of the received digital video signals to obtain a zooming control instruction and a focusing control instruction, and finally outputs the zooming control instruction and the focusing control instruction to the motor driving module;
thirdly, after receiving the zooming control instruction and the focusing control instruction output by the embedded main control module, the motor driving module controls a zooming motor of the telephoto lens according to the received zooming control instruction, controls a focusing motor of the telephoto lens according to the received focusing control instruction, maximizes the definition evaluation value of the current digital video signal, realizes automatic focusing, obtains focusing position, zooming position and speed information, and feeds back the obtained focusing position, zooming position and speed information to the embedded main control module;
fourthly, after receiving the focusing position, the zooming position and the speed information fed back by the motor driving module, the embedded main control module outputs the focusing position, the zooming position and the speed information to the upper computer through the communication module in real time;
the embedded telephoto lens automatic focusing system further comprises a manual control module, and when the video acquisition processing module breaks down, the manual control module manually outputs digital video signals to the embedded main control module.
In the second step, the specific method for evaluating the definition of the received digital video signal to obtain the zoom control command and the focus control command comprises the following steps: the method comprises the steps of enabling the position of a telephoto lens to be within an effective range, adjusting the direction of the telephoto lens within the effective range, enabling the telephoto lens to move towards the direction of increasing the definition evaluation value of the digital video signal until the maximum value of the definition evaluation value of the digital video signal is searched, and adjusting the step length of the telephoto lens to improve the focusing speed in the moving process;
the method is characterized in that an automatic focusing strategy of over-peak variable step length control and rapid search is adopted when the maximum value of the definition evaluation value of the digital video signal is searched, and the specific method comprises the following steps:
step S1: the telephoto lens carries out self-checking, records the minimum and maximum positions of the potentiometer value of the focusing motor, and obtains the relation between the increase and decrease of the potentiometer and the motor steering;
step S2: acquiring an initial position of the telephoto lens, setting the definition at the initial position as an initial value, and determining an initial traversal step length;
and step S3: selecting an initial moving direction of a focusing motor according to the initial position of the telephoto lens, and moving along the initial direction according to the initial traversal step length determined in the step S2;
and step S4: acquiring a definition value of a current digital video signal in real time during movement, calculating a current focusing evaluation function, determining the correct direction of the movement of the motor according to the magnitude relation between the current definition value and an initial value, if the acquired and analyzed definition value is in a unimodal shape, increasing and then decreasing, indicating that the direction is correct, and comparing the focusing evaluation functions of all traversal positions to acquire a peak position; if the definition value is in a monotone decreasing shape and the correct direction is reverse, changing the direction of the motor until the definition value is in a unimodal shape, increasing first and then decreasing, and stopping to obtain the position of a peak value;
s5, taking a positive interval and a negative interval of the peak position obtained in the step S4 as a next round of search interval, changing the step length into 1/2 of the original step length when the peak is over-searched and reversely searched, and calculating a focusing evaluation function traversing each position;
s6, repeating S3-S4 until the step length is smaller than a set threshold value, determining that the definition of the digital video signal at the moment meets the requirement, finishing focusing and finishing searching the maximum value of the definition evaluation value of the digital video signal;
in the step S2, the initial traversal step length is less than the width of the maximum peak value of the focusing evaluation function and cannot exceed the focusing surface;
the initial moving direction in the step S3 depends on the relative positions of the initial position and the minimum and maximum positions of the focusing motor potentiometer values recorded in the step S1, and if the initial moving direction is close to the maximum position end, the initial moving direction selects the potentiometer value increasing direction; if the distance from the minimum position end is close, the potential selecting value of the initial moving direction is decreased;
in step S4, the focus evaluation function adopts a DCT transform method based on an image frequency domain, and for an N × N pixel block, a calculation formula of two-dimensional discrete cosine transform is as follows:
Figure BDA0003924175710000051
wherein F (i, j) represents the gray level of the original digital video signal at point (i, j), F (u, v) represents the DCT-transformed value, and c (u) represents a compensation coefficient such that the DCT transform matrix is an orthogonal matrix equal to the (k, k) value when and only when u is 0
Figure BDA0003924175710000052
The remaining values are 1;
in step S6, the threshold is set to have a magnitude related to the motor accuracy, and both are of the same order of magnitude.
Advantageous effects
(1) Aiming at the problem that the long-focus electric two-variable and three-variable lenses in a video monitoring system cannot realize automatic focusing, the invention autonomously develops a set of automatic focusing system by utilizing an image processing technology and an embedded platform, and the automatic focusing system comprises hardware circuit design and a software algorithm.
(2) The invention provides a focusing method of peak-crossing step-length-changing control and rapid searching aiming at the requirements of a monitoring system on the speed and the precision of automatic focusing during target tracking, adopts a self-adaptive 'hill climbing method' to perform feedback control on a camera lens, has the advantages of rapidness of a large-step-length traversal algorithm and precision of a small-step-length traversal algorithm, and simultaneously avoids the defects that the large-step-length algorithm is easy to oscillate at an extreme point and the small-step-length algorithm consumes time.
(3) The invention greatly improves the focusing speed and adaptability on the premise of ensuring the focusing precision, ensures the optimal definition of the final focusing position, has good accuracy, rapidness and robustness, and can be widely applied to the automatic focusing and manual focusing links of the indoor and outdoor telephoto lenses.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention;
FIG. 2 is a schematic diagram of the peak-crossing step-changing control;
FIG. 3 is a diagram illustrating the focusing effect of the present invention.
Detailed Description
For a clearer and more complete description of the objects, technical solutions and advantages of the present application, the following detailed description will be made with reference to the accompanying drawings and embodiments.
As shown in fig. 1, the automatic focusing system based on the embedded telephoto lens includes a video acquisition processing module, an embedded main control module, a power module, a communication module, a motor driving module, a zoom motor and a focusing motor, and the peripheral device includes an input terminal, an output terminal and an upper computer;
the video acquisition processing module is used for acquiring analog video signals output by the embedded telephoto lens, converting the acquired analog video signals into digital video signals and outputting the digital video signals to the embedded main control module;
the embedded main control module is used for receiving the digital video signals output by the video acquisition processing module, evaluating the definition of the received digital video signals to obtain a zooming control instruction and a focusing control instruction, and finally outputting the zooming control instruction and the focusing control instruction to the motor driving module;
the motor driving module is used for receiving a zooming control instruction and a focusing control instruction output by the embedded main control module, controlling a zooming motor of the telephoto lens according to the received zooming control instruction, controlling a focusing motor of the telephoto lens according to the received focusing control instruction, enabling the definition evaluation value of the current digital video signal to be maximum, realizing automatic focusing, obtaining focusing position, zooming position and speed information, and feeding back the obtained focusing position, zooming position and speed information to the embedded main control module;
the power supply module is used for supplying power and adopts a 12V direct current power supply;
the embedded telephoto lens based automatic focusing system further comprises a manual control module, and when the video acquisition processing module has a fault, the manual control module manually outputs a digital video signal to the embedded main control module;
the embedded main control module takes STM32F103C8T6 as a main control IC of the automatic focusing board;
the video acquisition processing module performs Sobel edge detection on the digital video signal by adopting SAA1117H and a field editable gate array (FPGA) chip EP2C8T144C8N in a matching way to obtain a real-time image definition index;
the power module adopts a low-power-consumption DCDC voltage reduction chip and an LDO (low dropout regulator), so that the power consumption of a control system is always strived to be as small as possible in practical application, and the power supply is safe and reliable as possible;
the communication module is provided with two communication circuits of RS485 and RS232, and is suitable for various application scenes;
the motor driving module selects a double H-bridge driver chip, and only a master control chip gives a PWM signal in the continuous variable focus lens, so that voltage can be output to control a lens stepping motor or a direct current motor;
the manual control module is composed of a triode and an MOS tube.
An embedded telephoto lens based automatic focusing method comprises the following steps:
firstly, a video acquisition processing module acquires an analog video signal output based on an embedded telephoto lens, converts the acquired analog video signal into a digital video signal and outputs the digital video signal to an embedded main control module;
secondly, after receiving the digital video signals output by the video acquisition processing module, the embedded main control module evaluates the definition of the received digital video signals to obtain a zooming control instruction and a focusing control instruction, and finally outputs the zooming control instruction and the focusing control instruction to the motor driving module;
thirdly, after receiving the zooming control instruction and the focusing control instruction output by the embedded main control module, the motor driving module controls a zooming motor of the telephoto lens according to the received zooming control instruction, controls a focusing motor of the telephoto lens according to the received focusing control instruction, maximizes the definition evaluation value of the current digital video signal, realizes automatic focusing, obtains focusing position, zooming position and speed information, and feeds back the obtained focusing position, zooming position and speed information to the embedded main control module;
fourthly, after receiving the focusing position, the zooming position and the speed information fed back by the motor driving module, the embedded main control module outputs the focusing position, the zooming position and the speed information to the upper computer through the communication module in real time;
the embedded telephoto lens based automatic focusing system further comprises a manual control module, and when the video acquisition processing module breaks down, the manual control module is used for manually outputting digital video signals to the embedded main control module.
In the second step, the specific method for evaluating the definition of the received digital video signal to obtain the zoom control command and the focus control command comprises the following steps: the method comprises the steps of enabling the position of a telephoto lens to be within an effective range, adjusting the direction of the telephoto lens within the effective range, enabling the telephoto lens to move towards the direction of increasing the definition evaluation value of the digital video signal until the maximum value of the definition evaluation value of the digital video signal is searched, and adjusting the step length of the telephoto lens to improve the focusing speed in the moving process;
the method is characterized in that an automatic focusing strategy of over-peak variable step control and rapid search is adopted when the maximum value of the definition evaluation value of the digital video signal is searched, and the specific method comprises the following steps:
step S1: the telephoto lens carries out self-checking, records the minimum and maximum positions of the potentiometer value of the focusing motor, and obtains the relation between the increase and decrease of the potentiometer and the motor steering;
step S2: acquiring an initial position of the telephoto lens, setting the definition at the initial position as an initial value, and determining an initial traversal step length;
and step S3: selecting an initial moving direction of a focusing motor according to the initial position of the telephoto lens, and moving along the initial direction according to the initial traversal step length determined in the step S2;
and step S4: acquiring a definition value of a current digital video signal in real time during moving, calculating a current focusing evaluation function, determining the correct moving direction of the motor according to the size relation between the current definition value and an initial value, if the acquired and analyzed definition value is in a single-peak shape, increasing and decreasing at first, indicating that the direction is correct, and comparing the focusing evaluation functions of all traversal positions to acquire a peak position; if the definition value is in a monotone decreasing shape and the correct direction is reverse, changing the direction of the motor until the definition value is in a unimodal shape, increasing first and then decreasing, and stopping to obtain the position of a peak value;
s5, as shown in the figure 2, taking a positive interval and a negative interval of the peak position obtained in the step S4 as a next round of search interval, changing the step length into 1/2 of the original step length when peak-crossing reverse search is carried out, and calculating a focusing evaluation function traversing each position;
s6, repeating S3-S4 until the step length is smaller than a set threshold value, determining that the definition of the digital video signal at the moment meets the requirement, finishing focusing and finishing searching the maximum value of the definition evaluation value of the digital video signal;
in the step S2, the initial traversal step length is less than the width of the maximum peak value of the focusing evaluation function and cannot exceed the focusing surface;
the initial moving direction in the step S3 depends on the relative positions of the initial position and the minimum and maximum positions of the focus motor potentiometer value recorded in the step S1, and if the distance from the maximum position end is close, the initial moving direction selects the potentiometer value increasing direction; if the distance from the minimum position end is close, the potential selecting value of the initial moving direction is decreased;
in step S4, the focus evaluation function adopts a DCT transform method based on an image frequency domain, and for an N × N pixel block, a calculation formula of two-dimensional discrete cosine transform is as follows:
Figure BDA0003924175710000091
wherein F (i, j) represents the gray level of the original digital video signal at the (i, j) point, F (u, v) represents the DCT transformed value, c (u) represents a compensation coefficient, such that the DCT transform matrix is an orthogonal matrix, and is equal to the orthogonal matrix if and only if u is 0
Figure BDA0003924175710000092
The remaining values are 1;
in step S6, the threshold is set to have a magnitude related to the motor accuracy, and both are of the same order of magnitude.
Examples
The automatic focusing function of the invention is divided into two parts, one part is automatic focusing, and the other part is manual focusing. Manual focusing mainly sends a target position to a direct current motor through an upper computer to drive the lens position of the camera to move. This function is mainly used when the lens is required to focus to a specific position in a specific scene.
The automatic focusing link comprises three stages of focusing preparation, automatic focusing and scene detection:
in the focusing preparation stage, the position of the lens is in an effective range, and initialization work is completed; the automatic focusing state is mainly to analyze and judge the current direction and the step size according to the relationship between the focusing evaluation function values of five continuous frames. The method mainly comprises two parts of calculation of a focusing evaluation function and realization of a focusing image definition maximum value search strategy. They are critical to affect the focus real-time and accuracy. The lens moving direction is a direction which enables the focusing evaluation function value to be increased and enables the image to be clearer on a focal plane; the lens moving step length adopts the strategies of large step length search in the far focus area and small step length search in the near focus area. The step length of lens movement is required to quickly, stably and accurately find the position of the peak value of the focusing evaluation function curve; the scene detection stage is mainly used for detecting whether the current scene changes after the focusing is finished, and if the current scene changes, the stage is switched to the focusing preparation stage.
The focusing preparation stage plays a crucial role in the focusing effect, stability, etc. of the entire auto-focusing algorithm. The main work of this stage consists of two parts: firstly, moving the lens to an effective focusing range under Zoom by the maximum lens moving step length; and secondly, initializing all parameters in the automatic focusing algorithm.
In terms of focus search strategy, hill-climbing (Hill-climbing) focus search algorithm is currently the most widely applied algorithm in searching for focus evaluation function peaks. The theoretical basis of the traditional hill climbing method is that an ideal focusing evaluation function curve is unimodal, and has a trend of decreasing or increasing on two sides of a peak value, when a lens is positioned at the peak value position of the focusing evaluation function curve, a clear image is presented on a camera focal plane, and the farther the lens position is away from the peak value position of the focusing evaluation function curve, the more fuzzy the image is presented, and the smaller the focusing evaluation function value is. And searching the focusing evaluation function value of the front and rear lens position images to obtain the peak position of the focusing evaluation function curve. Firstly, the focusing lens searches in any direction, the lens moves towards the direction of the mountain top after the direction of clear focusing is determined, and when the direction of clear focusing exceeds the mountain top, reverse searching focusing is carried out until the peak value is reached and the lens stops.
The application refers to the position where the focus is sharpest as the positive focus position, i.e. the peak position of the focus merit function. When a fixed step is used for searching, although a smaller focusing step can find the positive focal position with higher precision, a longer time is consumed, and the focusing speed is reduced. In addition, since the selected step size cannot be exactly the positive focal position, the focus motor is likely to be over-focused, resulting in the crossing of the peak position, and at this time, the reverse search should be performed according to the discrimination control condition, and so on until the positive focal position is found. In this case, a fixed step size easily causes the focus to be trapped in oscillation.
Aiming at the problem, the method adopts the peak-crossing variable-step-length control, and when reverse search is required after peak crossing is focused each time, the focusing step length is reduced according to a certain rule.
And the initial search Step length is Step, the Step length is changed into S when the peak is passed and the reverse search is carried out, the Step length is changed into S/2 when the peak is passed and the reverse search is carried out again, the steps are repeated until the Step length is smaller than a certain threshold value, and the definition of the image at the moment is determined to meet the requirement.
The step length of the driving motor of the telephoto lens used in the embodiment of the present invention is proportional to the energization time, when the initial step length is set to 100 (ms), the step length change rule is set to reduce the peak passing to 1/3 of the original value each time, and then the search step length is changed to 3.7 after three peak passing, so that the lens is considered to be in a clear area at this time, the focusing is stopped, and the schematic diagram of the obtained focusing effect is shown in fig. 3.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. The embedded telephoto lens automatic focusing system is characterized in that:
the automatic focusing system comprises a video acquisition processing module, an embedded main control module, a power supply module, a communication module, a motor driving module, a zooming motor and a focusing motor, wherein peripheral equipment comprises an input wiring terminal, an output wiring terminal and an upper computer;
the video acquisition processing module is used for acquiring analog video signals output by the embedded telephoto lens, converting the acquired analog video signals into digital video signals and outputting the digital video signals to the embedded main control module;
the embedded main control module is used for receiving the digital video signals output by the video acquisition processing module, evaluating the definition of the received digital video signals to obtain a zooming control instruction and a focusing control instruction, and finally outputting the zooming control instruction and the focusing control instruction to the motor driving module;
the motor driving module is used for receiving a zooming control instruction and a focusing control instruction output by the embedded main control module, controlling a zooming motor of the telephoto lens according to the received zooming control instruction, controlling a focusing motor of the telephoto lens according to the received focusing control instruction, enabling the definition evaluation value of the current digital video signal to be maximum, realizing automatic focusing, obtaining focusing position, zooming position and speed information, and feeding back the obtained focusing position, zooming position and speed information to the embedded main control module;
the power supply module is used for supplying power.
2. The embedded tele-based lens auto-focusing system of claim 1, wherein:
the power module adopts a 12V direct current power supply.
3. The embedded tele lens auto-focus system of claim 1 or 2, wherein:
the embedded telephoto lens based automatic focusing system further comprises a manual control module, and when the video acquisition processing module breaks down, the manual control module is used for manually outputting digital video signals to the embedded main control module.
4. The embedded tele-based lens auto-focusing system of claim 1, wherein:
the embedded main control module takes STM32F103C8T6 as a main control IC of the automatic focusing board;
the video acquisition processing module performs Sobel edge detection on the digital video signal by adopting SAA1117H and a field editable gate array chip EP2C8T144C8N in a matching way to obtain a real-time image definition index;
the power module adopts a low-power consumption DCDC voltage reduction chip and an LDO;
the communication module is provided with an RS485 communication circuit and an RS232 communication circuit;
the motor driving module adopts a double H-bridge driver chip;
the manual control module is composed of a triode and an MOS tube.
5. An embedded telephoto lens based automatic focusing method is characterized in that the method comprises the following steps:
firstly, a video acquisition processing module acquires an analog video signal output based on an embedded telephoto lens, converts the acquired analog video signal into a digital video signal and outputs the digital video signal to an embedded main control module;
secondly, after receiving the digital video signals output by the video acquisition processing module, the embedded main control module evaluates the definition of the received digital video signals to obtain a zooming control instruction and a focusing control instruction, and finally outputs the zooming control instruction and the focusing control instruction to the motor driving module;
thirdly, after receiving the zooming control instruction and the focusing control instruction output by the embedded main control module, the motor driving module controls a zooming motor of the telephoto lens according to the received zooming control instruction, controls a focusing motor of the telephoto lens according to the received focusing control instruction, maximizes the definition evaluation value of the current digital video signal, realizes automatic focusing, obtains focusing position, zooming position and speed information, and feeds back the obtained focusing position, zooming position and speed information to the embedded main control module;
fourthly, after receiving the focusing position, the zooming position and the speed information fed back by the motor driving module, the embedded main control module outputs the focusing position, the zooming position and the speed information to the upper computer through the communication module in real time;
the embedded telephoto lens automatic focusing system further comprises a manual control module, and when the video acquisition processing module breaks down, the manual control module manually outputs digital video signals to the embedded main control module.
6. The embedded tele lens-based auto-focusing method of claim 5, wherein:
in the second step, the specific method for evaluating the definition of the received digital video signal to obtain the zoom control command and the focus control command comprises the following steps: and the position of the telephoto lens is in an effective range, the direction of the telephoto lens in the effective range is adjusted, the telephoto lens moves towards the direction of increasing the definition evaluation value of the digital video signal until the maximum value of the definition evaluation value of the digital video signal is searched, and the step length of the telephoto lens is adjusted to improve the focusing speed in the moving process.
7. The embedded tele-based lens auto-focusing method of claim 6, wherein:
in the second step, when searching the maximum value of the sharpness evaluation value of the digital video signal, an automatic focusing strategy of over-peak variable step control and fast search is adopted, and the specific method comprises the following steps:
step S1: the telephoto lens carries out self-checking, records the minimum and maximum positions of the potentiometer value of the focusing motor, and obtains the relation between the increase and decrease of the potentiometer and the motor steering;
step S2: acquiring an initial position of the telephoto lens, setting the definition at the initial position as an initial value, and determining an initial traversal step length;
and step S3: selecting an initial moving direction of a focusing motor according to the initial position of the telephoto lens, and moving along the initial direction according to the initial traversal step length determined in the step S2;
and step S4: acquiring a definition value of a current digital video signal in real time during movement, calculating a current focusing evaluation function, determining the correct direction of the movement of the motor according to the magnitude relation between the current definition value and an initial value, if the acquired and analyzed definition value is in a unimodal shape, increasing and then decreasing, indicating that the direction is correct, and comparing the focusing evaluation functions of all traversal positions to acquire a peak position; if the definition value is in a monotone decreasing shape and the correct direction is reverse, changing the direction of the motor until the definition value is in a unimodal shape, increasing first and then decreasing, and stopping to obtain the position of a peak value;
s5, taking the positive and negative intervals of the peak position obtained in the step S4 as a next round of search interval, changing the step length into 1/2 of the original step length when the peak is over searched in the reverse direction, and calculating the focus evaluation function traversing each position;
and S6, repeating S3-S4 until the step length is smaller than the set threshold value, determining that the definition of the digital video signal at the moment meets the requirement, finishing focusing and finishing the search of the maximum value of the definition evaluation value of the digital video signal.
8. The embedded tele-based lens auto-focusing method of claim 7, wherein:
in the step S2, the initial traversal step length is less than the width of the maximum peak value of the focusing evaluation function and cannot exceed the focusing surface;
the initial moving direction in the step S3 depends on the relative positions of the initial position and the minimum and maximum positions of the focus motor potentiometer value recorded in the step S1, and if the distance from the maximum position end is close, the initial moving direction selects the potentiometer value increasing direction; when the distance from the minimum position end is close, the initial moving direction potential selection value decreases.
9. The embedded tele-based lens auto-focusing method of claim 7, wherein:
in step S4, the focus evaluation function adopts a DCT transform method based on an image frequency domain, and for an N × N pixel block, a calculation formula of two-dimensional discrete cosine transform is as follows:
Figure QLYQS_1
wherein F (i, j) represents the gray level of the original digital video signal at the (i, j) point, F (u, v) represents the DCT transformed value, c (u) represents a compensation coefficient, such that the DCT transform matrix is an orthogonal matrix, and is equal to the orthogonal matrix if and only if u is 0
Figure QLYQS_2
The remaining values are 1.
10. The embedded tele-based lens auto-focusing method of claim 7, wherein:
in step S6, the threshold is set to have a magnitude related to the motor accuracy, and both are of the same order of magnitude.
CN202211368811.8A 2022-11-03 2022-11-03 Embedded-based telephoto lens automatic focusing system and method Pending CN115980965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211368811.8A CN115980965A (en) 2022-11-03 2022-11-03 Embedded-based telephoto lens automatic focusing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211368811.8A CN115980965A (en) 2022-11-03 2022-11-03 Embedded-based telephoto lens automatic focusing system and method

Publications (1)

Publication Number Publication Date
CN115980965A true CN115980965A (en) 2023-04-18

Family

ID=85963614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211368811.8A Pending CN115980965A (en) 2022-11-03 2022-11-03 Embedded-based telephoto lens automatic focusing system and method

Country Status (1)

Country Link
CN (1) CN115980965A (en)

Similar Documents

Publication Publication Date Title
CN107529011B (en) A kind of motorized zoom lens control method
CN105527778A (en) Automatic focusing method for electric adjustable liquid lens
US8284261B2 (en) External ranging image pickup apparatus and ranging method
CN104730677B (en) Uncooled infrared camera continuous vari-focus and fast automatic focusing circuit and method
US20110304749A1 (en) Image pickup apparatus and method for controlling image pickup apparatus
CN103945133B (en) Auto-focus device and method for visible light lens
CN108156371B (en) Infrared automatic focusing fast searching method
US10534164B2 (en) Digital microscope and focusing method thereof
US8861948B2 (en) Image pickup apparatus
US7783184B2 (en) Optical zoom tracking apparatus and method, and computer-readable recording medium for performing the optical zoom tracking method
CN103529543A (en) Automatic microscope focusing method
CN105430277A (en) Automatic focusing control method and device
US5061954A (en) Automatic focus adjustment system
CN105430280A (en) Double-field thermal imager and automatic focusing method thereof
Kuo et al. Improved auto-focus search algorithms for CMOS image-sensing module
CN117319787A (en) Image focusing method, device, system, control equipment and storage medium
CN105785561A (en) Digital microscope and focusing method thereof
CN107295245A (en) The evenness adjusting methods of sensitive chip plate
CN105530429B (en) A kind of autofocus and system
US8417107B2 (en) Image pickup apparatus and lens position adjustment method
CN103529544A (en) Nano membrane thickness measuring instrument capable of automatically positioning and focusing
CN115980965A (en) Embedded-based telephoto lens automatic focusing system and method
CN112153271B (en) Control method and control device for optical lens of electronic equipment and storage medium
CN117170081A (en) Automatic focusing method based on image definition identification
JPH11331828A (en) Automatic tracking device

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