I have a small test code block trying to process a simple photo with a ball in it:
#!/usr/local/bin/python
import cv2
import numpy as np
img = cv2.imread("b.jpg")
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(gray,cv2.CV_HOUGH_GRADIENT)
When I try to run this I get:
AttributeError: 'module' object has no attribute 'HOUGH_GRADIENT'
I've been installing and reinstalling for two days trying to figure out whats wrong. Any help or pointers would be appreciated!
try
circles = cv2.HoughCircles(gray, cv2.cv.CV_HOUGH_GRADIENT, 1.2, 75)
works, to me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With