直线检测算子

hough_lines_dir 

接口

hough_lines_dir(ImageDir : HoughImage, Lines : DirectionUncertainty, AngleResolution, Smoothing, FilterSize, Threshold, AngleGap, DistGap, GenLines : Angle, Dist)

参数

in:

        ImageDir :由边缘检测算子sobel_dir、edge_image获取的边缘梯度方向图

        DirectionUncertainty:用于限定线内各点在边缘方向的运行变化程度。

        AngleResolution:定义了确定角度的精确程度。精度总计为1/AngleResolution度。

        Smoothing:用于选择平滑滤波器。

        FilterSize:平滑滤波器的size,决定输出的平滑度。

        Threshold:二值化阈值。

        AngleGap、DistGap:参数AngleGap和DistGap定义了霍夫图像中的点的邻域,以确定局部最大值:AngleGap分别描述霍夫图像在角度方向上和在距离方向上的两个最大值的最小距离。

        GenLines:bool值,用于决定是否在Lines中输出霍夫空间域中,有局部最大贡献值的区域。

out:

        HoughImage:霍夫变换图像

        Lines :输入图像中局部贡献值最大的区域(即检测到的直线区域)

        Angle:检测到的直线的法向量角度(弧度制)

        Dist:检测到的直线与原始位置的距离

示例程序

* Detect lines in an image with the help of the Hough transform
* using the edge direction as additional information and return it both
* in HNF and as regions
* 
read_image (Image, 'fabrik')
rectangle1_domain (Image, ImageReduced, 170, 280, 310, 360)
* Detect edges (amplitude and direction) using the Sobel operator
sobel_dir (ImageReduced, EdgeAmplitude, EdgeDirection, 'sum_abs', 3)
dev_set_color ('red')
threshold (EdgeAmplitude, Region, 55, 255)
* Reduce the direction image to the edge region
reduce_domain (EdgeDirection, Region, EdgeDirectionReduced)
* Start the Hough transform using the edge direction information
hough_lines_dir (EdgeDirectionReduced, HoughImage, Lines, 4, 2, 'mean', 3, 25, 5, 5, 'true', Angle, Dist)
* Store input lines described in HNF
gen_region_hline (LinesHNF, Angle, Dist)
dev_display (Image)
dev_set_colored (12)
* Display the lines
dev_set_draw ('margin')
dev_display (LinesHNF)
* Display the edge pixels that contributed to the corresponding lines
dev_set_draw ('fill')
dev_display (Lines)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值