【发布时间】:2023-03-11 06:55:01
【问题描述】:
我从 GitHub 克隆了 this 项目,但它现在不起作用。我还不知道 HoughCircles opencv (cv2) 函数返回 None 的原因。
谁能帮我理解 HoughCircles 并解决这个问题?谢谢。
img = cv2.imread('download.png', 1)
#img=cv2.resize(img,None,fx=2, fy=2, interpolation = cv2.INTER_CUBIC)
img_grayscale=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
img_inverse=cv2.bitwise_not(img_grayscale)
#Circle Detection Part
circles = cv2.HoughCircles(img_inverse,cv2.HOUGH_GRADIENT,1,20,param1=50,param2=200,minRadius=0,maxRadius=0)
circles = np.uint16(np.around(circles))
【问题讨论】:
-
查看此解决方案以更好地了解霍夫圈stackoverflow.com/a/67768649/10333818。你的参数搞砸了。
标签: python python-3.x opencv computer-vision