机器视觉 Blob分析 Halcon 同类软件 Malcon 案例分析
本Blob分析基本适合所有视觉的项目,就几行代码,分为几个步骤
1、读取图片 ReadImage
2、3通道转1通道Rgb1ToGray
3、阈值提取区域Threshold
4、连通区域Connection
5、分别以圆周率circularity、凸状率convexity、惯性inertia、面积area来挑选出区域
ReadImage(srcImage,'blob.bmp')
Rgb1ToGray(srcImage,ImageNew)
Threshold(ImageNew,hoThres,0,50)
Connection(hoThres,hoConn)
SelectShape(hoConn,hoSelect1,'circularity','and',0.9,1)
SelectShape(hoSelect1,hoSelect2,'convexity','and',0.9,1)
SelectShape(hoSelect2,hoSelect3,'inertia','and',0.9,1)
SelectShape(hoSelect3,hoSelect4,'area','and',2500,100000)