I\'m trying to run this script:
https://github.com/openalpr/train-detector/blob/master/crop_plates.py
I\'ve never dealt with python before. First of all I ha
For ImportError: No module named cv
, try installing opencv-python
module using below command:
pip install opencv-python
OK , I searched for a while and find the following :
First: you may write: import cv2.cv as cv
to solve your proplem
cv
and cv2
are both interface for python , and now , the newest "cv2
" is the most used one , but clearly some libraries still use cv
and others (like yours) use mix of the two,What is different between all these OpenCV Python interfaces?
cv2.cv
doesn't exists in OpenCV 3.0. Use simply cv2
Also, the attribute is no more CV_HOUGH_GRADIENT but HOUGH_GRADIENT
So what you looking for is probably:
cv2.HOUGH_GRADIENT
It seems this code is using a old version of OpenCV. Unfortunately there is no mention of the exact version they used in their repo.
As the code is at least 2 years old, I would install opencv version 2.4.
pip install opencv-python==2.4