《Halcon 100项目-3》Halcon查找钢珠个数

Halcon查找钢珠个数

* Image Acquisition 02: Code generated by Image Acquisition 02
ImageFiles := []
ImageFiles[0] := 'D:/image/bilibili/photo/找圆 (1).bmp'
ImageFiles[1] := 'D:/image/bilibili/photo/找圆 (2).bmp'
ImageFiles[2] := 'D:/image/bilibili/photo/找圆 (3).bmp'
ImageFiles[3] := 'D:/image/bilibili/photo/找圆 (4).bmp'
for Index := 0 to |ImageFiles| - 1 by 1
    read_image (Image, ImageFiles[Index])
    * Image Acquisition 02: Do something
    binary_threshold (Image, Region, 'max_separability', 'light', UsedThreshold)
    opening_circle (Region, RegionOpening, 3.5)
    closing_circle (RegionOpening, RegionClosing, 113.5)
    smallest_circle (RegionClosing, Row, Column, Radius)
    gen_circle (Circle, Row, Column, Radius)
    reduce_domain (Image, Circle, ImageReduced)
    binary_threshold (ImageReduced, Region1, 'max_separability', 'dark', UsedThreshold1)
    opening_circle (Region1, RegionOpening1, 100.5)
    connection (RegionOpening1, ConnectedRegions)
    shape_trans (ConnectedRegions, RegionTrans, 'outer_circle')
    count_obj (RegionTrans, Number)
    dev_display (Image)
    
    set_display_font (200000, 40, 'mono', 'true', 'false')
    dev_display (RegionTrans)
    disp_message (200000, 'total:'+Number, 'Image', 0, 0, 'black', 'true')
    
    wait_seconds (1)
    
    
    
    
    
    
endfor


运行结果
在这里插入图片描述
原图
请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值