首页 > 范文大全 > 正文

弱边缘电荷耦合器件羊毛图像二值化算法

开篇:润墨网以专业的文秘视角,为您筛选了一篇弱边缘电荷耦合器件羊毛图像二值化算法范文,如需获取更多写作素材,在线客服老师一对一协助。欢迎您的阅读与分享!

摘要:为解决弱边缘图像二值化产生羊毛几何尺寸失真问题,通过对基于灰度和梯度指数的边缘细化算法研究,结合经典的全局阈值法和局部阈值法,提出了一种电荷耦合器件(CCD)羊毛图像自动二值化算法。该算法将sobel算子和斜坡边缘模型引入现有边缘细化算法中,既增加寻找边缘点环节又改进灰度调整因子,达到提高处理效率和避免人为干预的目的;在分析最大类间方差法和Bernsen法的基础上,结合全局和局部阈值处理各个子图像,从而强化边缘细节,降低失真度。实验结果表明,与传统方法相比,该算法对于弱边缘图像二值化具有良好的性能。

关键词:羊毛细度测量;图像二值化;边缘宽度细化;sobel算子;灰度调整因子;斜坡模型;最大类间方差法;Bernsen法

中图分类号: TP391.41文献标志码:A

Binarization algorithm for CCD wool images with weak contour

ZHOU Li1*, BI Du.yan1, ZHA Yu.fei2, LUO Hong.kai3, HE Lin.yuan1

1. Engineering College, Air Force Engineering University, Xi’an Shaanxi 710038, China;

2. Department of Aerial Weapon.Dominating, Air Force Second Flying Academy, Xi’an Shaanxi 710032, China;

3. No.631 Research Institute, Chinese Aviation Industry Corporation, Xi’an Shaanxi 710068, China

Abstract:

In order to solve the problem of wool geometric dimension, resulting from image binarization with weak contour, an automatic binarization algorithm of CCD wool image is proposed by the reference of a ramp-width-reduction approach based on intensity and gradient indices, using a classical global threshold method and a local one. In that algorithm, edge-pixel-seeking step is added and intensity-adjusting factor is improved, with sobel operator and ramp edge model introduced, to increase processing efficiency and avoid artificial sets. Besides, every sub image is processed by the mixed global and local threshold based on the analysis of Otsu’s and Bernsen’s methods to intensify edge details and decrease distortion. Compared with ordinary ways, experimental results show that the new algorithm has good performance in automatic binarization with weak contour.

In order to solve the distortion of wool geometric dimension, resulting from image binarization with weak contour, an automatic binarization algorithm for Charge.Coupled Device (CCD) wool image was proposed with reference to a ramp.width.reduction approach based on intensity and gradient indices, using a classical global threshold method and a local one. In that algorithm, edge.pixel.seeking step was added and gray.adjusting factor was improved, with sobel operator and ramp edge model introduced, to increase processing efficiency and avoid human intervention. Besides, every sub image was processed by the mixed global and local threshold based on the analysis of Otsus and Bernsens methods to intensify edge details and decrease distortion. Compared with the traditional ways, the experimental results show that the new algorithm has good performance in automatic binarization with weak contour.Key words:

wool diameter measurement; image binarization; ramp width reduction; sobel operator; gray.adjusting factor; ramp edge model; Otsu’s method; Bernsen’s method

0 引 言

羊绒、羊毛所具有的性状特征和制成纺织产品的风格性能几乎都与纤维的细度有关,导致在贸易中羊绒和羊毛的价格基本取决于纤维的细度。目前,羊绒及纤维混合物的定量分析在我国主要使用扫描电子显微镜和投影显微镜两种仪器,全是人工操作,尚无自动处理的仪器。图像处理技术的迅猛发展,在客观上为纺织业中材料性能和产品质量的评定和鉴别提供了一种有效的手段,使之有可能摒弃某些单凭经验或带有主观因素的判断方法。采用视觉技术对羊毛细度自动测量的第一步就是二值化处理。与灰度图像相比,二值化图像仅由逻辑0和1组成,可以很好地描述羊毛的轮廓,同时在很大程度上降低后续测量的计算量。在实际成像过程中,电荷耦合器件(Charge.Coupled Device,CCD)相机相对羊毛样本移动并连续拍照,造成图像出现弱边缘,因此必须进行有效的预处理来突出羊毛边缘信息,否则后期二值化处理将导致目标直径变粗,严重影响最终测量结果。通常解决这个问题的思路是找出一种细化目标边缘宽度的算法。迄今为止,在图像边缘细化方面已开展了大量的研究工作[1-3]。传统的边缘细化方法主要是提高边缘两边的灰度对比度,例如直方图均衡化[4],但这些方法对较宽和较模糊的边缘的细化效果有限。此外,该类方法不但会使处理后的图像亮的部分更亮,暗的部分更暗,而且在增强对比度的同时放大了噪声。基于灰度和梯度指数的边缘宽度细化算法[5]常用于弱边缘引起的图像降质,取得了一定的效果,但处理效率不高和需要人工干预成为限制其应用的瓶颈。

本文从文献[5]的细化算法不足出发,一方面借助sobel算子增加寻找边缘点环节以提高效率,另一方面引入斜坡边缘模型实现自动边缘细化处理。此外,对细化后的图像采用基于全局和局部阈值结合的方法进行二值化处理。

1 图像自动二值化算法

本文提出的适用于羊毛产业和纺织业中羊毛细度检测的图像自动二值化算法主要包括边缘宽度细化及基于全局和局部阈值的二值化处理两个部分,其流程如图1所示。

2 细化目标边缘

2.1 像素的灰度指数和梯度指数

文献[5]的细化算法定义了给定像素点的3个灰度指数和3个梯度指数。从-π到π将方向划分为8个区域,每个区域跨度是π/4,且以区域角平分线所指方位代表其方向。每个像素的梯度方向归属为某一个区域。不妨设中心像素P(i, j)的3个灰度指数和3个梯度指数分别表示为IH,IM,IL和GH,GM,GL。图2是一幅用于说明灰度指数和梯度指数定义的辅助示意图。黑色的粗线表示一组像素组,箭头所指方位是像素梯度方向对应区域的主方向,共有8种模式。灰度指数定义描述为在以中心像素P(i,j)的8邻域里,与梯度所属区域主方向垂直的方位上3组像素的灰度分别求平均值,这3个值就是灰度指数。