APP下载

一种基于支持向量机的金属表面缺陷检测方法

2021-09-06顾爱华,李玟函,王正乾,殷作好,叶凯宁,陈玉

软件工程 2021年8期

顾爱华,李玟函,王正乾,殷作好,叶凯宁,陈玉

摘  要:针对金属表面缺陷检测中存在的图像失真、构造分类器精确度不高及系统计算量大的问题,现提出一种高质量的基于支持向量机的金属表面缺陷检测方法。采用形态学方法对图像进行预处理,通过融合GLCM与HOG特征提取到的结果建立较为完备的缺陷模型,便于后期构造高精度分类器。最后,利用OTSU算法进行阈值分割,通过计算连通分量个数等方法进行缺陷分析。相较于一般的缺陷检测方法,该检测方法准确率达到96.67%,提高了缺陷检测的效率。

关键词:缺陷检测;图像处理;SVM分类器

中图分类号:TP391     文献标识码:A

A Metal Surface Defect Detection Method based on Support Vector Machine

GU Aihua, LI Wenhan, WANG Zhengqian, YIN Zuohao, YE Kaining, CHEN Yu

(College of Information Engineering, Yancheng Teachers University, Yancheng 224002, China)

guaihua1978@163.com; liwenhan1127@163.com; 2794965946@qq.com;

2693704323@qq.com; 2506331929@qq.com; 7042799@qq.com

Abstract: Aiming at the problems of image distortion in metal surface defect detection, inaccuracy of construction classifier and large amount of system calculation, this paper proposes a high-quality metal surface defect detection method based on support vector machine. Morphological methods are used to preprocess the image, and a relatively complete defect model is established by fusing the results extracted from GLCM (Gray-level Co-occurrence Matrix) and HOG (Histogram of Oriented Gradient) features, which is convenient for constructing a high-precision classifier in the later stage. Finally, OTSU algorithm is used to perform threshold segmentation, and defect analysis is performed by calculating the number of connected components. Compared with general defect detection methods, the proposed detection method improves the efficiency of defect detection and its accuracy rate is as high as 96.67%.

Keywords: defect detection; image processing; SVM (Support Vector Machine) classifier

1   引言(Introduction)

在工業实际生产中,金属板质量检测的精确度和速度至关重要,传统的人工检测方法不仅消耗工厂大量的物力、财力,且检测结果带有强烈的主观性,并不可靠。现有的金属表面缺陷检测系统在图像处理时会使图像扭曲,造成不同程度的失真,对后期图像分割和缺陷识别产生较大影响。为解决上述问题,本文提出了一种基于支持向量机(Support Vector Machine,SVM)的金属表面缺陷检测方法。首先,在缺陷图像预处理时采用形态学的方法去除基线漂移,改善光照不均,通过融合灰度共生矩阵(GLCM)和方向梯度直方图(HOG)两种特征提取的结果,作为支持向量机(SVM)分类器训练模型;利用大津法进行图像分割,再通过腐蚀膨胀的方法去除引入杂点,最终使捕获到的缺陷分析准确率得到提高。

2   SVM模型构建(SVM model construction)

2.1   缺陷图像预处理

登录APP查看全文