halcon例程解析:检查饼干的质量——check_hazelnut_wafers
This example demonstrates a quality inspection on hazelnut wavers. Using the morphology tools the waver is extracted and examined according to a few shape features like Rectangularity and AreaHoles. This program also shows the use of the operator area_holes.
这个例子展示了饼干的质量检验。利用形态学工具,根据矩形和面积孔等一些形状特征提取和检测抖动。这个程序还展示了算子area_holes的用法。
1. 效果展示


2. 思路分析
解决这个问题的基础是饼干部分灰度值比较高,碎裂的部分灰度值低。
- 自动阈值分割
- 形态学处理
- 计算孔洞面积
- 计算矩形的形状因子
2.1自动阈值分割
* 自动阈值分割
binary_threshold(Image, Foreground, 'smooth_histo', 'light', UsedThreshold)

最低0.47元/天 解锁文章
248

被折叠的 条评论
为什么被折叠?



