当前位置:网站首页>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)
边栏推荐
- 猜谜语啦(5)
- Several problems to be considered and solved in the design of multi tenant architecture
- Example 009: pause output for one second
- 319. Bulb switch
- 暑假第一周
- Infix expression evaluation
- [nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)
- How apaas is applied in different organizational structures
- Reasons for the insecurity of C language standard function scanf
- 剑指 Offer 06. 从尾到头打印链表
猜你喜欢
Apaas platform of TOP10 abroad
Business modeling of software model | stakeholders
[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)
Example 009: pause output for one second
leetcode - 445. Add two numbers II
图解八道经典指针笔试题
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
剑指 Offer 09. 用两个栈实现队列
MATLAB小技巧(28)模糊綜合評價
猜谜语啦(10)
随机推荐
Infected Tree(树形dp)
Example 007: copy data from one list to another list.
每日一题——替换空格
第十八章 使用工作队列管理器(一)
猜谜语啦(5)
Pytorch entry record
Some pitfalls of win10 network sharing
Classification of plastic surgery: short in long long long
leetcode - 445. Add two numbers II
319. Bulb switch
UE pixel stream, come to a "diet pill"!
[daily training] 1200 Minimum absolute difference
猜谜语啦(142)
Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
猜谜语啦(8)
Guess riddles (10)
Basic number theory -- Euler function
Xrosstools tool installation for X-Series
【NOI模拟赛】汁树(树形DP)
【日常训练--腾讯精选50】557. 反转字符串中的单词 III