玩python和opencv,用pytonxy安装
我正在尝试调用 HoughCircles 但收到以下错误:
OpenCV Error: Bad argument (Unrecognized method id) in unknown function, file ..\..\..\OpenCV-2.4.2\modules\imgproc\src\hough.cpp, line 1069
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cv2.error: ..\..\..\OpenCV-2.4.2\modules\imgproc\src\hough.cpp:1069: error: (-5) Unrecognized method id
代码非常简单:
import cv2
import matplotlib.pyplot as plt
vidCap =cv2.VideoCapture("D:\movies\VID_20130614_143125.mp4")
b, im = vidCap.read()
gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(gray, 1, cv2.cv.CV_HOUGH_GRADIENT, 100)