设置首页收藏本站
开启左侧

【难点】 求大神解决,如何找出凹痕

[复制链接]
A君临天下 发表于 2021-5-12 10:48:00 | 显示全部楼层 |阅读模式
求大神解决,如何找出凹痕。

凹痕缺陷

凹痕缺陷
缺失.PNG
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
gai123 发表于 2021-5-28 08:22:48 | 显示全部楼层
建议深度学习AI
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
可汗 发表于 2021-6-1 13:55:38 | 显示全部楼层
这个暂时没有试到合适的办法呀,楼主解决了的话分享一下思路哈
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
1060108333@qq.c 发表于 2021-6-10 17:40:01 | 显示全部楼层
本帖最后由 1060108333@qq.c 于 2021-6-10 18:19 编辑

read_image (Image002, 'G:/learning_halcon_file/img/002.png')


decompose3(Image002, R, G, B)

trans_from_rgb(R, G, B, H, S, V, 'hsv')

binary_threshold(H, Region1, 'max_separability', 'light', UsedThreshold)
connection(Region1, ConnectedRegions1)
select_shape(ConnectedRegions1, SelectedRegions1, 'area', 'and', 100000, 999999)


binary_threshold(V, Region2, 'max_separability', 'light', UsedThreshold)
connection(Region2, ConnectedRegions2)
select_shape(ConnectedRegions2, SelectedRegions2, 'area', 'and', 250000, 999999)

intersection(SelectedRegions1, SelectedRegions2, RegionIntersection)

reduce_domain(S, RegionIntersection, ImageReduced)

fill_up(RegionIntersection, RegionFillUp)

opening_circle(RegionFillUp, RegionOpening, 5.5)

shape_trans(RegionOpening, RegionTrans, 'convex')

reduce_domain(S, RegionTrans, ImageReduced1)


* emphasize(ImageReduced1, ImageEmphasize, 7, 7, 20)
median_image(ImageReduced1, ImageMedian, 'circle', 3, 'mirrored')
scale_image_max(ImageMedian, ImageScaleMax)
threshold (ImageScaleMax, Regions, 97, 211)

fill_up(Regions, RegionFillUp1)

opening_circle(RegionFillUp1, RegionOpening1, 5.5)

clip_region_rel(RegionOpening1, RegionClipped, 2, 2, 8, 25)
reduce_domain(B, RegionClipped, ImageReduced2)

median_image(ImageReduced2, ImageMedian2, 'circle', 3, 'mirrored')
emphasize(ImageMedian2, ImageEmphasize1, 5, 5, 10)
median_image(ImageEmphasize1, ImageMedian1, 'circle', 2, 'mirrored')

emphasize(ImageMedian1, ImageEmphasize2, 7, 7, 1)

edges_sub_pix(ImageReduced2, Edges, 'canny', 1, 8, 15)
* union_collinear_contours_xld(Edges, UnionContours1, 20, 1, 2, 0.1, 'attr_keep')

union_adjacent_contours_xld(Edges, UnionContours, 20, 5, 'attr_keep')



select_contours_xld(Edges, SelectedContours, 'contour_length', 10, 200, -0.5, 0.5)

union_adjacent_contours_xld(SelectedContours, UnionContours2, 10, 1, 'attr_keep')

select_contours_xld(UnionContours2, SelectedContours1, 'contour_length', 15, 200, -0.5, 0.5)

close_contours_xld(SelectedContours1, ClosedContours)

shape_trans_xld(ClosedContours, XLDTrans, 'rectangle1')
gen_region_contour_xld(XLDTrans, Region, 'filled')
erosion_rectangle1(Region, RegionErosion, 3, 3)



dev_set_draw ('margin')
dev_display(Image002)
dev_display(RegionErosion)
效果图.png
效果图2.png
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
1060108333@qq.c 发表于 2021-6-10 18:16:25 | 显示全部楼层
1060108333@qq.c 发表于 2021-6-10 17:40
read_image (Image002, 'G:/learning_halcon_file/img/002.png')

G:\learning_halcon_file\效果图.png
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表