CN112817118B - Infrared automatic focusing fast searching method - Google Patents

Infrared automatic focusing fast searching method Download PDF

Info

Publication number
CN112817118B
CN112817118B CN202110061889.4A CN202110061889A CN112817118B CN 112817118 B CN112817118 B CN 112817118B CN 202110061889 A CN202110061889 A CN 202110061889A CN 112817118 B CN112817118 B CN 112817118B
Authority
CN
China
Prior art keywords
focusing
image
basic
calculating
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110061889.4A
Other languages
Chinese (zh)
Other versions
CN112817118A (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.)
Shanghai Institute of Technical Physics of CAS
Original Assignee
Shanghai Institute of Technical Physics of CAS
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 Shanghai Institute of Technical Physics of CAS filed Critical Shanghai Institute of Technical Physics of CAS
Priority to CN202110061889.4A priority Critical patent/CN112817118B/en
Publication of CN112817118A publication Critical patent/CN112817118A/en
Application granted granted Critical
Publication of CN112817118B publication Critical patent/CN112817118B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • G02B7/36Systems for automatic generation of focusing signals using image sharpness techniques, e.g. image processing techniques for generating autofocus signals
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • G02B7/36Systems for automatic generation of focusing signals using image sharpness techniques, e.g. image processing techniques for generating autofocus signals
    • G02B7/38Systems for automatic generation of focusing signals using image sharpness techniques, e.g. image processing techniques for generating autofocus signals measured at different points on the optical axis, e.g. focussing on two or more planes and comparing image data

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Optics & Photonics (AREA)
  • Automatic Focus Adjustment (AREA)
  • Focusing (AREA)

Abstract

The invention discloses an infrared automatic focusing fast searching method. The searching algorithm adopts a hill climbing method with variable step length, the accuracy of definition evaluation is ensured by a method of solving the definition of an image for multiple times and taking the number of digits, the instability in the focusing process is reduced by the hill climbing method with momentum and acceleration in the rough focusing stage, and the number of steps required in the rough focusing process is reduced. The method effectively solves the problems of inaccurate image definition calculation, high automatic focusing failure rate and low focusing speed of the traditional automatic focusing algorithm on the infrared telescope, and realizes quick and accurate automatic focusing on the infrared telescope.

Description

Infrared automatic focusing fast searching method
Technical Field
The invention belongs to the technical field of infrared detection imaging, and particularly relates to an infrared automatic focusing fast searching method which is suitable for the field of target detection and tracking.
Background
With the further development of economy and science and technology, the requirements on the infrared detection technology are continuously improved, the focal length of the infrared telescope is continuously increased, the aperture is continuously enlarged, the imaging quality and the detection and tracking capabilities of a target are also continuously improved, and the problems that the focusing range is widened, the depth of field is shortened, and the blur caused by defocusing is more severe are solved. The detection system detects and tracks the target successfully on the premise that a clear target image is obtained, the relative position and the relative distance between the target and the detection system may be constantly changed in the process of tracking the target, and if effective focusing operation is not performed, the target imaged by the detection system may be severely blurred, so that the tracking system cannot work normally or even loses the target. In order to obtain a clear infrared image in time, an automatic focusing algorithm is very important, and a rapid and effective automatic focusing algorithm can judge the out-of-focus condition of a lens in a short time and rapidly send a focusing instruction to complete a focusing task.
The method adopts a hill climbing method with variable step length, ensures the accuracy of definition evaluation by using a method of solving the definition of an image for multiple times and taking the number of digits of the image, reduces the instability in the focusing process by using the hill climbing method with momentum and acceleration, and reduces the steps required in the rough focusing process. The algorithm is applied to an actual medium wave infrared telescope system, and experimental results show that the focusing steps required by the algorithm in a coarse focusing stage are reduced by 12.8% compared with those required by a traditional hill climbing method, and the requirement of the infrared telescope system is met.
Disclosure of Invention
An automatic focusing algorithm with variable step length for an infrared telescope is characterized by comprising the following steps:
1. initialization momentum m1=0,m2When the acceleration a is 0 and the focusing motor step direction d is randomly selected to be a forward direction or a reverse direction, and the image definition value f before the first focusing is calculated according to the formula (1)0
Figure BDA0002903004030000021
Where S (I, j) represents a convolution of the pixel at (I, j) in the image I and the Sobel operator, the expression is expression (2), expression (3) is the Sobel operator in the horizontal direction (left) and the vertical direction (right), and t represents the number of times of focusing.
Figure BDA0002903004030000022
Figure BDA0002903004030000023
Setting the basic step length of automatic focusing to sbasicAnd performing primary focusing. Calculating an image definition value every time, namely calculating K times of continuously acquiring images continuously, calculating a Tenengrad function value of the acquired images, and finally taking the median of the K values as a final image definition value, wherein K is more stable and longer in consumed time according to the calculation power of a calculation platform, and generally taking K as 5;
2. calculating the image definition f after the first focusing1
3. Comparing the sharpness values of the two images, if f1<f0To explain the focusing methodIf the direction is wrong, setting the focusing direction d as reverse;
4. calculating the momentum m of the image definition change after the first focusing according to the formula (4)1
Figure BDA0002903004030000024
Wherein f istThe image definition value after focusing at the time t, wherein t represents the focusing times.
5. In steps sbasicFocusing for the 2 nd time in the direction d;
6. calculating an image sharpness value ftIf f ist<ft-1Go directly to step 9 for fine focusing. Otherwise, calculating the momentum m of the image definition change after the t-th focusing according to the formulas (4), (5) and (6)tAcceleration a and focusing step s, noting that s has a limit if s<0 is set to 0, if s > sbasicThen, it is set to 2sbasic
a=mt-mt-1 (5)
s=sbasic+α·mt+β·a(0<s<2sbasic) (6)
7. Focusing in the step length s and the focusing direction d;
8. performing calculation state transition according to the formula (7), and turning to the step 6;
Figure BDA0002903004030000031
9. setting the stepping direction d to be reverse;
10. in steps sshortFocusing in the direction d, sshortFor fine focusing step, it can be generally set as the basic focusing step
Figure BDA0002903004030000032
Judging whether the image clarity value is smaller than the last image clarity value, i.e. ft<ft-1If the difference is less than the preset value, the automatic focusing is finished, otherwise, the automatic focusing is finishedAnd repeating the step 10.
Drawings
FIG. 1 is a flow chart of the step-variable auto-focusing algorithm for the infrared telescope.
Fig. 2 is a simplified illustration of the respective parameters during focusing.
Detailed Description
The invention is described in detail below with reference to the following figures and examples:
1. calculating image sharpness
The TenenGrad function value uses Sobel operators to calculate the gradient values in the horizontal and vertical directions, and the gradient of the image edge is amplified using a squaring operation. The evaluation function f (i) is defined as the sum of the squares of the gradients, T is introduced to adjust the sensitivity of the evaluation function, and the expression is formula (1).
2. Automatic search algorithm
Initiating momentum m1=0,m2When the acceleration a is 0, the step direction d of the focusing motor is randomly selected to be a forward direction or a reverse direction, and the image definition value f before the first focusing is calculated0Setting the base step length of auto-focusing as s as shown in equation (1)basicAnd performing primary focusing. Calculating the image definition value each time, namely calculating K times of continuously acquiring images continuously, calculating a Tenengrad function value of the acquired images, and finally taking the median of the K values as a final image definition value, wherein the larger the K value is, the more stable the K value is, the longer the K value is, but the longer the consumed time is, and generally the K is equal to 5.
Calculating the definition f of the image after the first focusing1
Comparing the two image definition values, if f1<f0If the focusing direction is wrong, setting the focusing direction d as reverse;
fourthly, calculating the momentum m of the image definition change after the first focusing according to the formula (4)1
Wherein ftThe image definition value after focusing at the time t, wherein t represents the focusing times.
By step size sbasicFocusing for the 2 nd time in the direction d;
seventhly, calculating the image definition value ftIf f ist<ft-1Go directly to step 9 for fine focusing. Otherwise, calculating the momentum m of the image definition change after the t-th focusing according to the formulas (4), (5) and (6)tAcceleration a and focusing step s, noting that s has a limit if s<0 is set to 0, if s > sbasicThen, it is set to 2sbasic
Focusing according to the step length s and the focusing direction d;
ninthly, calculating state transition according to the formula (7), and turning to the step 6;
the direction of step d is set to reverse in the R;
in steps sshortFocusing in the direction d, sshortFor fine focusing step, it can be generally set as the basic focusing step
Figure BDA0002903004030000051
Judging whether the image clarity value is smaller than the last image clarity value, i.e. ft<ft-1If so, the automatic focusing is finished, otherwise, the step 10 is repeated.

Claims (1)

1. An infrared automatic focusing fast searching method is characterized by comprising the following steps:
1) initialization momentum m1=0,m2When the acceleration a is 0 and the focusing motor step direction d is randomly selected to be a forward direction or a reverse direction, and the image definition value f before the first focusing is calculated according to the formula (1)0
Figure FDA0003253468950000011
Wherein S (I, j) represents a convolution of a pixel at (I, j) in the image I and the Sobel operator, the expression is formula (2), formula (3) is the Sobel operator in the horizontal direction (left) and the vertical direction (right), and t represents the number of times of focusing;
Figure FDA0003253468950000012
Figure FDA0003253468950000013
setting the basic step length of automatic focusing to sbasicPerforming first focusing, calculating an image definition value each time, namely continuously acquiring K times by calculation, calculating a Tenengrad function value of the acquired image, and finally taking the median of the K values as a final image definition value, wherein K is more stable and longer in consumed time according to the calculation power of a calculation platform, and K is 5;
2) calculating the image definition f after the first focusing1
3) Comparing the sharpness values of the two images, if f1<f0If the focusing direction is wrong, setting the focusing direction d as reverse;
4) calculating the momentum of the change of the image definition after the first focusing according to the formula (4);
Figure FDA0003253468950000014
wherein f istThe image definition value after focusing at the time t, wherein t represents the focusing times;
5) in steps sbasicFocusing for the 2 nd time in the direction d;
6) calculating an image sharpness value ftIf f ist<ft-1Directly turning to the step 9 to carry out fine focusing, otherwise, calculating the momentum m of the image definition change after the t-th focusing according to the formulas (4), (5) and (6)tAcceleration a and focusing step length s, if s<0 is set to 0, if s > sbasicThen, it is set to 2sbasic
a=mt-mt-1 (5)
s=sbasic+α·mt+β·a (0<s<2sbasic) (6)
7) Focusing in the step length s and the focusing direction d;
8) performing calculation state transition according to the formula (7), and turning to the step 6;
Figure FDA0003253468950000021
9) setting the stepping direction d to be reverse;
10) in steps sshortFocusing in the direction d, sshortFor fine focusing step, set as basic focusing step
Figure FDA0003253468950000022
Judging whether the image clarity value is smaller than the last image clarity value, i.e. ft<ft-1If so, the autofocus ends, otherwise, step 10) is repeated.
CN202110061889.4A 2021-01-18 2021-01-18 Infrared automatic focusing fast searching method Active CN112817118B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110061889.4A CN112817118B (en) 2021-01-18 2021-01-18 Infrared automatic focusing fast searching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110061889.4A CN112817118B (en) 2021-01-18 2021-01-18 Infrared automatic focusing fast searching method

Publications (2)

Publication Number Publication Date
CN112817118A CN112817118A (en) 2021-05-18
CN112817118B true CN112817118B (en) 2021-12-31

Family

ID=75869933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110061889.4A Active CN112817118B (en) 2021-01-18 2021-01-18 Infrared automatic focusing fast searching method

Country Status (1)

Country Link
CN (1) CN112817118B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7110035B1 (en) * 1999-05-25 2006-09-19 Flir Systems Ab Device and a method for an infrared image analyzing autofocus
CN104459940A (en) * 2013-09-25 2015-03-25 北京环境特性研究所 Quick self-adaptation automatic focusing method
CN108073783A (en) * 2017-12-06 2018-05-25 中国科学院上海技术物理研究所 A kind of self-adapting intelligent optics load implementation method based on measurement data
CN108156371A (en) * 2017-12-08 2018-06-12 北京航天计量测试技术研究所 A kind of infrared auto-focusing method for fast searching
CN109739011A (en) * 2019-03-18 2019-05-10 上海大学 A kind of Atomatic focusing method based on improvement climbing method
CN109839714A (en) * 2017-11-28 2019-06-04 中国航空工业集团公司洛阳电光设备研究所 A kind of fast automatic focusing method and device suitable for infrared system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104853087B (en) * 2015-03-16 2017-12-15 浙江宇视科技有限公司 A kind of identification of spot light scene and focus method
CN110754080B (en) * 2018-07-27 2021-10-15 深圳市大疆创新科技有限公司 Image acquisition method, imaging device and shooting system
CN110519514B (en) * 2019-08-28 2020-06-26 中国科学院长春光学精密机械与物理研究所 Automatic focusing algorithm for astronomical telescope

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7110035B1 (en) * 1999-05-25 2006-09-19 Flir Systems Ab Device and a method for an infrared image analyzing autofocus
CN104459940A (en) * 2013-09-25 2015-03-25 北京环境特性研究所 Quick self-adaptation automatic focusing method
CN109839714A (en) * 2017-11-28 2019-06-04 中国航空工业集团公司洛阳电光设备研究所 A kind of fast automatic focusing method and device suitable for infrared system
CN108073783A (en) * 2017-12-06 2018-05-25 中国科学院上海技术物理研究所 A kind of self-adapting intelligent optics load implementation method based on measurement data
CN108156371A (en) * 2017-12-08 2018-06-12 北京航天计量测试技术研究所 A kind of infrared auto-focusing method for fast searching
CN109739011A (en) * 2019-03-18 2019-05-10 上海大学 A kind of Atomatic focusing method based on improvement climbing method

Also Published As

Publication number Publication date
CN112817118A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
US8218061B2 (en) Apparatus, method, and manufacture for iterative auto-focus using depth-from-defocus
US9313419B2 (en) Image processing apparatus and image pickup apparatus where image processing is applied using an acquired depth map
US20070189750A1 (en) Method of and apparatus for simultaneously capturing and generating multiple blurred images
CN112203012B (en) Image definition calculation method, automatic focusing method and system
CN108345085A (en) Focus method and focusing system
CN110519514B (en) Automatic focusing algorithm for astronomical telescope
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
CN101950116B (en) Video automatic focusing method applied to multi-main-body scene
CN105049723A (en) Auto-focusing method based on defocus distance difference qualitative analysis
CN101852970B (en) Automatic focusing method for camera under imaging viewing field scanning state
US11347133B2 (en) Image capturing apparatus, image processing apparatus, control method, and storage medium
CN105184784A (en) Motion information-based method for monocular camera to acquire depth information
CN107509023A (en) A kind of auto-focusing searching algorithm
CN106973199B (en) Multi-aperture camera system for improving depth accuracy by using focusing distance scanning
CN112817118B (en) Infrared automatic focusing fast searching method
Hao et al. Improving the performances of autofocus based on adaptive retina-like sampling model
CN100559255C (en) The image capture unit of automatic focusing method and use said method
CN109889728B (en) Moving target real-time automatic focusing method based on electro-hydraulic adjustable focusing lens
CN114785953B (en) SFR-based camera automatic focusing method and device
CN113838150B (en) Moving target three-dimensional track tracking method based on electrohydraulic adjustable focus lens
CN106556958A (en) The auto focusing method of Range-gated Imager
CN114384681A (en) Rapid and accurate automatic focusing method and system for microscope, computer equipment and medium
CN115576092A (en) Intelligent automatic focusing method and device for optical microscope and storage equipment
KR102422125B1 (en) Auto focusing method
JPH0252204A (en) Measuring instrument for three-dimensional coordinate

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