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

边栏推荐
- Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column
- matplotlib matplotlib可视化之柱状图plt.bar()
- Divisor
- 海外数字身份验证服务商ADVANCE.AI入选EqualOcean《2022品牌出海服务市场研究报告》
- Create an API rapid development platform, awesome!
- 网上开户选哪个证券公司?还有,在线开户安全么?
- C指针进阶1-->字符指针,数组指针,指针与数组传参,函数指针
- Solution to version conflict of flutter plug-in
- C pointer advanced 1-- > character pointer, array pointer, pointer and array parameter transfer, function pointer
- 6.29 problem solving
猜你喜欢

大厂试水 HPE推出Arm CPU通用服务器产品

数莓派 4怎么样?可能的玩法有哪些?

M1笔记本居家办公的痛点及解决方案 | 社区征文

Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column

HPE launched ARM CPU general server product

Remember the process of checking online MySQL deadlock. You should not only know curd, but also know the principle of locking

Incluxdb time series database system

matplotlib matplotlib中plt.hist()参数解释

【一起上水硕系列】Day 8

简单理解B树和B+树
随机推荐
6.28日刷题题解
Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column
剑指 Offer 13. 机器人的运动范围
C pointer advanced 1-- > character pointer, array pointer, pointer and array parameter transfer, function pointer
MetaQ集群安装测试
LC:最大子数组和
云服务器的安全设置常识
How about counting Berry Pie 4? What are the possible ways to play?
Collection! Have you ever used these tools to improve programmer productivity?
Speech signal processing (III): speech signal analysis [continuous "analog signal" -- Sampling, quantization, coding -- > discrete "digital signal"]
Regular expressions: characters (2)
pytest初始化和清理环境
matlab习题 —— 程序控制流程练习
I wonder if I can open an account today? In addition, is it safe to open an account online now?
Sword finger offer 13 Range of motion of robot
Effective self summary of remote communication | community essay solicitation
[LeetCode] 只出现一次的数字【136】
剑指 Offer 15. 二进制中1的个数
声网自研传输层协议 AUT 的落地实践丨Dev for Dev 专栏
Xutils3 transfer set