halcon轮廓擦除_【Halcon】轮廓处理

本文详细介绍了Halcon中处理轮廓的步骤,包括创建XLD轮廓、处理XLD轮廓、拟合轮廓、提取特征以及轮廓转换。通过实例展示了如何消除边缘噪声、合并共线轮廓以及通过fit_line_contour_xld和fit_circle_contour_xld进行线段和圆的逼近。
摘要由CSDN通过智能技术生成

82664954_1.jpg

Coutours 属于XLD结构

a) 图  边缘覆盖在原始图像上

b)缩放 a)中的 矩形区域,凸显控制点

c)轮廓可以分割成线。圆。椭圆等,可以得出它们的 角度 中心 半径等

Basic Concept

82664954_2.png

create XLD contours

最常用的方法是 用Extract Edges Or Lines方法,结果将转化为XLD

82664954_3.jpg

Process XLD Contours

典型的情况 如 a)所示,只作用于指定的区域

许多时候 ROI选择过大 如图 b) ,这个时候要把 轮廓进行分割,只选择平行的部分 如图 c)

另外的原因,处理轮廓是因为包换了不希望得到的噪声,比如低对比度。

Perform Fitting

通过 fitting 操作,(a line, a rectangle, or a circular or elliptic arc,)来逼近(a line, a rectangle, or a circular or elliptic arc)。

Extract Features

From both raw contours and processed contour parts features can be determined. Some of these consider

the contour as a linear object. Others treat a contour as the outer boundary of an object. Obviously,

the center of gravity makes sense only for a closed object, whereas the curvature is a feature of a linear

object.

例子 提取公路

82664954_4.jpg

***************************************************************

*   1.lines_gauss 结果图a)所示 得到许多不想要的 小片段

*   2.select_contours_xld(Lines,LongContours,'contour_length',15,1000,0,0) 选择[15,1000]轮廓长度 这样就消除了小的轮廓

*   3.union_collinear_contours_xld (LongContours, UnionContours, 30, 2, 9, 0.7, 'attr_keep') 把共线的轮廓连接在一起。结果 如图b)

*

********************************************************

read_image(Image,'mreut4_3')

get_image_size(Image,Width,Height)

dev_close_window()

dev_open_window(0,0,Width,Height,'black',WindowID)

lines_gauss(Image,Lines,1.5,2,8,'light','true','bar-shaped','true')

select_contours_xld(Lines,LongContours,'contour_length',15,1000,0,0)

union_collinear_contours_xld (LongContours, UnionContours, 30, 2, 9, 0.7, \

'attr_keep')

Extended Concept

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值