根据硬币测试圆形物体面积
* Image Acquisition 01: Code generated by Image Acquisition 01
open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'gray', -1, 'false', 'default', '[1] ', 0, -1, AcqHandle)
grab_image_start (AcqHandle, -1)
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowID)
while (true)
grab_image_async (Image, AcqHandle, -1)
gauss_filter (Image, ImageGauss, 7)
threshold (ImageGauss, Regions, 44, 239)
connection (Regions, ConnectedRegions)
fill_up (ConnectedRegions, RegionFillUp)
select_shape (RegionFillUp, SelectedRegions, 'area', 'and', 75229.4, 2e+006)
select_shape (SelectedRegions, SelectedRegions1, 'area', 'and', 0, 701835)
smallest_circle (SelectedRegions1, Row, Column, Radius)
coin_r := Radius
coin_area := pow(coin_r,2) * 3.1415926
area_rate := coin_area/4.90625
r_rate := coin_r/1.25
halcon脚本根据硬币估计圆形面积
最新推荐文章于 2024-07-01 14:33:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)