halcon电路宽度测量的例子

处理要求:

根据客户给的宽度,计算出电路宽度太窄的为NG

原图:

在这里插入图片描述

处理程序:

read_image (Image, '1.png')rgb1_to_gray(Image, GrayImage)threshold(GrayImage, Region, 130, 255)connection (Region, ConnectedRegions)select_shape(ConnectedRegions, SelectedRegions, 'area', 'and', 10000, 99999)opening_circle(SelectedRegions, RegionOpening, 2.5)get_image_size (GrayImage, Width, Height)distance_transform (RegionOpening, DistanceImage, 'city-block', 'true', Width, Height)threshold (DistanceImage, Regions, 6, 127)fill_up(Regions, RegionFillUp)erosion_circle (RegionFillUp, RegionErosion, 2.5)skeleton (RegionErosion, Skeleton)junctions_skeleton (Skeleton, EndPoints, JuncPoints)dilation_circle (EndPoints, RegionDilation, 10.5)dilation_circle (JuncPoints, RegionDilation1, 5.5)difference (Skeleton, RegionDilation, RegionDifference)difference (RegionDifference, RegionDilation1, RegionDifference1)gen_contours_skeleton_xld (RegionDifference1, Contours, 1, 'filter')union_adjacent_contours_xld (Contours, UnionContours, 50, 5, 'attr_keep')smooth_contours_xld (UnionContours, SmoothedContours, 23)select_shape_xld(SmoothedContours, SelectedXLD, 'contlength', 'and', 500, 99999)dev_display (GrayImage)dev_display (SelectedXLD)1234567891011121314151617181920212223

处理结果:

在这里插入图片描述

转载自:

https://blog.csdn.net/cashmood/article/details/102728854


本文出自勇哥的网站《少有人走的路》wwww.skcircle.com,转载请注明出处!讨论可扫码加群:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

会员中心
搜索
«    2024年4月    »
1234567
891011121314
15161718192021
22232425262728
2930
网站分类
标签列表
最新留言
    热门文章 | 热评文章 | 随机文章
文章归档
友情链接
  • 订阅本站的 RSS 2.0 新闻聚合
  • 扫描加本站机器视觉QQ群,验证答案为:halcon勇哥的机器视觉
  • 点击查阅微信群二维码
  • 扫描加勇哥的非标自动化群,验证答案:C#/C++/VB勇哥的非标自动化群
  • 扫描加站长微信:站长微信:abc496103864
  • 扫描加站长QQ:
  • 扫描赞赏本站:
  • 留言板:

Powered By Z-BlogPHP 1.7.2

Copyright Your skcircle.com Rights Reserved.

鄂ICP备18008319号


站长QQ:496103864 微信:abc496103864