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


边栏推荐
- Latex improve
- C language data type replacement
- 图解八道经典指针笔试题
- Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase
- 2022.7.4-----leetcode.1200
- Old Wang's esp8266 and old Wu's ws2818 light strip
- STM32 single chip microcomputer -- volatile keyword
- 猜谜语啦(142)
- Esphone retrofits old fans
- Cmder of win artifact
猜你喜欢

Guess riddles (2)

Count the number of inputs (C language)

实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?

319. Bulb switch

STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)

Agile project management of project management

Example 004: for the day of the day, enter a day of a month of a year to judge the day of the year?

猜谜语啦(10)

猜谜语啦(4)

Guess riddles (8)
随机推荐
实例007:copy 将一个列表的数据复制到另一个列表中。
Bluebridge cup internet of things competition basic graphic tutorial - clock selection
Lori remote control commissioning record
Various types of questions judged by prime numbers within 100 (C language)
Guess riddles (4)
实例005:三数排序 输入三个整数x,y,z,请把这三个数由小到大输出。
MATLAB小技巧(28)模糊綜合評價
How apaas is applied in different organizational structures
Infected Tree(树形dp)
STM32 --- NVIC interrupt
2022.7.4-----leetcode. one thousand and two hundred
STM32---ADC
STM32 single chip microcomputer - external interrupt
Basic number theory - fast power
猜谜语啦(8)
STM32 --- configuration of external interrupt
696. 计数二进制子串
Mathematical modeling: factor analysis
轮子1:QCustomPlot初始化模板
Infix expression evaluation