混合搜索法在显微镜自动对焦中的应用

江旻珊, 张楠楠, 张学典, 等. 混合搜索法在显微镜自动对焦中的应用[J]. 光电工程, 2017, 44(7): 685-694. doi: 10.3969/j.issn.1003-501X.2017.07.004
引用本文: 江旻珊, 张楠楠, 张学典, 等. 混合搜索法在显微镜自动对焦中的应用[J]. 光电工程, 2017, 44(7): 685-694. doi: 10.3969/j.issn.1003-501X.2017.07.004
Minshan Jiang, Nannan Zhang, Xuedian Zhang, et al. Applications of hybrid search strategy in microscope autofocus[J]. Opto-Electronic Engineering, 2017, 44(7): 685-694. doi: 10.3969/j.issn.1003-501X.2017.07.004
Citation: Minshan Jiang, Nannan Zhang, Xuedian Zhang, et al. Applications of hybrid search strategy in microscope autofocus[J]. Opto-Electronic Engineering, 2017, 44(7): 685-694. doi: 10.3969/j.issn.1003-501X.2017.07.004

混合搜索法在显微镜自动对焦中的应用

  • 基金项目:
    国家重大科学仪器设备开发专项(2013YQ03065104)资助课题
详细信息

Applications of hybrid search strategy in microscope autofocus

  • Fund Project:
More Information
  • 针对基于显微镜的自动对焦系统,本文提出了一种爬山搜索法和函数逼近法相结合的混合搜索算法。该算法中的爬山搜索法采用粗精结合的两段式算法。在粗略对焦时,大步距选用速度较快的灰度方差函数;当精细对焦时,小步距采用灵敏度较高的Laplacian函数;通过比较三幅图片来缩小对焦区间并且在该区间内采用函数逼近法来拟合出最佳对焦位置。该方法不仅大大减少了自动对焦所需要的图片数量,而且可以大幅度提高搜索精度。经实验验证,提出的新的搜索算法可以使搜索精度优于1 μm。

  • Abstract: Auto-focusing is one of the key technologies in the area of robot vision, digital imaging systems and precision optical instrument. With the continuous development of science and technology and improved application demands, it is more and more urgent to develop an auto-focusing with high precision, fast speed and good stability. While the existing auto-focusing techniques can’t meet the above requirements, a further study on auto-focusing makes a very important practical significance. The depth from defocus method and the depth from focus method are two typical passive auto-focusing methods of autofocus method based on digital image processing. The depth from defocus method is popularly used in depth estimation and scene reconstruction, which can measure the position of samples by just a few images. Therefore, the efficiency of the method is high. However, the accuracy of the depth from defocus method is relatively low because the small number of images is collected by the method. The depth from focus methods are based on the fact that the image formed by an optical system is focused at a particular distance whereas objects at other distances are blurred or defocused. Very high accuracy can be achieved by depth from focus methods. In order to achieve efficient autofocusing, several commonly used search algorithms are studied, and a new low-computational search algorithm is presented, which combines the mountain-climb search strategy with the approximation function strategy to realize the hybrid search algorithm accurate and efficient autofocus. In this algorithm, the mountain-climb search strategy adopts the two-stage algorithm of rough and fine focusing stage. In the rough focusing stage, the large step distance takes into account the fastness of the algorithm, and the gray variance function is used to approach the focusing position quickly. In the fine focusing stage, the small step distance takes into account the sensitivity of the algorithm and the Laplacian function is used to locate the focusing position accurately. The algorithm narrows the focus interval by comparing three pictures and in the range uses the approximation function strategy to fit the best focus position. This method makes greatly improve the search accuracy. The experimental results indicate that this the algorithm can make the search accuracy better than 1 μm. And the method only needs to capture 17 pictures, reducing the number of image acquisition and evaluation. As a result, the time of the autofocus system is shortened and the search efficiency of the algorithm is improved.

  • 加载中
  • 图 1  爬山搜索算法示意图.

    Figure 1.  Mountain climbing search algorithm.

    图 2  Laplacian对焦评价函数曲线及全局对焦范围内的3次拟合示意图.

    Figure 2.  Laplacian focus evaluation function curve and the global focus within the scope of 3 times fit diagram.

    图 3  极值点附近小范围内的3次拟合示意图.

    Figure 3.  Extreme point near the small range of 3 times fit diagram.

    图 4  对焦过程流程图.

    Figure 4.  Flow chart of focusing process.

    图 5  显微镜自动对焦系统示意图.

    Figure 5.  Microscope autofocus system.

    图 6  两种不同样品及其图像. (a)电路板. (b)对焦图像. (c)离焦图像. (d)南瓜茎纵切标本. (e)对焦图像. (f)离焦图像.

    Figure 6.  Two different samples and their images. (a) The PCB circuit board. (b) The focus image of PCB. (c) The defocus image of PCB. (d) The longitudinal specimens of pumpkin stem. (e) The focus image of longitudinal specimens of pumpkin stem. (f) The focus image of longitudinal specimens of pumpkin stem.

    图 7  粗略对焦时的搜索过程. (a) PCB板搜索过程. (b)标本搜索过程.

    Figure 7.  The search process of rough focusing stage. (a) The search process of PCB. (b) The search process of longitudinal specimens of pumpkin stem.

    图 8  精细对焦时的搜索过程. (a) PCB板搜索过程. (b)标本搜索过程.

    Figure 8.  The search process of fine focusing stage. (a) The search process of PCB. (b) The search process of longitudinal specimens of pumpkin stem.

    图 9  PCB电路板曲线拟合的过程示意图. (a1)~ (a3)极值点附近区域曲线拟合. (b1)~ (b3)解析求出极值点.

    Figure 9.  The curve fitting process diagram of PCB circuit board. (a1)~ (a3) Curve fitting near the extreme point. (b1)~ (b3) Analysis the extreme points.

    图 10  南瓜茎纵切标本曲线拟合的过程示意图. (a1)~(a3)极值点附近区域曲线拟合. (b1)~ (b3)解析求出极值点.

    Figure 10.  The curve fitting process diagram of pumpkin stem longitudinal specimens. (a1)~ (a3) Curve fitting near the extreme point. (b1)~ (b3) Analysis the extreme points.

    表 1  PCB粗略对焦时采用灰度方差函数得到的清晰度评价函数值.

    Table 1.  The value of the sharpness evaluation function obtained by gray variance function in the rough focusing stage of PCB.

    图片数量12345678910
    镜头位置/μm-200-160-120-80-4004080120160
    实验一39.45540.78242.12343.58945.33246.77643.86641.45540.48139.246
    实验二39.05440.12041.42842.83944.44846.47745.68242.04841.04339.847
    实验三39.25340.38341.89243.13245.00246.57243.46541.14340.21839.198
    下载: 导出CSV

    表 2  南瓜茎纵切标本粗略对焦时采用灰度方差函数得到的清晰度评价函数值.

    Table 2.  The value of the sharpness evaluation function obtained by gray variance function in the rough focusing stage of the longitudinal specimens of pumpkin stem.

    图片数量12345678910
    镜头位置/μm-200-160-120-80-4004080120160
    实验一16.8816.89517.29817.89819.11419.48618.21417.65117.32317.273
    实验二16.88216.90617.19117.74718.72719.72918.44517.79417.46717.277
    实验三16.88316.90717.18717.74418.69219.72318.44617.79617.48817.231
    下载: 导出CSV

    表 3  PCB精细对焦时采用Laplacian函数得到的清晰度评价函数值.

    Table 3.  The value of the sharpness evaluation function obtained by Laplacian function in the fine focusing stage of PCB.

    图片数量111213141516
    镜头位置/μm27141-12-25-38
    实验一12127.2161811686316760135759763.1
    实验二10105168831791015755116367899.2
    实验三9602.1145851786816300129258063.9
    下载: 导出CSV

    表 4  南瓜茎纵切标本精细对焦时采用Laplacian函数得到的清晰度评价函数值.

    Table 4.  The value of the sharpness evaluation function obtained by Laplacian function in the fine focusing stage of the longitudinal specimens of pumpkin stem.

    图片数量111213141516
    镜头位置/μm27141-12-25-38
    实验一306523986542824377562767325517
    实验二266763513742553390143323326619
    实验三311563886142372376462807326095
    下载: 导出CSV

    表 5  PCB曲线拟合阶段采用Laplacian函数得到的清晰度评价函数值.

    Table 5.  The value of the sharpness evaluation function obtained by Laplacian function in the curve fitting stage of PCB.

    图片数量171819202122
    镜头位置/μm-8-404812
    实验一156821632916813174901767017311
    实验二167151796318111179151721017188
    实验三167591683317869175341752414821
    下载: 导出CSV

    表 7  用爬山搜索法继续采集7幅PCB电路板图像的清晰度评价函数值.

    Table 7.  The evaluation function values of the seven PCB circuit board images collected by the mountain climbing method.

    图片数量23242526272829
    镜头位置/μm111098765
    实验一17416175771764117670176751759317504
    图片数量23242526272829
    镜头位置/μm3210-1-2-3
    实验二17947180201823218111180791804318006
    实验三17624177761786817869177921763316848
    下载: 导出CSV

    表 8  南瓜茎纵切标本曲线拟合阶段采用Laplacian函数得到的清晰度评价函数值.

    Table 8.  The value of the sharpness evaluation function obtained by Laplacian function in the curve fitting stage of the longitudinal specimens of pumpkin stem.

    图片数量171819202122
    镜头位置/μm-8-404812
    实验一366743782342724410144088240046
    实验二400784110342779422644018939379
    实验三383323863843099417254062239075
    下载: 导出CSV

    表 9  用爬山搜索法继续采集7幅标本图像的清晰度评价函数值.

    Table 9.  The evaluation function values of the seven specimen images collected by the mountain climbing method.

    图片数量23242526272829
    镜头位置/μm3210-1-2-3
    实验一40599428364298742724390513877538250
    实验二42264424444255342779426414249941776
    实验三41805423724336043099398183945239039
    下载: 导出CSV

    表 10  传统爬山搜索法和混合搜索法的比较.

    Table 10.  Comparison between the traditional mountain-climb search strategy with the proposed hybrid search strategy.

    对焦过程传统的爬山搜索法混合搜索法
    采集图像2317
    改变方向次数43
    总时间/s4.3982.587
    下载: 导出CSV
  • [1]

    Yazdanfar S, Kenny K B, Tasimi K, et al. Simple and robust image-based autofocusing for digital microscopy[J]. Optics Express, 2008, 16(12): 8670–8677. doi: 10.1364/OE.16.008670

    [2]

    Han J W, Kim J H, Lee H T, et al. A novel training based au-to-focus for mobile-phone cameras[J]. IEEE Transactions on Consumer Electronics, 2011, 57(1): 232–238. doi: 10.1109/TCE.2011.5735507

    [3]

    Park B K, Kim S S, Chung D S, et al. Fast and accurate auto focusing algorithm based on two defocused images using discrete cosine transform[J]. Proceedings of SPIE, 2008, 6817: 68170D. https://www.researchgate.net/publication/252969631_Fast_and_accurate_auto_focusing_algorithm_based_on_two_defocused_images_using_discrete_cosine_transform

    [4]

    Subbarao M, Surya G. Depth from defocus: a spatial domain approach[J]. International Journal of Computer Vision, 1994, 13(3): 271–294. doi: 10.1007/BF02028349

    [5]

    黄德天. 基于图像技术的自动调焦方法研究[D]. 长春: 中国科学院大学(长春光学精密机械与物理研究所), 2013: 15–20.

    Huang Detian. Study on auto-focusing method using image technology[D]. Changchun: Changchun Institute of Optics, Fine Mechanics and Physics, Chinese Academy of Sciences, 2013: 15–20.http://cdmd.cnki.com.cn/Article/CDMD-80139-1013293679.htm

    [6]

    Subbarao M, Choi T S, Nikzad A. Focusing techniques[J]. Optical Engineering, 1993, 32(11): 2824–2836. doi: 10.1117/12.147706

    [7]

    Marrugo A G, Millán M S, Abril H C. Implementation of an image based focusing algorithm for non-mydriatic retinal imaging[C]. Proceedings of the 2014 Ⅲ International Congress of Engineering Mechatronics and Automation, 2014: 1–3.

    [8]

    彭娟. 基本恒定类表面模型及操作算子的研究[D]. 桂林: 桂林电子科技大学, 2010: 11–20.http://cdmd.cnki.com.cn/Article/CDMD-10595-1011256227.htm

    [9]

    赵志彬, 刘晶红.基于图像处理的航空成像设备自动调焦设计[J].液晶与显示, 2010, 25(6): 863–868. http://www.cqvip.com/QK/97614A/201006/36601979.html

    Zhao Zhibin, Liu Jinghong. Auto-focusing method for airborne image equipment based on image processing[J]. Chinese Journal of Liquid Crystals and Displays, 2010, 25(6): 863–868. http://www.cqvip.com/QK/97614A/201006/36601979.html

    [10]

    郭德伟. 基于新一代GPS的表面粗糙度规范与评定技术研究[D]. 桂林: 桂林电子科技大学, 2008: 1–30.http://cdmd.cnki.com.cn/Article/CDMD-10595-2008193014.htm

    [11]

    谢小甫, 周进, 吴钦章.基于无参考结构清晰度的自适应自动对焦方法[J].光电工程, 2011, 38(2): 84–89. http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=gdgc201102014

    Xie Xiaofu, Zhou Jin, Wu Qinzhang. An adaptive autofocus method using no-reference structural sharpness[J]. Opto-Electronic Engineering, 2011, 38(2): 84–89. http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=gdgc201102014

    [12]

    蒋婷. 基于图像处理的自动对焦理论和技术研究[D]. 武汉: 武汉理工大学, 2008: 20–25.http://cdmd.cnki.com.cn/Article/CDMD-10497-2008110864.htm

    [13]

    Liu Shuxin, Liu Manhua, Yang Zhongyuan. An image au-to-focusing algorithm for industrial image measurement[J]. EURASIP Journal on Advances in Signal Processing, 2016, 2016: 70. doi: 10.1186/s13634-016-0368-5

    [14]

    蒋凤林. 基于数字图像处理的自动调焦算法研究[D]. 哈尔滨: 哈尔滨理工大学, 2008: 9–25.http://cdmd.cnki.com.cn/Article/CDMD-11914-2008172943.htm

    [15]

    莫春红. 基于图像处理的自动调焦技术研究[D]. 西安: 中国科学院研究生院(西安光学精密机械研究所), 2013: 20–30.http://cdmd.cnki.com.cn/Article/CDMD-80142-1014018705.htm

    [16]

    刘兴宝. 基于数字图像处理的自动对焦技术研究[D]. 绵阳: 中国工程物理研究院, 2007: 1–30.http://cdmd.cnki.com.cn/Article/CDMD-82818-2008032633.htm

  • 加载中

(10)

(9)

计量
  • 文章访问数:  8448
  • PDF下载数:  3411
  • 施引文献:  0
出版历程
收稿日期:  2017-04-28
修回日期:  2017-06-24
刊出日期:  2017-07-15

目录

/

返回文章
返回