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

本文详细介绍了使用Halcon进行轮廓处理的步骤,包括创建XLD轮廓、处理XLD轮廓、轮廓拟合以及特征提取。通过lines_gauss、select_contours_xld、union_collinear_contours_xld等函数进行边缘提取和轮廓筛选,再通过fit_line_contour_xld、fit_circle_contour_xld等进行轮廓拟合,提取如圆、线段等特征。实例展示了如何提取公路轮廓并进行处理。
摘要由CSDN通过智能技术生成

Coutours 属于XLD结构

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

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

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

Basic Concept

create XLD contours

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

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.

例子 提取公路

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

*   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

1.Create XLD Contour

标准的方法是调用轮廓提取函数来创建轮廓。

边缘轮廓提取:edges_sub_pix, edges_color_sub_pix, or zero_crossing_sub_pix

线条提取:lines_gau

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值