Baz*_*rds 7 image-processing edge-detection
我有一个Canny边缘检测到的球的图像(见下面的链接),其中包含许多嘈杂的边缘.什么是最好的图像处理技术,我可以用来删除这些嘈杂的边缘而不删除属于球的边缘?
原始图像
Canny边缘图像
非常感谢大家的帮助和建议,非常感谢!
Ps我试图在使用Circle Hough Transform来检测球之前清理边缘图像.
只有在您设置了最佳阈值级别(下限和上限阈值)后,Canny 边缘检测才能发挥最佳效果
以下伪代码向您展示了它是如何完成的:
v = np.median(gray_img)
sigma = 0.33
#---- apply optimal Canny edge detection using the computed median----
lower_thresh = int(max(0, (1.0 - sigma) * v))
upper_thresh = int(min(255, (1.0 + sigma) * v))
Run Code Online (Sandbox Code Playgroud)
设置lower_thresh
和upper_thresh
作为 Canny 边缘函数的参数。
sigma
设置为0.33
是因为在沿分布曲线的统计中,考虑了距离曲线起点和终点 33% 之间的值。超出和低于该曲线的值被视为异常值。
这是我为你的形象得到的: