当前位置:网站首页>Halcon snap, get the area and position of coins
Halcon snap, get the area and position of coins
2022-07-05 08:40:00 【Aii parson】
* Image Acquisition 02: Code generated by Image Acquisition 02
open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'gray', -1, 'false', 'default', '[1] Webcam C170', 0, -1, AcqHandle)
grab_image_start (AcqHandle, -1)
dev_close_window ()
dev_open_window (0, 0, 718, 512, 'black', WindowHandle)
while (true)
grab_image_async (Image, AcqHandle, -1)
threshold (Image, Region, 145, 254)
dev_display (Region)
opening_circle (Region, RegionOpening, 15)
dev_display (RegionOpening)
connection (RegionOpening, ConnectedRegions)
dev_display (ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, ['area','circularity'], 'and', [100,0.49719], [10000,2])
dev_display (SelectedRegions)
area_center (SelectedRegions, Area, Row, Column)# Get the area and center of the area
*smallest_circle (SelectedRegions, Row, Column, Radius)
*Diameter := 2*Radius
*disp_circle (WindowHandle, Row, Column, Radius)
disp_message (WindowHandle, ' area :'+Area+' Central coordinates :'+Row+' '+Column, 'window', 0, 0, 'blue', 'true')
*disp_message (WindowHandle, 'D: ' + Diameter$'.4', 'image', Row - 2 * Radius, Column, 'white', 'false')
endwhile
close_framegrabber (AcqHandle)
边栏推荐
- How apaas is applied in different organizational structures
- [daily training -- Tencent selected 50] 557 Reverse word III in string
- Example 006: Fibonacci series
- Typescript hands-on tutorial, easy to understand
- Guess riddles (10)
- Sword finger offer 09 Implementing queues with two stacks
- C语言标准函数scanf不安全的原因
- 实例007:copy 将一个列表的数据复制到另一个列表中。
- 关于线性稳压器的五个设计细节
- 猜谜语啦(9)
猜你喜欢
图解八道经典指针笔试题
L298N module use
Example 004: for the day of the day, enter a day of a month of a year to judge the day of the year?
Apaas platform of TOP10 abroad
Low code platform | apaas platform construction analysis
STM32 lights up the 1.8-inch screen under Arduino IDE
Shift operation of complement
【NOI模拟赛】汁树(树形DP)
Guess riddles (7)
Explore the authentication mechanism of StarUML
随机推荐
ABC#237 C
EA introduction notes
轮子1:QCustomPlot初始化模板
Arduino+a4988 control stepper motor
猜谜语啦(7)
leetcode - 445. 两数相加 II
STM32 single chip microcomputer - external interrupt
STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
Meizu Bluetooth remote control temperature and humidity access homeassistant
实例002:“个税计算” 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.
暑假第一周
99 multiplication table (C language)
Infix expression evaluation
STM32 --- serial port communication
Count the number of inputs (C language)
Esphone retrofits old fans
Sword finger offer 06 Print linked list from end to end
Stm32--- systick timer
696. 计数二进制子串
MATLAB skills (28) Fuzzy Comprehensive Evaluation