基于视觉的金属成形工件尺寸和缺陷检测
2019-02-19
作者:付泽民,王佳炜,张锁怀,乔涛涛 单位:上海应用技术大学
摘要:针对金属成形工件存在成形尺寸误差和外形缺陷,使用人工抽检效率低,不能对全部工件进行检测,大量存在未检出残次品交于客户的问题,提出一种基于HALCON视觉软件的金属成形工件尺寸与外形缺陷检测的方案。该方案基于金属成形工件形态学和灰度值特征,运用边缘提取和圆拟合算法,精确检测金属成形工件内圆孔尺寸。应用阈值分割与基于形状的标准模板匹配算法对金属成形工件进行区域匹配,检测工件外形缺陷。分别采集50个金属成形工件的图像并对其进行上述方法的检测,工件尺寸的检测正确率98.5%,外形缺陷件检测正确率98%。
关键词:HALCON;边缘检测;灰度阈值分割;缺陷检测
中图分类号:TG87;TH161文献标志码:ADOI:10.3969/j.issn.1000-7008.2019.02.032
Workpiece Size and Defect Detection in Metal Forming Based on HALCON
Fu Zemin,Wang Jiawei,Zhang Suohuai,Qiao Taotao
Abstract:For metal forming workpieces,there are errors in forming dimensions and forming defects.The efficiency of manual sampling inspection is low,detection accuracy is low,and there is a problem that undetectable defective products are delivered to customers.A metal forming workpiece dimension based on HALCON vision software is studied.The method is based on the morphological and grayvalue characteristics of metal forming workpieces.The edge extraction and circle fitting algorithm is used to precisely detect the size of round holes in metal forming workpieces.Threshold segmentation and shapebased standard template matching algorithm are used to achieve rapid matching of the target area and shape contour defect detection.The 50 metal forming workpiece images are examined respectively.The accuracy of the metal forming workpiece size is detected to be 98.5%,and the accuracy of the external defect detection is 98%.
Keywords:HALCON;edge detection;gray threshold segmentation;defect detection