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


边栏推荐
- 696. 计数二进制子串
- 關於線性穩壓器的五個設計細節
- Pytorch entry record
- Numpy pit: after the addition of dimension (n, 1) and dimension (n,) array, the dimension becomes (n, n)
- Infix expression evaluation
- Guess riddles (3)
- Shell script
- Illustration of eight classic pointer written test questions
- Business modeling of software model | object modeling
- Infected Tree(树形dp)
猜你喜欢

L298N module use

TypeScript手把手教程,简单易懂

实例006:斐波那契数列

319. Bulb switch

An enterprise information integration system
![[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)](/img/3b/c94b8466370f4461875c85b4f66860.png)
[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)

Sword finger offer 09 Implementing queues with two stacks

leetcode - 445. Add two numbers II

Bluebridge cup internet of things basic graphic tutorial - GPIO input key control LD5 on and off

Classification of plastic surgery: short in long long long
随机推荐
U8g2 drawing
MATLAB小技巧(28)模糊綜合評價
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
实例001:数字组合 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
696. 计数二进制子串
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
STM32 --- configuration of external interrupt
Illustration of eight classic pointer written test questions
【日常训练--腾讯精选50】557. 反转字符串中的单词 III
剑指 Offer 09. 用两个栈实现队列
One question per day - replace spaces
Shift operation of complement
Arduino+a4988 control stepper motor
猜谜语啦(11)
猜谜语啦(3)
MATLAB小技巧(28)模糊综合评价
Run菜单解析
[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)
How apaas is applied in different organizational structures
2022.7.4-----leetcode.1200