当前位置:网站首页>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 :

边栏推荐
- 小程序插件接入、开发与注意事项
- Redis client
- Solr basic operation 1
- Metaq cluster installation test
- Cacti最大监控数测试
- 基于OpenStack的虚拟机在线迁移
- Overseas digital authentication service provider advance AI was selected into the "2022 brand sea Service Market Research Report" of equalocean
- C pointer advanced 1-- > character pointer, array pointer, pointer and array parameter transfer, function pointer
- Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column
- Bee常用配置
猜你喜欢

6.29 problem solving

小程序插件接入、开发与注意事项

Jetpack之Room的使用,结合Flow

Construction of module 5 of actual combat Battalion

Start harvesting! Nailing: adjust the maximum number of free users of "nailing team". If the number exceeds 10, it will not work normally

SQL question brushing 595 Big country

6.28日刷题题解

Under the epidemic, I left my job for a year, and my income increased 10 times

收藏!这些提高程序员生产力的工具你用过吗?

Matlab exercises -- program control process exercise
随机推荐
xutils3传集合
Pytest initializing and cleaning up the environment
Solr基础操作4
動態代理的實現原理
Dépannage de l'étiquette: impossible d'ouvrir l'image marquée
LC:最大子数组和
剑指 Offer 14- II. 剪绳子 II
shell-位置参数变量和预定义变量
LC: maximum subarray and
剑指 Offer 14- I. 剪绳子
數莓派 4怎麼樣?可能的玩法有哪些?
Is it safe to open a stock account? Shanghai stock account opening.
Ingenious application of golang generics to prevent null pointer errors of variables and structural fields
RRDTOOL draws MRTG log data
Under the epidemic, I left my job for a year, and my income increased 10 times
Use of jetpack's room in combination with flow
Cacti最大监控数测试
High performance and high availability computing architecture of "Weibo comments"
25 interview questions about Apache
label问题排查:打不开标注好的图像