工控编程吧

标题: halcon junctions_skeleton函数介绍 [打印本页]

作者: qq263946146    时间: 2019-5-15 00:43
标题: halcon junctions_skeleton函数介绍
junctions_skeleton(Region : EndPoints, JuncPoints : : )
检测骨架中的连接点和端点(参见 skeleton))。
输入区域Region 中的结点以区域形式输出,保存在参数JuncPoints 。
而端点也作为区域输出,保存在参数EndPoints


为了使用junctions_skeleton获得合理的结果,
输入区域Region 不能包含超过一个像素宽的线。
skeleton得到的区域可以满足该条件,
morph_skeleton得到的区域一般不满足该条件。


运行下面例程,查看骨架结点和端点效果
read_image (Alpha1, 'alpha1')
get_image_size (Alpha1, Width, Height)
mean_image (Alpha1, ImageMean, 21, 21)
dyn_threshold (Alpha1, ImageMean, Dark, 5, 'dark')
connection (Dark, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 50, 1000)
opening_rectangle1 (SelectedRegions, RegionOpening, 2, 2)
skeleton (RegionOpening, Skeleton)
junctions_skeleton (Skeleton, EndPoints, JuncPoints)
dev_clear_window ()
dev_set_part (0, 0, Width - 1, Height - 1)
dev_set_draw ('fill')
dev_set_color ('white')
dev_display (RegionOpening)
dev_set_color ('blue')
dev_display (EndPoints)
dev_set_color ('red')
dev_display (JuncPoints)
stop ()
dev_clear_window ()
dev_set_part (200, 200, 400, 400)
dev_set_draw ('fill')
dev_set_color ('white')
dev_display (RegionOpening)
dev_set_color ('blue')
dev_display (EndPoints)
dev_set_color ('red')
dev_display (JuncPoints)

[halcon]1[/halcon]






欢迎光临 工控编程吧 (https://www.gkbc8.com/) Powered by Discuz! X3.4