当前位置:网站首页>Halcon blob analysis (ball.hdev)
Halcon blob analysis (ball.hdev)
2022-07-05 08:40:00 【Aii parson】
* ball.hdev: Inspection of Ball Bonding
*
dev_update_window ('off')# Stop updating the form
dev_close_window ()# Closing Windows
dev_open_window (0, 0, 728, 512, 'black', WindowID)# create a window , And specify the handle
read_image (Bond, 'die/die_03')
dev_display (Bond)
set_display_font (WindowID, 14, 'mono', 'true', 'false')
disp_continue_message (WindowID, 'black', 'true')
stop ()
threshold (Bond, Bright, 100, 255)# Two valued , Gray histogram tool
shape_trans (Bright, Die, 'rectangle2')# Shape change , Obtain the minimum circumscribed rectangle of the connected domain of a binary graph
dev_set_color ('green')
dev_set_line_width (3)
dev_set_draw ('margin')# Show edges
dev_display (Die)
disp_continue_message (WindowID, 'black', 'true')
stop ()
reduce_domain (Bond, Die, DieGrey)# Reduced area ( get ROI), amount to Intercept the main parts that need to be studied . Reduce the definition domain of the given image to the specified new area , Does not reduce the actual size of the image , The new area must be a sub area of the original area
threshold (DieGrey, Wires, 0, 50)
fill_up_shape (Wires, WiresFilled, 'area', 1, 100)
dev_display (Bond)
dev_set_draw ('fill')# Show fill
dev_set_color ('red')
dev_display (WiresFilled)
disp_continue_message (WindowID, 'black', 'true')
stop ()
opening_circle (WiresFilled, Balls, 15.5)# Reduce pixels , Remove isolated dots 、 Burr and bridge ;Circle It has the greatest effect on the circle .
dev_set_color ('green')
dev_display (Balls)
disp_continue_message (WindowID, 'black', 'true')
stop ()
connection (Balls, SingleBalls)# Disconnect connected domain
select_shape (SingleBalls, IntermediateBalls, 'circularity', 'and', 0.85, 1.0)# Select the target circle through roundness
// The sorting step can be omitted , Unless you need to display the parameters of some targets ( If only the 2-3 The circumscribed circle diameter of )
sort_region (IntermediateBalls, FinalBalls, 'first_point', 'true', 'column')# Sort area , Sort by column , First ascending from the left
dev_display (Bond)
dev_set_colored (12)
dev_display (FinalBalls)
disp_continue_message (WindowID, 'black', 'true')
stop ()
smallest_circle (FinalBalls, Row, Column, Radius)# Obtain the minimum circumscribed circle parameter of each region
NumBalls := |Radius|
Diameter := 2 * Radius
meanDiameter := mean(Diameter)# Omission ( Not quoted later )
minDiameter := min(Diameter)# Omission
dev_display (Bond)# Show the original
disp_circle (WindowID, Row, Column, Radius)# Display circle
dev_set_color ('white')
disp_message (WindowID, 'D: ' + Diameter$'.4', 'image', Row - 2 * Radius, Column, 'white', 'false')# Use image coordinates to display “ The diameter of ” Information
dev_update_window ('on')# Update Form
边栏推荐
- 【日常训练】1200. 最小绝对差
- Guess riddles (11)
- Illustration of eight classic pointer written test questions
- Meizu Bluetooth remote control temperature and humidity access homeassistant
- MATLAB skills (28) Fuzzy Comprehensive Evaluation
- Guess riddles (9)
- Yolov4 target detection backbone
- 实例010:给人看的时间
- The first week of summer vacation
- 每日一题——替换空格
猜你喜欢
MATLAB skills (28) Fuzzy Comprehensive Evaluation
Low code platform | apaas platform construction analysis
Guess riddles (6)
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
Typical low code apaas manufacturer cases
STM32 --- NVIC interrupt
Guess riddles (7)
STM32 single chip microcomputer - external interrupt
图解八道经典指针笔试题
【三层架构】
随机推荐
Numpy pit: after the addition of dimension (n, 1) and dimension (n,) array, the dimension becomes (n, n)
轮子1:QCustomPlot初始化模板
MATLAB小技巧(28)模糊綜合評價
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
Explore the authentication mechanism of StarUML
STM32 single chip microcomputer - bit band operation
实例008:九九乘法表
Esp8266 interrupt configuration
Several problems to be considered and solved in the design of multi tenant architecture
C语言标准函数scanf不安全的原因
Example 007: copy data from one list to another list.
猜谜语啦(10)
猜谜语啦(9)
Daily question - input a date and output the day of the year
Arrangement of some library files
Program error record 1:valueerror: invalid literal for int() with base 10: '2.3‘
Guess riddles (8)
go依赖注入--google开源库wire
Basic number theory -- Euler function
Pytorch entry record