当前位置:网站首页>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
边栏推荐
- Guess riddles (2)
- Apaas platform of TOP10 abroad
- Array integration initialization (C language)
- Business modeling of software model | overview
- MATLAB小技巧(28)模糊综合评价
- [three tier architecture]
- Lori remote control LEGO motor
- 整形的分类:short in long longlong
- [daily training] 1200 Minimum absolute difference
- STM32 --- configuration of external interrupt
猜你喜欢
Array integration initialization (C language)
L298N module use
猜谜语啦(142)
Business modeling of software model | overview
Business modeling of software model | object modeling
Example 005: three numbers sorting input three integers x, y, Z, please output these three numbers from small to large.
Various types of questions judged by prime numbers within 100 (C language)
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
STM32 single chip microcomputer - bit band operation
Guess riddles (11)
随机推荐
猜谜语啦(4)
Several problems to be considered and solved in the design of multi tenant architecture
Basic number theory - fast power
99 multiplication table (C language)
[daily training] 1200 Minimum absolute difference
Shift operation of complement
How apaas is applied in different organizational structures
Example 003: a complete square is an integer. It is a complete square after adding 100, and it is a complete square after adding 168. What is the number?
Lori remote control commissioning record
图解八道经典指针笔试题
One question per day - replace spaces
Infected Tree(树形dp)
Example 001: the number combination has four numbers: 1, 2, 3, 4. How many three digits can be formed that are different from each other and have no duplicate numbers? How many are each?
ABC#237 C
319. 灯泡开关
Low code platform | apaas platform construction analysis
UE像素流,来颗“减肥药”吧!
Program error record 1:valueerror: invalid literal for int() with base 10: '2.3‘
STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
[daily training -- Tencent selected 50] 557 Reverse word III in string