gpt4 book ai didi

python - 霍夫圈错误(Python,Open CV)

转载 作者:太空宇宙 更新时间:2023-11-03 22:30:46 25 4
gpt4 key购买 nike

<分区>

这段代码:

import cv2

img = cv2.imread('circles.jpg',0)
img = cv2.medianBlur(img,5)
cimg = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR)

circles = cv2.HoughCircles(img,cv2.cv.HOUGH_GRADIENT,1,20,
param1=50,param2=30,minRadius=0,maxRadius=0)

引发以下错误:

Traceback (most recent call last):
File "C:\Users\Arnaud\Desktop\Cercles\circles.py", line 8, in <module>
circles = cv2.HoughCircles(img,cv2.cv.HOUGH_GRADIENT,1,20,
AttributeError: 'module' object has no attribute 'HOUGH_GRADIENT'

你知道为什么吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com