halcon,表面检测

时间:2022-02-03 12:10:48
【文件属性】:

文件名称:halcon,表面检测

文件大小:9KB

文件格式:HDEV

更新时间:2022-02-03 12:10:48

halcon

*利用面积对白色划痕区域进行选择,大于150的区域认为是划痕 connection (RegionClosing1, ConnectedRegions1) select_shape (ConnectedRegions1, SelectedRegions1, 'area', 'and', 150, 99999) closing_circle (SelectedRegions1, RegionClosing2, 20) union2 (RegionOpening, RegionClosing2, RegionUnion2) *动态阈值提取灰度值比周围暗的区域 dyn_threshold (ImageReduced, ImageMean, RegionDynThresh, 50, 'dark') closing_circle (RegionDynThresh, RegionClosing3, 80) dilation_circle (RegionClosing3, RegionDilation, 15) *补集为白色划痕区域,交集为裂缝区域 difference (RegionUnion2, RegionDilation, RegionDifference) intersection (RegionUnion2, RegionClosing3, RegionIntersection) dev_display (Image) dev_set_color ('red') dev_display (RegionDifference) dev_set_color ('green') dev_display (RegionIntersection)


网友评论