当前位置:网站首页>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
边栏推荐
- STM32---ADC
- 实例002:“个税计算” 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.
- STM32 single chip microcomputer -- volatile keyword
- Daily question - input a date and output the day of the year
- Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
- STM32 single chip microcomputer - external interrupt
- 猜谜语啦(5)
- Explore the authentication mechanism of StarUML
- PIP installation
- 猜谜语啦(10)
猜你喜欢
剑指 Offer 05. 替换空格
Sword finger offer 09 Implementing queues with two stacks
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
Count the number of inputs (C language)
Digital analog 1: linear programming
猜谜语啦(8)
Low code platform | apaas platform construction analysis
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?
Example 009: pause output for one second
Business modeling of software model | object modeling
随机推荐
Five design details of linear regulator
U8g2 drawing
Several problems to be considered and solved in the design of multi tenant architecture
Digital analog 2: integer programming
【三层架构及JDBC总结】
319. Bulb switch
Low code platform | apaas platform construction analysis
STM32---IIC
剑指 Offer 05. 替换空格
Guess riddles (7)
实例005:三数排序 输入三个整数x,y,z,请把这三个数由小到大输出。
Meizu Bluetooth remote control temperature and humidity access homeassistant
【日常训练】1200. 最小绝对差
How to manage the performance of R & D team?
每日一题——替换空格
猜谜语啦(11)
leetcode - 445. Add two numbers II
Daily question - input a date and output the day of the year
Typescript hands-on tutorial, easy to understand
剑指 Offer 06. 从尾到头打印链表