|
骨架化操作:将二值化图像膨胀后,再skelelon,以使断开的缺陷链接起来。- * Acquire image
- read_image (Image, 'surface_scratch')
- get_image_size (Image, Width, Height)
- * Using a local threshold
- mean_image (Image, ImageMean, 7, 7)
- dyn_threshold (Image, ImageMean, DarkPixels, 5, 'dark')
- *
- * Extract connected components
- connection (DarkPixels, ConnectedRegions)
- *
- * Select large regions
- select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10, 1000)
- * Merge fractioned scratches via morphology
- union1 (SelectedRegions, RegionUnion)
- dilation_circle (RegionUnion, RegionDilation, 3.5)
- skeleton (RegionDilation, Skeleton)
- connection (Skeleton, Errors)
- dev_set_colored (12)
- dev_display (Image)
- dev_display (Errors)
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|