当前位置:网站首页>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)
边栏推荐
- Bit operation related operations
- STM32---IIC
- 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?
- 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
- 实例010:给人看的时间
- Shift operation of complement
- 【三层架构及JDBC总结】
- Example 004: for the day of the day, enter a day of a month of a year to judge the day of the year?
- Affected tree (tree DP)
- [daily training] 1200 Minimum absolute difference
猜你喜欢
Sword finger offer 05 Replace spaces
Business modeling of software model | stakeholders
实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
How apaas is applied in different organizational structures
猜谜语啦(9)
Count the number of inputs (C language)
Lori remote control commissioning record
EA introduction notes
Classification of plastic surgery: short in long long long
STM32---IIC
随机推荐
PIP installation
Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
【日常训练--腾讯精选50】557. 反转字符串中的单词 III
【日常訓練--騰訊精選50】557. 反轉字符串中的單詞 III
【三层架构】
[three tier architecture]
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?
第十八章 使用工作队列管理器(一)
An enterprise information integration system
Arrangement of some library files
猜谜语啦(5)
Numpy 小坑:维度 (n, 1) 和 维度 (n, ) 数组相加运算后维度变为 (n, n)
leetcode - 445. Add two numbers II
Agile project management of project management
My university
[three tier architecture and JDBC summary]
Example 004: for the day of the day, enter a day of a month of a year to judge the day of the year?
Is the security account given by Yixue school safe? Where can I open an account
287. 寻找重复数-快慢指针
How apaas is applied in different organizational structures