halcon像素统计_基于Halcon像素精度的边缘提取学习

本文通过Halcon的get_region_contour算子详细介绍了边缘提取过程,包括轮廓点的坐标获取、距离计算和应用实例,展示了如何利用Halcon进行像素精度的边缘检测和分析。
摘要由CSDN通过智能技术生成

本文主要围绕Halcon的边缘提取中的一个算子get_region_contour展开学习

1.get_region_contour

该算子检测图像中线条及其宽度被广泛应用;

Signature

get_region_contour(Region: : :Rows,Columns)

Region:(input_object)输入图像的感兴趣区域

Rows:(output_control)  轮廓的Y的坐标点

Columns:(output_control)  轮廓的X坐标点

Halcon例程1:

提取前图片:

dev_close_window ()

read_image (Image, 'mreut')

dev_open_window (0, 0, 512, 512, 'white', WindowID)

dev_display (Image)

dev_set_color ('black')

threshold (Image, Region, 180, 255)

dev_clear_window ()

dev_display (Region)

connection (Region, ConnectedRegions)

select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10000, 100000000)

get_region_contour (SelectedRegions, Rows, Columns)

RowLine1 := 5

ColLine1 := 300

RowLine2 := 300

ColLine2 := 400

NumberTuple := |Rows|

dev_set_color ('red')

disp_line (WindowID, RowLine1, ColLine1, RowLine2, ColLine2)

dev_set_color ('green')

* Calculate the distance between points of the contour

* of the selected region and the displayed line</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值