Volume 52 Issue 1
Jan.  2023
Turn off MathJax
Article Contents

Pan Hongliang, Sun Jinxia, Han Xizhen. Image sharpness evaluation and variable-step fusion focusing method[J]. Infrared and Laser Engineering, 2023, 52(1): 20220342. doi: 10.3788/IRLA20220342
Citation: Pan Hongliang, Sun Jinxia, Han Xizhen. Image sharpness evaluation and variable-step fusion focusing method[J]. Infrared and Laser Engineering, 2023, 52(1): 20220342. doi: 10.3788/IRLA20220342

Image sharpness evaluation and variable-step fusion focusing method

doi: 10.3788/IRLA20220342
  • Received Date: 2022-05-18
  • Rev Recd Date: 2022-09-08
  • Publish Date: 2023-01-18
  • The imaging of the cross wire target on the CCD is generally affected by the ambient light and the optical path. The cross wire image generated by the focal length of different positions will be blurred and out of focus, and the extraction of the center point of the cross wire target will be seriously affected. The traditional Sobel algorithm ignores the edge information and is easily affected by noise. Therefore, a two-stage fast search auto focusing method with variable-step size is proposed, which improves the image sharpness evaluation function of Sobel operator and combines the coarse and fine focusing. The method first evaluates the image sharpness by using the spatial domain of the image, and then selects the two-stage focusing mode according to the optical design. The first step is coarse adjustment. When the focus position is quickly found, fine adjustment is performed until the focus position is found. Experimental results show that compared with other algorithms, the auto focusing failure rate is 2%, the focusing time is 1242 ms, and the focusing stroke is −25-30 mm. The combination of the image sharpness evaluation function and the two-stage focusing mode through this algorithm has high accuracy and good real-time performance.
  • [1] Fan Junjie, Li Fuqiang, Cai Weijun, et al. Design of focusing mechanism for long array focal plane with heavy load [J]. Infrared and Laser Engineering, 2021, 50(11): 20210270. (in Chinese) doi:  10.3788/IRLA20210270
    [2] Zhou Enyuan, Cao Yueqin, Shi Jianping, et al. Design of compact dual-field lens for visible light [J]. Infrared and Laser Engineering, 2021, 50(8): 20210042. (in Chinese) doi:  10.3788/IRLA20210042
    [3] Guan Wenlu, Tan Fengfu, Jing Xu, et al. Automatic focusing of cassegrain telescope based on environmental temperature feedback [J]. Optics and Precision Engineering, 2021, 29(8): 1832-1838. (in Chinese) doi:  10.37188/OPE.20212908.1832
    [4] Lan Tiancheng, Lan Ronghua, Chen Xiaoxi, et al. Research on liquid crystal lens hill climbing autofocus algorithm [J]. Acta Optica Sinica, 2020, 40(14): 1411003. (in Chinese) doi:  10.3788/AOS202040.1411003
    [5] Mo Chunhong, Liu Bo, Ding Lu, et al. A gradient threshold auto-focus algorithm [J]. Infrared and Laser Engineering, 2014, 43(1): 323-327. (in Chinese) doi:  10.3969/j.issn.1007-2276.2014.01.057
    [6] Hong Yuzhen, Ren Guoqiang, Sun Jian. Analysis and improvement on sharpness evaluation function of defocused image [J]. Optics and Precision Engineering, 2014, 22(12): 3401-3408. (in Chinese) doi:  10.3788/OPE.20142212.3401
    [7] Zou Yutong, Tan Yi, Luo Yihan. Research on image clarity evaluation function based on improved Sobel operator in focusing system [J]. Electronic Design Engineering, 2022, 30(7): 150-155. (in Chinese) doi:  10.14022/j.issn1674-6236.2022.07.031
    [8] Ding Guoshen, Qiao Yanli, Yi Weining, et al. Feature extraction and matching of F-SIFT based on spectral image space [J]. Optics and Precision Engineering, 2021, 29(5): 1180-1189. (in Chinese) doi:  10.37188/OPE.20212905.1180
    [9] Liu Mengchen, Pang Changtao, Hao Xue. Research of sobel operator in clarity evaluation process of film hole image [J]. Mechanical Science and Technology for Aerospace Engineering, 2020, 39(7): 1071-1076. (in Chinese) doi:  10.13433/j.cnki.1003-8728.20190223
    [10] Zhang Huaili, Li Yingchun, Zhang Tinghua. Method of variable speed control for focusing mechanism limited interval based on image definition function [J]. Journal of Applied Optics, 2021, 42(6): 969-974. (in Chinese) doi:  10.5768/JAO202142.0601004
    [11] 林兆华. 基于图像处理自动调焦技术在经纬仪中应用的研究[D]. 中国科学院研究生院(长春光学精密机械与物理研究所), 2012.

    Lin Zhaohua. Study on application of the autofocus technology based on the imaging processing in the theodolite[D]. Changchun: University of Chinese Academy of Sciences (Changchun Institute of Optics, Fine Mechanics and Physics, Chinese Academy of Sciences), 2012. (in Chinese)
    [12] Zhou R G, Liu D Q. Quantum image edge extraction based on improved sobel operator [J]. International Journal of Theoretical Physics, 2019, 58(9): 1-17.
    [13] 刘雪超. 基于数字图像处理的自动调焦技术研究[J]. 中国科学院研究生院(长春光学精密机械与物理研究所), 2014.

    Liu Xuechao. Study on auto-focusing based on digital image processing technology[D]. Changchun: University of Chinese Academy of Sciences(Changchun Institute of Optics, Fine Mechanics and Physics, Chinese Academy of Sciences), 2014. (in Chinese)
    [14] Yuan Yicong, Hao Junming. An algorithm for judging the depth of image defocusing used for infrared automatic focusing [J]. Infrared, 2021, 42(11): 33. (in Chinese)
    [15] Wu Helong, Qiu Zheng. Edge detection of SAR image method based on curvelet transformand sobel operator [J]. Ship Electronic Engineering, 2021, 41(5): 101-103, 142. (in Chinese) doi:  10.3969/j.issn.1672-9730.2021.05.023
  • 加载中
通讯作者: 陈斌, bchen63@163.com
  • 1. 

    沈阳化工大学材料科学与工程学院 沈阳 110142

  1. 本站搜索
  2. 百度学术搜索
  3. 万方数据库搜索
  4. CNKI搜索

Figures(5)  / Tables(2)

Article Metrics

Article views(256) PDF downloads(81) Cited by()

Related
Proportional views

Image sharpness evaluation and variable-step fusion focusing method

doi: 10.3788/IRLA20220342
  • 1. Research and Development Department, Changchun Jingyi Photoelectric Technology Co., Ltd., Changchun 130000, China
  • 2. Research and Development Department, Suzhou Dongfang Kloto Photoelectric Technology Co., Ltd., Suzhou 215600, China

Abstract: The imaging of the cross wire target on the CCD is generally affected by the ambient light and the optical path. The cross wire image generated by the focal length of different positions will be blurred and out of focus, and the extraction of the center point of the cross wire target will be seriously affected. The traditional Sobel algorithm ignores the edge information and is easily affected by noise. Therefore, a two-stage fast search auto focusing method with variable-step size is proposed, which improves the image sharpness evaluation function of Sobel operator and combines the coarse and fine focusing. The method first evaluates the image sharpness by using the spatial domain of the image, and then selects the two-stage focusing mode according to the optical design. The first step is coarse adjustment. When the focus position is quickly found, fine adjustment is performed until the focus position is found. Experimental results show that compared with other algorithms, the auto focusing failure rate is 2%, the focusing time is 1242 ms, and the focusing stroke is −25-30 mm. The combination of the image sharpness evaluation function and the two-stage focusing mode through this algorithm has high accuracy and good real-time performance.

    • 近年来,研究人员经常利用图像提供的丰富信息进行科研、军事、医疗等领域的探索研究,这些研究需要高质量的清晰图像,所以光学成像系统有着重要研究价值。在光学系统成像时,通常称焦点所在的最佳成像位置为正焦位置,当焦点偏离正焦位置时,就会发生离焦现象,此时系统的成像变得模糊。当离焦现象发生时,可以通过调节调焦组镜片位置来让系统完成聚焦过程[1-3]。随着智能的发展,可以利用自动调焦完成聚焦的过程[4-5]

      自20世纪80年代以来,自动调焦技术以及数字图像处理技术不断进步,将图像处理技术与自动调焦技术相结合成为重要的发展方向,该研究首先对采集到的图像进行处理,利用相关算法对图像信息进行计算,得到图像的清晰度评价值,根据图像清晰度评价函数发送指令到调焦电控装置,电控装置按照指令控制调焦机构,反复的图像处理及控制调焦运动,直到获得正焦图像为止,该过程称为自动调焦控制。基于图像处理,利用图像清晰度评价算法对调焦系统进行控制,不仅减少人为主观干扰,还能快速准确地进行调焦,找到正焦位置[6-10]

      目前,国内在利用图像处理进行自动调焦的研究上有着丰富的经验,然而大部分技术主要应用在小型设备,如相机、望远镜、显微镜等领域,在较大的检测设备上能达到精度高,速度快的调焦装置却很少,这是因为大中型设备对所需光学设计和机械控制的要求很严格,一般很难快速地自动搜索到正焦位置[11-15]。在这样的背景下,文中利用基于图像处理的图像清晰度评价算法,并根据光学设计进行调焦搜索研究。优点在于保证调焦精度前提下,利用光学设计与调焦搜索策略互相配合减少调焦时间。

    • 对调焦系统中的图像进行清晰度评价,需要客观的标准进行评价,自动调焦过程中产生的图像可分为正焦图像和离焦图像,正焦图像清晰度更高,细节信息更丰富,离焦图像会模糊,不仅对比度低,边界不清晰,且更难提取细节信息。根据图像的客观信息标准作为图像清晰度的标价依据,目前利用图像处理技术对图像进行清晰度评价算法主要包括空域评价算法、频域评价函数、信息学评价函数和统计学评价函数,如图1所示。

      Figure 1.  Classification of digital image processing sharpness evaluation algorithm

      在自动调焦过程中,清晰度评价算法是重要的一部分,理想的清晰度评价曲线如图2所示,其中顶点P1为正焦位置,PP2是离焦位置,其应具备以下优点:(1)单峰性和无偏移性,只有一个正焦位置为峰值,离峰值远近表示离焦的程度。(2)灵敏性高,由于对图像细节信息的需求以及精细调焦,需要高灵敏度才能找到最佳峰值位置。(3)鲁棒性强,由于受到自然光和其他噪声影响,清晰评价算法需要有较强的鲁棒性,才能保证调焦精度高和实时性,根据测量需要,只有较高的实时性才能满足需求。(4)通用性,由于环境以及被测目标的原因,图像质量差,清晰评价算法也要能够满足需求才能进行评价。

      Figure 2.  Ideal curve of sharpness evaluation function

      由于清晰度评价算法需要满足以上优点以及具有稳定的性能,文中将使用空间域Sobel算子梯度能量函数用于图像清晰度评价的算法进行文中的后续工作,对图像的清晰度计算结果进行电子模块指导。

    • Tenengrad 函数是由Sobel算子提取像素点水平方向和垂直方向的梯度值构成,如公式(1)、(2)所示,并为梯度设置一个阈值T调节函数的灵敏度,表达式如下:

      式中:$G(x,y)$为像素点$(x,y)$处的梯度。

      式中:${G_x}(x,y)$, 和${G_y}(x,y)$为像素点水平方向和垂直方向的梯度值,定义为公式(3)和公式(4):

      式中:f(x,y)为图像像素点;$ * $ 为卷积符号;${g_x}$${g_y}$为Sobel算子水平方向、垂直方向模板。

    • 文中改进 Sobel 算子是增加了两个方向的算子,分别是将水平方向、垂直方向模板旋转45°的模板,改进后的两个方向Sobel算子模板如公式(7)、(8)所示:

      将这4个方向的Sobel算子对图像像素点$f(x,y)$进行边缘检测,计算出梯度进行加权获得整个图像的梯度。公式如下:

      式中:${G_x}(x,y)$为水平方向的边缘梯度;${G_y}(x,y)$为垂直方向的边缘梯度;${D_1}(x,y)$${g_x}$ 旋转后的边缘梯度;${D_2}(x,y)$${g_y}$旋转后的边缘梯度;$X(x,y)$为根据公式(10)计算的图像梯度;$Y(x,y)$为根据公式(11)计算的图像梯度;$\alpha $$\beta $为梯度加权系数。

    • 在某镜面偏心测量设备测量头设计工作中,根据其光学设计以及自动调焦的时间要求,文中首先分析其光学函数变化曲线,然后根据光学变化曲线采用变步长两段式聚焦控制方式。并且采用以图像空间域梯度值作为图像清晰度的评价标准,根据图像清晰度评价结果对调焦机构进行控制,实现了研制目标。

    • 为了满足设备测量需求,设计可自动调焦的光学镜头,其光学参数如表1所示。

      ParameterValue
      Wave band/μm7-15
      Focal distance/mm20-100
      Rear intercept/mm15.41
      Incoming pupil diameter/mm20-100
      F/#1.5
      Imaging range/m0.5- +∞
      Transfer function> 0.2
      Alignment plane+∞
      Focusing rang/mm−25- +30

      Table 1.  Optical design parameters

      光路图如图3 所示,通过驱动电机的控制,调教组镜片沿着光轴方向运动,调焦行程−25-30 mm,通过变倍和补偿组的配合运动,能够成像焦距达到0.5 m-+∞。图中,1为前固定组,2为变倍组,3为补偿组,4为后固定组,5为调焦组,6为CCD窗口,7为像面。

      Figure 3.  Diagram of optical path

      从理想清晰度评价曲线和光学传递函数变化曲线中可以看出它们具有相同的变化规律,具有单峰性和峰值两侧具有单调性,并且十字丝图像需要提取十字丝中心位置,只有调焦位置最佳才能提高十字丝中心提取的准确度。为了快速找到正焦位置范围以及最佳调焦位置,文中根据光学设计分析采用粗调和精细调焦相结合的快速搜索方式,首先利用粗调方式大步长找到最佳调焦位置附近,然后利用精调方式找到最佳调焦位置,这样既保证调焦速度,又能保证调焦精度,精准找到最佳调焦位置。

    • 根据清晰度评价曲线和光学传函数递变化曲线,需要采用与之相匹配的搜索策略,为了提高搜索速度和准确度,文中采用变步长搜索策略。与传统爬山搜索方式相比,首先变步长搜索方式用大步长快速搜索到调焦目标附近,然后采用小步长精细搜索目标,防止错过目标。爬山搜索方式采用大步长搜索会错失调焦准确位置,采用小步长搜索速度不仅慢,而且在离焦状态下受到的环境噪声和光路噪声影响较大,不易聚焦。所以文中选用变步长搜索方式。具体实现步骤如下:

      (1)首先,调焦系统起始位置位于离焦点 P ,设定调焦大步长为DD>调焦精度),记录当前位置图像的调焦评价函数F

      (2)根据步骤(1)的位置P向前以步长D进行运行,获取两步的调焦函数F1、F2;

      (3)如果不满足F<F1,F1>F2, 则沿着步长D继续运行,F、F1、F2分别为最后3个位置的调焦函数;

      (4)如果满足F<F1,F1>F2,则调焦系统返回到调焦函数F的位置,以步长dD>d)向前运行,直到满足F<F1,F1>F2,返回到调焦函数F1的位置P2;

      (5) P1的位置为正调焦位置,自动调焦结束。

    • 为了验证文中4个方向Sobel算子梯度加权后的检测效果,文中在偏心测量设备上进行检测实验,使用自适应变步长两段式搜索策略与其他算法进行对比实验,归一化后图像清晰度评价曲线对比图见图4

      Figure 4.  Comparison diagram of image sharpness evaluation curve after normalization

      通过自动调焦系统,利用改进Sobel算子梯度加权的Tenengrad 评价函数与经典Sobel算子的Tenengrad 评价函数、Roberts评价函数、Laplacian评价函数、Prewitt评价函数、Canny评价函数和Log评价函数分别进行边缘检测和调焦控制,从边缘检测图像图5可以看出:文中算法进行边缘检测得到的边缘图像信息保留得最好,并在相同的离焦位置进行自动调焦,绘制出它们的图像清晰度评价函数曲线图,分别进行50次自动调焦实验,发现文中算法平均调焦时间是1 242 ms,自动调焦失败率是2%。通过绘制的图像清晰度评价函数曲线对比图和表2可知改进后的算法调焦位置更加准确,速度也更快,效果更好。

      Figure 5.  Edge detection image

      AlgorithmFocusing time/msFailure rate
      Proposed12422%
      Roberts138112%
      Laplacian141010%
      Sobel13328%
      Prewitt126610%
      Canny112012%
      Log12588%

      Table 2.  Algorithm comparison results

    • 文中提出改进的Sobel算子,并通过改进该算子进行加权方式改进Tenengrad 评价函数,首先增加边缘提取方向,然后进行加权,根据不同权重进行清晰度计算。由实验可知,改进后的评价函数准确度更高,并利用根据光学设计参数设计提出的搜索策略,变步长搜素,速度更快,精度更高。文中在电控探测方面有不足,未来将从光学设计和电控方面探索更加先进的方式,使调试结果更加精准,调焦时间更短。

Reference (15)

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return