当前位置:网站首页>Halcon实用:焊点检出设计思路
Halcon实用:焊点检出设计思路
2022-06-29 23:05:00 【无水先生】
一、提要
本文是Blob示例之一,利用灰度阈值进行的分割的方法,进行焊点检测的算法思路。
二、问题分析
电路板的图片如下:焊点是上面黑色圆形区域。

问题分析:
1)包含焊点的区域确定
焊点为暗色目标区域
,而焊点的分布区域在较亮区域W,
,因此,需要将大集合M优先提出。
*灰度处理 二值化
threshold (Bond, Bright, 100, 255)
*形态学处理 一般用于定位,形状转换,rectangle2带方向的矩形
shape_trans (Bright, Die, 'rectangle2')2) 通过浅区提取出背景M
3)通过 shape_trans 将浅色区域的矩形取出。
注意:以上将包含前景的区域提出来,缩小了搜索范围;以后操作在更小的区域上进行。通过reduce_domain将区域中的图像取出,准备进行第二次处理。
reduce_domain (Bond, Die, DieGrey)4)在区域中暗区提取出来
threshold (DieGrey, Wires, 0, 50)5)将焊点面积计算出,并获得区域
*用给定的形状特征填充区域:面积为1~100的区域
fill_up_shape (Wires, WiresFilled, 'area', 1, 100)6)将半径大于15.5圆形,通过开运算提取出
opening_circle (WiresFilled, Balls, 15.5)7)将区域分离开来
connection (Balls, SingleBalls)8)将圆度0.85以上的区域保留下来
select_shape (SingleBalls, IntermediateBalls, 'circularity', 'and', 0.85, 1.0)
sort_region (IntermediateBalls, FinalBalls, 'first_point', 'true', 'column')9)将最小区域排序
smallest_circle (FinalBalls, Row, Column, Radius)
NumBalls := |Radius|
Diameter := 2*Radius
meanDiameter := sum(Diameter)/NumBalls
mimDiameter := min(Diameter)
dev_display (Bond)
disp_circle (WindowID, Row, Column, Radius)
dev_set_color ('white')
for i := 1 to NumBalls by 1
if (fmod(i,2)=1)
disp_message (WindowID, 'D: '+Diameter[i-1], 'image', Row[i-1]-2.7*Radius[i-1], max([Column[i-1]-60,0]), 'white', 'false')
else
disp_message (WindowID, 'D: '+Diameter[i-1], 'image', Row[i-1]+1.2*Radius[i-1], max([Column[i-1]-60,0]), 'white', 'false')
endif
endfor10)结果输出:

边栏推荐
- Discussion on distributed unique ID generation scheme
- SQL question brushing 595 Big country
- InfluxDB时序数据库系统
- Evolution from stand-alone to distributed database storage system
- Use the leader election mechanism in kubernetes to complete your own ha application
- 均值、方差、标准差、协方差的概念及意义
- C pointer advanced 2-- > function pointer array callback function simplifies calculator code, and implements qsort function based on callback function simulation
- How ZABBIX 5.0 adds esxi6.7 to monitoring
- MetaQ集群安装测试
- Deep parsing of kubernetes controller runtime
猜你喜欢

众昂矿业:萤石助力氟产业锂电建设发展

缓冲流练习

Node data collection and remote flooding transmission of label information

Go zero micro Service Practice Series (VII. How to optimize such a high demand)

Sword finger offer 38 Arrangement of strings

Leetcode(680)——验证回文字符串 Ⅱ

Open source the Ernie tiny lightweight technology of "Wenxin big model", which is accurate and fast, with full effect

新钛云服荣膺“2022爱分析 · IT运维厂商全景报告”云管理平台CMP 代表厂商!...

论文阅读《Large-Scale Direct SLAM with Stereo Cameras》

微博系统中”微博评论“的高性能高可用计算架构
随机推荐
80-Redis详解
搭建企业级NTP时间服务器
Discussion on distributed unique ID generation scheme
Solution to version conflict of flutter plug-in
什么是IGMP?IGMP与ICMP有啥区别?
MetaQ集群安装测试
SYSTEMd debugging
Label Troubleshooting: unable to open the marked image
matplotlib matplotlib中plt.hist()参数解释
M1笔记本居家办公的痛点及解决方案 | 社区征文
疫情下我离职一年,收入增长了10倍
Touch key and key control corresponding LED status reversal
Collection! Have you ever used these tools to improve programmer productivity?
pytest初始化和清理环境
Sword finger offer 38 Arrangement of strings
Database - playful data -pgsql uses UUID as primary key
sql刷题595. 大的国家
软件测试 接口测试 Postman测试工具 接口测试的流程 执行接口测试 接口关联 环境变量和全局变量 内置动态参数以及自动有的动态参数
采购数智化爆发在即,支出宝“3+2“体系助力企业打造核心竞争优势
Qdomdocument and qdomnode are used in QT to read XML