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

边栏推荐
- 请指教什么是在线开户?另外,手机开户安全么?
- 软件测试 接口测试 Jmeter 5.5 安装教程
- Procurement intelligence is about to break out, and the "3+2" system of Alipay helps enterprises build core competitive advantages
- C指针进阶1-->字符指针,数组指针,指针与数组传参,函数指针
- I wonder if I can open an account today? In addition, is it safe to open an account online now?
- FPGA开发(2)——IIC通信
- LC:有效的数独 + 旋转图像
- 大厂试水 HPE推出Arm CPU通用服务器产品
- RRDTOOL draws MRTG log data
- InfluxDB时序数据库系统
猜你喜欢

333333333333333333333333333333

剑指 Offer 14- I. 剪绳子

打造一个 API 快速开发平台,牛逼!

开始“收割”!钉钉调整“钉钉Teambition”免费用人数上限,超十人将无法正常用

云服务器的安全设置常识

AI empowers new retail, the way to win "wisdom" lies in ecological thinking | selected excerpts from digital intelligence night talk live broadcast

剑指 Offer 13. 机器人的运动范围

Redis client

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

AI赋能新零售,「智」胜之道在于生态思维|数智夜话直播精选摘录
随机推荐
数莓派 4怎么样?可能的玩法有哪些?
Under the epidemic, I left my job for a year, and my income increased 10 times
label问题排查:打不开标注好的图像
Cacti关于spine轮询的设置
Implementation principle of dynamic agent
我想知道今天还可以开户么?另外想问,现在在线开户安全么?
Software testing interface testing postman testing tool interface testing process execution interface testing interface associated environment variables and global variables built-in dynamic parameter
Effective self summary of remote communication | community essay solicitation
RRDtool 画MRTG Log数据
软件测试 接口测试 Jmeter 5.5 安装教程
Sword finger offer 14- ii Cutting rope II
matlab习题 —— 程序控制流程练习
Is it safe to open a stock account? Shanghai stock account opening.
Matplotlib plt Hist() parameter explanation
均值、方差、标准差、协方差的概念及意义
Solr basic operation 2
Official website of Greentree
为什么 JSX 语法这么香?
十大券商:“推土机行情”再现
LC: effective Sudoku + rotating image