如何过滤Hough线进行多通道检测?

问题描述 投票:1回答:1

我正在使用HoughTransformP在OpenCV C ++中进行通道检测。

我检测线路的步骤顺序是基本的,如下所示:

1. Bird Eye View of image
2. Grayscale image
3. Guassian Blur image
4. Canny Edge detection
5. HoughTransformP canny image
6. Filter out horizontal lines based on the slope

canny边缘检测后的输出为:

enter image description here

这里的问题是HougLinesP给出了多行,而不仅仅是通道。输出看起来类似于:

enter image description here

我想获得这样的东西:

enter image description here

如何过滤杂乱的线条并仅绘制线条线?

c++ opencv computer-vision hough-transform houghlinesp
1个回答
1
投票

可能算法的大纲:

  1. 对线段进行聚类:例如,在下图中,您应该能够使用1234标记每个线段。
  2. 对于每个群集,找到“平均线”。

enter image description here

以Hessian法线形式x*cos(beta)+y*sin(beta)-p=0投射线段,其中p是线段与原点之间的距离,beta是您在下图中看到的角度:

enter image description here

您可以使用一些适当的机器学习技术对线段进行聚类,例如使用输入特征向量[p, beta],然后您可以找到“平均线”,例如平均bbeta。假设您有两个属于同一群集的[p_1, beta_1][p_2, beta_2],平均段是[(p_1+p_2)/2, (beta_1+beta_2)/2]

© www.soinside.com 2019 - 2024. All rights reserved.