当前位置:网站首页>Halcon practical: design idea of solder joint detection
Halcon practical: design idea of solder joint detection
2022-06-29 23:49:00 【Mr anhydrous】
One 、 summary
This article is about Blob Example one , The method of segmentation using gray threshold , The algorithm of solder joint detection .
Two 、 Problem analysis
The picture of the circuit board is as follows : The solder joint is the black circular area above .

Problem analysis :
1) The area containing the solder joint is determined
The solder joint is a dark target area
, The distribution area of solder joint is in the bright area W,
, therefore , You need to put a large set M Give priority to .
* Grayscale processing Two valued
threshold (Bond, Bright, 100, 255)
* Morphological processing Generally used to locate , Shape conversion ,rectangle2 Rectangle with direction
shape_trans (Bright, Die, 'rectangle2')2) Extract the background through shallow area M
3) adopt shape_trans Take out the rectangle of the light colored area .
Be careful : Then the area containing the foreground is brought forward , Narrowed the search ; Later, the operation will be carried out in a smaller area . adopt reduce_domain Take out the image in the area , Prepare for the second treatment .
reduce_domain (Bond, Die, DieGrey)4) Extract the dark areas in the region
threshold (DieGrey, Wires, 0, 50)5) Calculate the welding spot area , And get the area
* Fill the area with the given shape feature : Area is 1~100 Region
fill_up_shape (Wires, WiresFilled, 'area', 1, 100)6) Make the radius greater than 15.5 circular , Extract by open operation
opening_circle (WiresFilled, Balls, 15.5)7) Separate the area
connection (Balls, SingleBalls)8) Change roundness 0.85 The above areas are preserved
select_shape (SingleBalls, IntermediateBalls, 'circularity', 'and', 0.85, 1.0)
sort_region (IntermediateBalls, FinalBalls, 'first_point', 'true', 'column')9) Sort the smallest area
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) Results output :

边栏推荐
- Solr基础操作1
- Which securities company is good for opening a mobile account? In addition, is it safe to open a mobile account?
- 机器学习:VC维的概念和用途
- Halcon实用:焊点检出设计思路
- Speech signal processing (III): speech signal analysis [continuous "analog signal" -- Sampling, quantization, coding -- > discrete "digital signal"]
- 剑指 Offer 13. 机器人的运动范围
- Solr basic operation 4
- RRDTOOL draws MRTG log data
- matplotlib matplotlib中plt.hist()参数解释
- 333333333333333333333333333333
猜你喜欢

333333333333333333333333333333

这个简单的小功能,半年为我们产研团队省下213个小时

Head on Amway! Good looking and practical motor SolidWorks model material see here

Halcon实用:焊点检出设计思路
discrete "digital signal"]"/>Speech signal processing (III): speech signal analysis [continuous "analog signal" -- Sampling, quantization, coding -- > discrete "digital signal"]

记一次排查线上MySQL死锁过程,不能只会curd,还要知道加锁原理

Yunhe enmo, gaiguoqiang, identify it and grasp it before the domestic database boils

【一起上水硕系列】Day 8

Yunhe enmo Guoqiang, identifiez - le, saisissez - le, avant l'ébullition de la base de données nationale

SQL question brushing 595 Big country
随机推荐
333333333333333333333333333333
Profit distribution and taxation of funds
Speech signal processing (III): speech signal analysis [continuous "analog signal" -- Sampling, quantization, coding -- > discrete "digital signal"]
小程序插件接入、开发与注意事项
LC: maximum subarray and
111. simple chat room 14: chat room client
Is it safe to open a stock account? Shanghai stock account opening.
简单理解B树和B+树
Golang泛型的巧妙应用,防止变量空指针错误,防止结构体字段空指针错误
剑指 Offer 15. 二进制中1的个数
The concept and significance of mean, variance, standard deviation and covariance
Sword finger offer 15 Number of 1 in binary
matlab习题 —— 程序控制流程练习
开始“收割”!钉钉调整“钉钉Teambition”免费用人数上限,超十人将无法正常用
Collection! Have you ever used these tools to improve programmer productivity?
Solr basic operation 4
Which securities company should I choose to open an account online? Also, is it safe to open an account online?
剑指 Offer 13. 机器人的运动范围
Fund valuation, expenses and accounting
6.29日刷题题解