Edge contour extraction of infrared face image based on improved Canny algorithm
-
摘要: 红外人脸图像的边缘轮廓特征对于红外人脸检测、识别等相关应用具有重要价值。针对红外人脸图像边缘轮廓提取时存在伪边缘的问题,提出了一种改进Canny算法的红外人脸图像边缘轮廓提取方法。首先通过对引导滤波算法引入“动态阈值约束因子”替换原始算法中的高斯滤波,解决了原始算法滤波处理不均匀和造成红外人脸图像弱边缘特征丢失的弊端;接着对原始算法的非极大值抑制进行了改进,在原始计算梯度方向的基础上又增加了4个梯度方向,使得非极大值抑制的插值较原始算法更加精细;最后改进OTSU(大津)算法,构造灰度-梯度映射函数确定最佳阈值,解决了原始算法人为经验确定阈值的局限性。实验结果表明:提出的改进Canny算法的红外人脸轮廓提取方法滤波后的图像,相较于原始Canny算法滤波处理,信噪比性能提升了34.40%,结构相似度性能提升了21.66%;最终的红外人脸边缘轮廓提取实验的优质系数值高于对比实验的其他方法,证明改进后的算法对于红外人脸图像边缘轮廓提取具有优越性。Abstract: The edge contour features of infrared face images are of great value for applications related to infrared face detection and recognition. Aiming at the problem of false edges in the edge contour extraction of infrared face images, an edge contour extraction of infrared face image based on improved Canny algorithm was proposed. Firstly, by introducing dynamic threshold constraint factor to the guided filtering algorithm to replace the Gaussian filtering in the original algorithm, the disadvantages of uneven filtering processing and the loss of weak edge features in the infrared face image were solved. Then, the non-maximum suppression was improved, and four gradient directions were added on the basis of the original gradient direction, which made the interpolation of non-maximum suppression more precise than the original algorithm. Finally, the OTSU algorithm was improved by constructing a gray-gradient mapping function to determine the optimal threshold value, which solved the limitation of the original algorithm to determine the threshold value by human experience. The experimental results show that, compared with the original Canny algorithm filtering processing, the performance of signal-to-noise ratio of the filtered image from edge contour extraction of infrared face images based on improved Canny algorithm is improved by 34.40%, and the performance of structural similarity is improved by 21.66%. Finally, the quality coefficient value of the experiment of infrared face edge contour extraction is higher than that of other methods in the comparison experiment, which proves that the improved algorithm has superiority for the edge contour extraction of infrared face image.
-
Key words:
- infrared face images /
- edge contour extraction /
- Canny algorithm /
- guided filtering /
- OTSU algorithm
-
表 1 Canny算法边缘检测流程
Table 1 Edge detection process by Canny algorithm
步骤 操作 Step1 高斯滤波器平滑图像滤除噪声 Step2 计算梯度强度和方向 Step3 非极大值抑制消除杂散响应 Step4 双阈值检测确定真实和潜在边缘 Step5 抑制孤立弱边缘完成边缘检测 表 2 测试图像滤波结果PSNR对比
Table 2 PSNR comparison of test image filtering results
dB 算法
图像高斯
滤波中值
滤波双边
滤波引导
滤波改进的
引导滤波红外图像1 18.2232 20.5684 21.3176 22.0259 24.2705 剪裁图像1 20.5684 23.3158 25.6315 27.0160 31.0563 红外图像2 19.0312 21.1657 23.0287 24.9638 27.8652 剪裁图像2 21.2357 25.0642 26.9163 28.2157 33.1066 Lena图像 24.1306 32.3823 35.5686 36.6252 40.1549 表 3 测试图像滤波结果SSIM对比
Table 3 SSIM comparison of test image filtering results
% 算法
图像高斯
滤波中值
滤波双边
滤波引导
滤波改进的
引导滤波红外图像1 56.89 58.37 60.52 63.86 69.01 剪裁图像1 60.36 61.93 63.04 65.23 73.15 红外图像2 58.62 59.38 61.07 65.04 71.52 剪裁图像2 62.07 64.59 65.76 68.31 75.23 Lena图像 68.02 68.94 71.23 75.35 81.87 -
[1] 蔡伟, 徐佩伟, 杨志勇, 等. 复杂背景下红外图像弱小目标检测[J]. 应用光学,2021,42(4):643-650. doi: 10.5768/JAO202142.0402002CAI Wei, XU Peiwei, YANG Zhiyong, et al. Dim-small targets detection of infrared images in complex backgrounds[J]. Journal of Applied Optics,2021,42(4):643-650. doi: 10.5768/JAO202142.0402002 [2] 张骏, 朱标, 吉涛. 基于Mobile Net-SSD的红外人脸检测算法[J]. 激光与红外,2021,51(1):107-113. doi: 10.3969/j.issn.1001-5078.2021.01.019ZHANG Jun, ZHU Biao, JI Tao. Infrared face detection algorithm based on mobile Net-SSD[J]. Laser & Infrared,2021,51(1):107-113. doi: 10.3969/j.issn.1001-5078.2021.01.019 [3] 曹旭, 聂勇伟, 李桂清. 高精度连续人脸轮廓提取[J]. 计算机辅助设计与图形学学报,2019,31(4):522-530.CAO Xu, NIE Yongwei, Li Guiqing. Refining sparse landmarks to continuous and high-quality face contour[J]. Journal of Computer-Aided Design & Computer Graphics,2019,31(4):522-530. [4] 陈晓文, 刘光帅, 刘望华, 等. 结合LoG边缘检测和增强局部相位量化的模糊图像识别[J]. 计算机科学,2020,47(12):197-204. doi: 10.11896/jsjkx.191000054CHEN Xiaowen, LIU Guangshuai, LIU Wanghua, et al. Blurred image recognition based on log edge detection and enhanced local phase quantization[J]. Computer Science,2020,47(12):197-204. doi: 10.11896/jsjkx.191000054 [5] WU Zongshan, WENG Guirong. An active contour model algorithm combined with anisotropic diffusion filtering and global pre-fitting energy[J]. Optik,2022,253:168606. doi: 10.1016/j.ijleo.2022.168606 [6] WANG Baozhu, CHANG Xiuying, LIU Cuixiang. Skin detection and segmentation of human face in color images[J]. International Journal of Intelligent Engineering and Systems,2011,4(1):10-17. doi: 10.22266/ijies2011.0331.02 [7] 闫梦凯, 钱建军, 杨健. 弱对齐的跨光谱人脸检测[J]. 自动化学报,2022,48(8):1-13.YAN Mengkai, QIAN Jianjun, YANG Jian. Weakly aligned cross-spectral face detection[J]. Acta Automatica Sinica,2022,48(8):1-13. [8] CANNY J. A computational approach to edge detection[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,1986,8(6):679-698. [9] 李军成. 图像边缘检测的分数阶微分算子研究[J]. 计算机应用与软件,2015,32(12):206-209. doi: 10.3969/j.issn.1000-386x.2015.12.048LI Juncheng. On fractional differential operators for image edge detection[J]. Computer Applications and Software,2015,32(12):206-209. doi: 10.3969/j.issn.1000-386x.2015.12.048 [10] 王坤, 刘沛伦, 王力. 基于FFWA的自适应Canny飞机蒙皮红外图像边缘检测[J]. 红外技术,2021,43(5):443-454.WANG Kun, LIU Peilun, WANG Li. Infrared image adaptive canny edge-detection of aircraft skin based on fast fireworks algorithm[J]. Infrared Technology,2021,43(5):443-454. [11] 许宏科, 秦严严, 陈会茹. 一种基于改进Canny的边缘检测算法[J]. 红外技术,2014,36(3):210-214. doi: 10.11846/j.issn.1001_8891.201403007XU Hongke, QIN Yanyan, CHEN Huiru. An improved algorithm for edge detection based on canny[J]. Infrared Technology,2014,36(3):210-214. doi: 10.11846/j.issn.1001_8891.201403007 [12] 李金伦, 崔少辉, 汪明. 基于改进中值滤波和提升小波变换的阈值去噪方法研究[J]. 应用光学,2014,35(5):817-822.LI Jinlun, CUI Shaohui, WANG Ming. Threshold de-noising method for mixed noise based on improved median filter and lifting wavelet transform[J]. Journal of Applied Optics,2014,35(5):817-822. [13] 段红燕, 邵豪, 张淑珍, 等. 一种基于Canny算子的图像边缘检测改进算法[J]. 上海交通大学学报,2016,50(12):1861-1865. doi: 10.16183/j.cnki.jsjtu.2016.12.009DUAN Hongyan, SHAO Hao, ZHANG Shuzhen, et al. An improved algorithm for image edge detection based on canny operator[J]. Journal of Shanghai Jiaotong University,2016,50(12):1861-1865. doi: 10.16183/j.cnki.jsjtu.2016.12.009 [14] 李靖, 王慧, 闫科, 等. 改进Canny算法的图像边缘增强方法[J]. 测绘科学技术学报,2021,38(4):398-403.LI Jing, WANG Hui, YAN Ke, et al. Improved Canny algorithm for image edge enhancement[J]. Journal of Geomatics Science and Technology,2021,38(4):398-403. [15] 黄梦涛, 连一鑫. 基于改进Canny算子的锂电池极片表面缺陷检测[J]. 仪器仪表学报,2021,42(10):199-209. doi: 10.19650/j.cnki.cjsi.J2107914HUANG Mengtao, LIAN Yixin. Lithium battery electrode plate surface defect detection based on improved Canny operator[J]. Chinese Journal of Scientific Instrument,2021,42(10):199-209. doi: 10.19650/j.cnki.cjsi.J2107914 [16] 李彦, 赵其峰, 闫河, 等. Canny算子在PCBA目标边缘提取中的优化应用[J]. 光学精密工程,2020,28(9):2096-2102. doi: 10.37188/OPE.20202809.2096LI Yan, ZHAO Qifeng, YAN He, et al. Optimized application of Canny operator in PCBA target edge extraction[J]. Optics and Precision Engineering,2020,28(9):2096-2102. doi: 10.37188/OPE.20202809.2096 [17] 杨陶, 田怀文, 刘晓敏, 等. 基于边缘检测与Otsu的图像分割算法研究[J]. 计算机工程,2016,42(11):255-260. doi: 10.3969/j.issn.1000-3428.2016.11.042YANG Tao, TIAN Huaiwen, LIU Xiaomin, et al. Research on image segmentation algorithm based on edge detection and Otsu[J]. Computer Engineering,2016,42(11):255-260. doi: 10.3969/j.issn.1000-3428.2016.11.042 [18] HE K M, SUN J, TANGX O. Guided image filtering[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,2013,35(6):1397-1409. doi: 10.1109/TPAMI.2012.213 [19] WANG Z, BOVIK A C, SHEIKH H R, et al. Image quality assessment: from error visibility to structural similarity[J]. IEEE Transactions on Image Processing,2004,13(4):600-612. doi: 10.1109/TIP.2003.819861 [20] ABDOU I E, PRATT W K. Quantitative design and evaluation of enhancement thresholding edge detectors[J]. Proceedings of the IEEE,1979,67(5):753-763. doi: 10.1109/PROC.1979.11325 -