纺织学报 ›› 2019, Vol. 40 ›› Issue (01): 62-66.doi: 10.13475/j.fzxb.20180300706

• 纺织工程 • 上一篇    下一篇

基于毛羽补偿与自适应中值滤波的纱线主体图像识别算法

孙巧妍1(), 陈祥光2, 刘美娜1, 孙玉梅1, 辛斌杰1   

  1. 1.烟台南山学院 工学院, 山东 烟台 265713
    2.北京理工大学 化学与化工学院, 北京 100081
  • 收稿日期:2018-03-01 修回日期:2018-09-30 出版日期:2019-01-15 发布日期:2019-01-18
  • 作者简介:孙巧妍(1978—), 女, 副教授, 硕士。 研究方向为智能检测与控制、 难测参数软测量建模。 E-mail: bailiyanru@163.com
  • 基金资助:
    山东省自然科学基金项目(ZR201709210161);山东省自然科学基金项目(2016ZRA06068)

Image recognition algorithm based on yarn hairiness compensation and adaptive median filter

SUN Qiaoyan1(), CHEN Xiangguang2, LIU Meina1, SUN Yumei1, XIN Binjie1   

  1. 1. College of Engineering, Yantai Nanshan University, Yantai, Shandong 265713, China
    2. School of Chemical Engineering and Environment, Beijing Institute of Technology, Beijing 100081, China
  • Received:2018-03-01 Revised:2018-09-30 Online:2019-01-15 Published:2019-01-18

摘要:

为解决纱线参数识别与计算过程中毛羽对纱线主体图像识别的干扰问题,提出了基于毛羽部分图像灰度补偿与自适应中值滤波的算法。采用R数据将影像扫描仪采集到的RGB图像二值化处理为灰度图像;然后根据毛羽形态上垂直方向灰度值的变化规律识别毛羽(白色背景黑色纱线),并进行由小及大的3层推抹补偿,同时根据毛羽像素灰度值特点识别毛羽(黑色背景白色纱线),并用背景灰度值补偿;最后将补偿后的2种图像各自进行最大窗口小于11的自适应中值滤波。MatLab仿真结果表明,该算法可较快地识别并补偿毛羽部分像素得到清晰的纱线主干图像,处理结果可达到检测精度要求。

关键词: 毛羽补偿, 自适应中值滤波, 灰度变阈值识别, 垂直方向识别及推抹

Abstract:

In order to solve the influence of yarn hairiness on image recognition of yarn body in the process of yarn parameter recognition and calculation,an algorithm based on gray scale compensation and adaptive median filtering was proposed. R data were used to binarize the RGB image collected by the image scanner into a grayscale image. The image of the black yarn with white background was recognized according to the change of the vertical gray value in the feather form and then compensated by 3 layer push from small to large. The image of the white yarn with black background was recognized and the background gray value was compensated according to the gray value of the feather pixel. Each of the two compensated images were subjected adaptive median filtering (ANF) with a maximum window smaller than 11.The results of MatLab simulation show that the algorithm can recognize and compensate some pixels of yarn hairiness quickly and acquire clear main yarn image. The results can meet the requirements of accuracy.

Key words: hairiness compensation, adaptive median filter, recognition of gray threshold value, vertical direction recognition and push-wipe

中图分类号: 

  • TP319

图1

黑色背景白色横向纱线原始图像"

图2

使用自适应中值滤波和膨胀腐蚀操作处理后的图像"

图3

黑色背景横向纱线补偿处理后的图像"

图4

黑色背景纵向纱线补偿处理前后的图像"

图5

白色背景黑色纱线原始图像"

图6

垂直方向识别及推抹算法流程图"

图7

r=1和r=2时处理图5图像的结果"

图8

采用垂直方向识别及推抹补偿算法处理后的图像"

图9

最终处理后的图像 (a)Black background horizontal yarn image;(b) Background black yarn image; (c) Black background longitudinal yarn image"

表1

测试方法所得结果对比"

图片 理论直径/mm 测量直径/mm 误差率%
黑底横向白线 0.202 0.207 2.48
黑底纵向白线 0.202 0.205 1.49
白底黑线 0.205 0.203 1.00
[1] 姬建正, 刘建立, 高卫东, 等. 基于数字图像处理的纱线线密度测量[J]. 纺织学报, 2011,32(10):42-46.
JI Jianzheng, LIU Jianli, GAO Weidong, et al. Measurement of yarn linear density based on digital image processing[J]. Journal of Textile Research, 2011,32(10):42-46.
[2] 方珩, 辛斌杰, 刘晓霞, 等. 一种新型纱线毛羽图像特征识别算法的研究[J]. 河北科技大学学报, 2015,36(1):63-72.
FANG Heng, XIN Binjie, LIU Xiaoxia, et al. Research of a novel methed for measuring yarn hairiness based on image recognition[J]. Journal of Hebei University of Science and Technology, 2015,36(1):63-72.
[3] 郭燕蕾, 顾平. 纤维和纱线检测中的图像处理技术[J]. 江苏丝绸, 2008(2):1-4.
GUO Yanlei, GU Ping. Image processing technology in fiber and yarn[J]. Jiangsu Silk, 2008(2):1-4.
[4] 孙银银, 潘如如, 高卫东. 基于数字图像处理的纱线毛羽检测[J]. 纺织学报, 2013,34(6):102-106.
SUN Yinyin, PAN Ruru, GAO Weidong. Detection of yarn hairiness based on digital image processing[J]. Journal of Textile Research, 2013,34(6):102-106.
[5] 张增康, 马卫红. 基于线阵CCD的纱线毛羽检测[J]. 上海纺织科技, 2017(10):43-46.
ZHANG Zengkang, MA Weihong. Yarn hairiness detection based on linear CCD[J]. Shanghai Textile Science & Technology, 2017(10):43-46.
[6] 章国红, 辛斌杰. 图像处理技术在纱线毛羽检测方面的应用[J]. 河北科技大学学报, 2016,37(1):76-81.
ZHANG Guohong, XIN Binjie. Application of image processing technology in yarn hairiness detection[J]. Journal of Hebei University of Science and Technology, 2016,37(1):76-81.
[7] 陈健, 郑绍华, 余轮, 等. 基于方向的多阈值自适应中值滤波改进算法[J]. 电子测量与仪器学报, 2013,27(2):156-161.
CHEN Jian, ZHENG Shaohua, YU Lun, et al. Improved algorithm for adaptive median filter with multi-threshold based on direction information[J]. Journal of Electronic Measurement and Instrument, 2013,27(2):156-161.
doi: 10.3724/SP.J.1187.2013.00156
[8] 孙海英, 李锋, 商慧亮. 改进的变分自适应中值滤波算法[J]. 电子与信息学报, 2011,33(7):1743-1747.
SUN Haiying, LI Feng, SHANG Huiliang. Salt-and-pepper noise removal by variational method based on improved adative median filter[J]. Journal of Electronics & Information Technology, 2011,33(7):1743-1747.
[9] 罗玲, 王修信. 一种高效去除椒盐噪声的中值滤波方法[J]. 微电子学与计算机, 2011,28(11):118-121.
LUO Ling, WANG Xiuxin. An efficient salt-and-pepper noise removal by median filter[J]. Microelectronics & Computer, 2011,28(11):118-121.
[10] 阮秋琦. 数字图像处理的MATLAB实现 [M].2版. 北京: 清华大学出版社, 2016: 142-144.
RUAN Qiuqi. Digital Image Processing Using MATLAB[M]. 2nd ed. Beijing: Tsinghua University Press, 2016: 142-144.
No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!