留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

基于单目视觉边缘频谱的散焦图像测距算法研究

介邓飞 王浩 吕惠芳 田波涛 张展翔

介邓飞, 王浩, 吕惠芳, 田波涛, 张展翔. 基于单目视觉边缘频谱的散焦图像测距算法研究[J]. 中国光学(中英文), 2023, 16(3): 627-636. doi: 10.37188/CO.2022-0171
引用本文: 介邓飞, 王浩, 吕惠芳, 田波涛, 张展翔. 基于单目视觉边缘频谱的散焦图像测距算法研究[J]. 中国光学(中英文), 2023, 16(3): 627-636. doi: 10.37188/CO.2022-0171
JIE Deng-fei, WANG Hao, LV Hui-fang, TIAN Bo-tao, ZHANG Zhan-xiang. An improved algorithm for monocular camera edge spectrum based ranging by defocused images[J]. Chinese Optics, 2023, 16(3): 627-636. doi: 10.37188/CO.2022-0171
Citation: JIE Deng-fei, WANG Hao, LV Hui-fang, TIAN Bo-tao, ZHANG Zhan-xiang. An improved algorithm for monocular camera edge spectrum based ranging by defocused images[J]. Chinese Optics, 2023, 16(3): 627-636. doi: 10.37188/CO.2022-0171

基于单目视觉边缘频谱的散焦图像测距算法研究

基金项目: 福建省自然科学基金面上项目(No. 2020J01577);福建省农业信息感知技术重点实验室项目(No. 2021ZDSYS0101)
详细信息
    作者简介:

    介邓飞(1982—),男,山西运城人,博士,副教授,硕士生导师,2014年于浙江大学获得博士学位,现为福建农林大学机电工程学院副教授,主要从事测控技术与智能装备方面的研究。E-mail:jiedengfei@163.com

  • 中图分类号: TP39;S24

An improved algorithm for monocular camera edge spectrum based ranging by defocused images

Funds: Supported by Fujian Provincial Natural Science Foundation Project (No. 2020J01577); the Fujian Key Laboratory of Agricultural Information Sensoring Technology (No. 2021ZDSYS0101)
More Information
  • 摘要:

    为了实现基于单目相机的弱或无表面纹理特征目标精确测距,提出了一种基于保留边缘频谱信息的改进散焦图像测距算法。通过对比以傅立叶变换和拉普拉斯变换为计算核心的两种经典散焦测距理论,构建相应的清晰度评价函数,根据灵敏度更好的频谱清晰度函数选择基于频谱的散焦测距法,并根据频谱清晰度函数在保留目标边缘信息的基础上选择频域计算范围,从而进行测距。为验证算法的可行性,本文采用6组不同的鸭蛋样本,获取不同光圈、不同距离的散焦图像,利用该改进算法求解鸭蛋到相机镜头的距离。实验结果表明,基于边缘频谱保留的散焦图像测距改进算法具有良好的测距效果,相关系数为0.986,均方根误差为11.39 mm,并发现对于斜放拍摄的鸭蛋图像进行图像旋转处理后,可有效地提升测距能力,均方根误差从11.39 mm下降至8.76 mm,平均相对误差从2.85%下降至2.28%,相关系数提升至0.99。基本满足了弱或无表面纹理特征目标测距的稳定、精度等要求。

     

  • 图 1  相机标定原理图

    Figure 1.  Schematic diagram of camera calibration

    图 2  实验用鸭蛋样本

    Figure 2.  Experimental samples of duck eggs

    图 3  部分清晰度不同的鸭蛋图像

    Figure 3.  Images of duck eggs with different definitions

    图 4  (a)基于拉普拉斯算子及(b)基于频谱的清晰度变化

    Figure 4.  Sharpness changes based on (a) the Laplacian operator and (b) spectrum

    图 5  (a)与(e)为鸭蛋图像,(b)与(f)为原频谱图,(c)与(g)为边缘保留频率截取图,(d)与(h)为频率截取后的频谱图像对应的时域图像

    Figure 5.  (a) and (e) are egg images, (b) and (f) are original spectral images, (c) and (g) are frequency-intercepted spectral images, (d) and (h) are time-domain images corresponding to the spectral images after frequency interception

    图 6  (a)频率截取后的清晰度变化图;(b)原清晰度变化图

    Figure 6.  (a) The definition change curve after the frequency interception; (b) the change of original definition

    图 7  基于边缘保留散焦图像测距算法流程图

    Figure 7.  The flow chart of ranging algorithm based on edge retaining defocus image

    图 8  实际距离与计算距离相关系数图

    Figure 8.  The correlations between observed distance and calculated distance

    图 9  图像旋转示意图。(a)原图;(b)旋转后图像

    Figure 9.  The process of image rotation. (a) Original image; (b) rotated image

    图 10  斜放鸭蛋经旋转处理后实际距离与计算距离相关系数图

    Figure 10.  The correlation between observed distance and calculated distance for oblique duck eggs after rotation treatment

    图 11  4号鸭蛋10组照片清晰度变化图

    Figure 11.  Clarity change of group 10 of egg No. 4

    图 12  4号鸭蛋取自然对数清晰度与物距关系图

    Figure 12.  Relationship between natural logarithmic clarity and object distance of egg No. 4

    图 13  拟合模型计算物距的相对误差

    Figure 13.  The relative error of the object distance from fitting model

    表  1  实际距离与计算距离实验结果

    Table  1.   The results of observed distance and calculated distance

    序号鸭蛋特征最大误差
    (mm)
    均方根误差
    (mm)
    平均相对
    误差(%)
    1绿壳、竖放10.906.591.63
    2白壳、竖放16.6010.222.87
    3白壳、竖放16.9910.652.98
    4白壳、横放13.928.302.24
    5白壳、斜放29.4416.934.31
    6绿壳、斜放24.7512.733.08
    总计29.4411.392.85
    下载: 导出CSV

    表  2  图像旋转前后测距结果对比

    Table  2.   The ranging results before and after image rotating

    序号处理方式最大误差
    (mm)
    均方根误差
    (mm)
    平均相对
    误差(%)
    5原始图像29.4416.934.31
    图像旋转后13.558.722.25
    6原始图像24.7512.733.08
    图像旋转后14.825.931.73
    总计原始图像29.4411.392.85
    图像旋转后16.998.762.28
    下载: 导出CSV

    表  3  拟合模型所得结果

    Table  3.   The results of fitting model

    序号实际距离/mm计算距离/mm误差/mm相对误差/%
    1250246.82−3.18−1.27
    2270273.413.411.26
    3290285.12−4.88−1.68
    4310310.620.620.20
    5330332.272.270.69
    6350354.304.301.23
    7370372.322.320.63
    8390390.980.980.25
    9410409.52−0.48−0.12
    10430424.64−5.36−1.25
    下载: 导出CSV

    表  4  拟合模型参数表

    Table  4.   Parameters of fitting model

    αβSSER2RMSE
    −91.97 (−96.21,−87.74)1349 (1302,1395)104.90.99683.62
    下载: 导出CSV
  • [1] GONGAL A, AMATYA S, KARKEE M, et al. Sensors and systems for fruit detection and localization: a review[J]. Computers and Electronics in Agriculture, 2015, 116: 8-19. doi: 10.1016/j.compag.2015.05.021
    [2] 蔡明兵, 刘晶红, 徐芳. 无人机侦察多目标实时定位技术研究[J]. 中国光学,2018,11(5):812-821. doi: 10.3788/co.20181105.0812

    CAI M B, LIU J H, XU F. Multi-targets real-time location technology for UAV reconnaissance[J]. Chinese Optics, 2018, 11(5): 812-821. (in Chinese) doi: 10.3788/co.20181105.0812
    [3] MIRHAJI H, SOLEYMANI M, ASAKEREH A, et al. Fruit detection and load estimation of an orange orchard using the YOLO models through simple approaches in different imaging and illumination conditions[J]. Computers and Electronics in Agriculture, 2021, 191: 106533. doi: 10.1016/j.compag.2021.106533
    [4] 张石磊, 崔宇, 邢慕增, 等. 光场成像目标测距技术[J]. 中国光学,2020,13(6):1332-1342. doi: 10.37188/CO.2020-0043

    ZHANG SH L, CUI Y, XING M Z, et al. Light field imaging target ranging technology[J]. Chinese Optics, 2020, 13(6): 1332-1342. (in Chinese) doi: 10.37188/CO.2020-0043
    [5] 熊锐. 基于数字图像处理的显微自动对焦技术研究[D]. 成都: 中国科学院大学(中国科学院光电技术研究所), 2021.

    XIONG R. Study on microscopic autofocus technology based on digital image processing[D]. Chengdu: The Institute of Optics and Electronics, The Chinese Academy of Sciences, 2021. (in Chinese)
    [6] 李喆, 李建增, 胡永江, 等. 基于频谱预处理与改进霍夫变换的离焦模糊盲复原算法[J]. 图学学报,2018,39(5):909-916.

    LI ZH, LI J Z, HU Y J, et al. Blind restoration of focus blur based on spectrum preprocessing and improved Hough transform[J]. Journal of Graphics, 2018, 39(5): 909-916. (in Chinese)
    [7] RASHWAN H A, CHAMBON S, GURDJOS P, et al. Using curvilinear features in focus for registering a single image to a 3D object[J]. IEEE Transactions on Image Processing, 2019, 28(9): 4429-4443. doi: 10.1109/TIP.2019.2911484
    [8] SUBBARAO M. Direct recovery of depth-map I: differential methods[C]. Proceedings of the IEEE Computer Society Workshop on Computer Vision, IEEE, 1987: 58-65.
    [9] 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
    [10] RAJAGOPALAN A N, CHAUDHURI S, MUDENAGUDI U. Depth estimation and image restoration using defocused stereo pairs[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2004, 26(11): 1521-1525. doi: 10.1109/TPAMI.2004.102
    [11] 王海娟. 基于散焦图像的深度估计的研究[D]. 青岛: 中国海洋大学, 2011.

    WANG H J. Study on the estimate of depth based on defocus image[D]. Qingdao: Ocean University of China, 2011. (in Chinese)
    [12] 马艳娥. 基于散焦图像测距的目标尺寸测量技术研究[D]. 太原: 中北大学, 2012.

    MA Y E. Research of objective measuring technique based on image distance measurement by defocusing[D]. Taiyuan: North University of China, 2012. (in Chinese)
    [13] 薛松, 王文剑. 基于超像素分割的单幅散焦图像深度恢复方法[J]. 计算机科学与探索,2018,12(7):1162-1168. doi: 10.3778/j.issn.1673-9418.1705042

    XUE S, WANG W J. Depth estimation from single defocused image based on superpixel segmentation[J]. Journal of Frontiers of Computer Science and Technology, 2018, 12(7): 1162-1168. (in Chinese) doi: 10.3778/j.issn.1673-9418.1705042
    [14] 薛松, 王文剑. 基于高斯-柯西混合模型的单幅散焦图像深度恢复方法[J]. 计算机科学,2017,44(1):32-36. doi: 10.11896/j.issn.1002-137X.2017.01.006

    XUE S, WANG W J. Depth estimation from single defocused image based on Gaussian-Cauchy mixed model[J]. Computer Science, 2017, 44(1): 32-36. (in Chinese) doi: 10.11896/j.issn.1002-137X.2017.01.006
    [15] 韩丽燕, 王黎明, 刘宾. 一种基于边缘扩散函数描述散焦程度的测距算法[J]. 传感器世界,2011,17(2):9-11. doi: 10.3969/j.issn.1006-883X.2011.02.002

    HAN L Y, WANG L M, LIU B. Depth measuring method based on using edge spread function to describe defocusing degrees of images[J]. Sensor World, 2011, 17(2): 9-11. (in Chinese) doi: 10.3969/j.issn.1006-883X.2011.02.002
    [16] 袁红星, 吴少群, 安鹏, 等. 对象引导的单幅散焦图像深度提取方法[J]. 电子学报,2014,42(10):2009-2015. doi: 10.3969/j.issn.0372-2112.2014.10.022

    YUAN H X, WU SH Q, AN P, et al. Object guided depth map recovery from a single defocused image[J]. Acta Electronica Sinica, 2014, 42(10): 2009-2015. (in Chinese) doi: 10.3969/j.issn.0372-2112.2014.10.022
    [17] ERKAN U, ENGINOĞLU S, THANH D N H, et al. Adaptive frequency median filter for the salt and pepper denoising problem[J]. IET Image Processing, 2020, 14(7): 1291-1302. doi: 10.1049/iet-ipr.2019.0398
    [18] 刘聪, 董文飞, 蒋克明, 等. 基于改进分水岭分割算法的致密荧光微滴识别[J]. 中国光学,2019,12(4):783-790. doi: 10.3788/co.20191204.0783

    LIU C, DONG W F, JIANG K M, et al. Recognition of dense fluorescent droplets using an improved watershed segmentation algorithm[J]. Chinese Optics, 2019, 12(4): 783-790. (in Chinese) doi: 10.3788/co.20191204.0783
    [19] PENTLAND A, SCHEROCK S, DARRELL T, et al. Simple range cameras based on focal error[J]. Journal of the Optical Society of America A, 1994, 11(11): 2925-2934. doi: 10.1364/JOSAA.11.002925
    [20] 葛鹏, 游耀堂. 基于稀疏表示的光场图像超分辨率重建[J]. 激光与光电子学进展,2022,59(2):0210001.

    GE P, YOU Y T. Super-resolution reconstruction of light field images via sparse representation[J]. Laser &Optoelectronics Progress, 2022, 59(2): 0210001. (in Chinese)
  • 加载中
图(13) / 表(4)
计量
  • 文章访问数:  428
  • HTML全文浏览量:  276
  • PDF下载量:  232
  • 被引次数: 0
出版历程
  • 收稿日期:  2022-07-23
  • 修回日期:  2022-09-06
  • 录用日期:  2022-12-24
  • 网络出版日期:  2022-12-24

目录

    /

    返回文章
    返回