我在python中的一个.png图像上使用了houghcirles。当我运行代码时:
def circleCheck(self, imPath):
image = cv2.imread(imPath)
image = cv2.medianBlur(image, 5)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1.2, 100)
self.alphaCount = len(circles)
其中alphaCount应该包含图像中的圈数,我得到
TypeError: object of type 'NoneType' has no len()
我不知道为什么as circles应该返回一个长度为0的列表。任何帮助都将不胜感激。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐