【问题标题】:Remove noise and detect semicircle opencv去噪检测半圆opencv
【发布时间】:2021-09-12 07:06:15
【问题描述】:

有没有办法检测这些图像上的半圆?

尝试了很多方法,结果都不好

例子:

image = cv2.imread('path_here', 0)
output = image.copy()
ret, thresh = cv2.threshold(image, 0, 255, cv2.THRESH_OTSU)
circles = cv2.HoughCircles(thresh, cv2.HOUGH_GRADIENT, 1, 110,
                       param1=25, param2=5, minRadius=9, maxRadius=10)
detected_circles = np.uint16(np.around(circles))
for (x, y, r) in detected_circles[0, :]:
    cv2.circle(output, (x, y), r, (0, 0, 0), 2)
    cv2.circle(output, (x, y), 2, (0, 255, 255), 2)

cv2.imshow('output', output)
cv2.waitKey(0)
cv2.destroyAllWindows()

【问题讨论】:

  • 那张图片中哪里有一个半圆?
  • @Micka。图片更新
  • 你只有正方形、直线和半圆吗?如果是这样,可能会更容易检测出正方形和线条,剩下的形状将是半圆形。

标签: python python-3.x opencv computer-vision


【解决方案1】:

阿列克谢。我有以下想法

  1. a) 您可以对半圆进行 fft 变换 b) 对图像进行 fft 变换,去除所有与半圆 fft 不同的部分。

  2. 尝试应用霍夫圆变换

  3. 你可以加载一个神经网络检测器来检测半圆的

cv2.dnn.readNetFromTensorFlow
# or
cv2.dnn.readNetFromTorch

使用 PyTorch 或 TensorFlow,您可以为此制作检测器

【讨论】:

    猜你喜欢
    • 2014-01-09
    • 1970-01-01
    • 1970-01-01
    • 2012-01-29
    • 2020-06-16
    • 2017-05-24
    • 1970-01-01
    • 1970-01-01
    • 2020-05-05
    相关资源
    最近更新 更多