OpenCV-Python build problem with HoughCircles function
The code is:
hougharr=opencv.CreateMemStorage(0)#64k
result=opencv.HoughCircles(edge,hougharr,opencv.CV_HOUGH_GRADIENT,2,edge.width/10)
and the error code is:
TypeError: Argument 'circle_storage' must be CvMat. Use fromarray() to convert numpy arrays to CvMat
ANOTHER PROBLEM:
The code is:
hougharr=opencv.CreateMemStorage(0)#64k
opencv.fromarray(hougharr)
result=opencv.HoughCircles(edge,hougharr,opencv.CV_HOUGH_GRADIENT,2,edge.width/10)
and the error code is:
TypeError: object does not have array interface
What should I do to correct the mistakes?
hmm, that's not cv2, right ? so, what kind of odd wrapper ayou using there ? ( it also seems to wrap the old c-api )
hi! It's cv2, version 2.4.6, and with Python2.7.5 on windows sys. The symbol 'opencv' is the cv2.cv and in the program is : import cv2.cv as opencv
I'm a newer. Learning python language is just a few days.
ah, ok. but please don't use cv2.cv, that's the old deprecated api. won't be available in the next version
stick with cv2, there's even a demo for it
you still might have to use cv2.cv to access some constants, it's a bit work in progress there