在圆形变换之前,使用Canny Edge检测是否有任何计算益处?

发布于 2025-01-25 13:51:35 字数 226 浏览 1 评论 0 原文

当我偶然发现时,我一直在寻找如何在台球桌上检测台球球。

OP指出,在应用Circle Hough Transform之前,他在视频供稿的色相频道上采用了Canny Edge检测算法。在圆检测之前执行边缘检测是否有任何计算益处,或者我应该在视频提要上立即执行圆圈检测?

提前致谢!

I was looking at how to detect billiard balls on a pool table, when I stumbled upon this post.

The OP states that he employs the Canny edge detection algorithm on the hue channel of his video feed before applying the circle Hough transform. Is there any computational benefit to performing the edge detection before the circle detection, or should I immediately perform circle detection on the video feed?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假扮的天使 2025-02-01 13:51:35

一般,您可以进行密集 hough或a 稀疏 hough,并且可以具有加权未加权投票。

通过灰度级别(强度):

  • 加权:每个像素根据其强度进行投票(带有信息)
  • 获得1.0投票

未加权:每个像素通过位置/密度/稀疏

  • :密度/稀疏:密度:所有像素投票
  • 稀疏:只有一些像素投票(只有一些像素投票(重要的是,重要的是, 在四个可能的组合中,不是随机的)

密集+未加权是愚蠢的,因为整个图像的所有像素(包括集合和清晰的图像)都相同。除边界效应外,累加器阵列看起来平坦。

密集很昂贵,因此人们使用稀疏的投票。未加权的计算便宜,所以人们这样做。


Canny a 对图片二进制的方法,并获得了一组很小的像素。

Canny会对边缘或梯度反应。 OpenCV的Canny将梯度过滤器与Canny型山脊结合了过滤器。在理论中,一个人可能只有Canny型脊后滤波后的过滤器,并将其应用于任何图像,,而无需首先获得梯度图。通常,人们希望从非二进制图像(即灰度,单通道或多通道)中的边缘,因此获得渐变图是一个明智的步骤。有时,您可能已经拥有了,只想增强山脊。那你就不幸了。


对于 cv :: houghlines() cv :: houghlinesp(),输入是假定为被二进制的,即/em>需要确保否则结果将是奇怪的。您可以为此或任何其他合适的方法使用Canny。

cv :: houghcircles() 始终包括 a canny 步骤,因此在这种情况下明确地 not not 。我认为该功能可以从梯度图中获取方向信息。

In general, you could do a dense Hough or a sparse Hough, and you could have weighted or unweighted votes.

By grayscale level (intensity):

  • Weighted: have each pixel vote according to its intensity (carries information)
  • Unweighted: each pixel gets 1.0 vote

By position/density/sparsity:

  • Dense: all pixels vote
  • Sparse: only some pixels vote (important ones, not random ones)

Of the four possible combinations, dense+unweighted is silly because all pixels of the entire image, both the set and clear ones, vote the same. The accumulator array would look flat, except for boundary effects.

Dense is expensive, so people use sparse voting. Unweighted is cheaper to calculate, so people do that.


Canny is a way to binarize a picture and receive a very small set of pixels.

Canny will react to edges or gradients. OpenCV's Canny combines a gradient filter with the Canny-type ridge following filter. In theory, one could have just the Canny-type ridge following filter, and apply it to any image, without first getting a gradient map. Usually, people want the edges from a non-binary image (i.e. grayscale, single-channel or multi-channel), so getting the gradient map is a sensible step. Sometimes, you might already have that and you only want to enhance the ridges. Then you're out of luck.


For cv::HoughLines() and cv::HoughLinesP(), the input is assumed to be binarized, i.e. you need to ensure that or else the results will be strange. You can use Canny for that, or any other suitable method.

cv::HoughCircles() always includes a Canny step, so do not Canny the input explicitly in this case. I think the function does it like that to gain direction information from the gradient map.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文