I am on ubuntu 14.04.02, i have python, cython and numpy installed and updated. i pulled the latest sources of open cv from http://github.com/itseez/opencv, compiled according to the documentation... when trying to run the python source i pulled from https://github.com/shantnu/FaceDetect/ it's giving me the following error :
modprobe: FATAL: Module nvidia not found. Traceback (most recent call last): File "face_detect.py", line 21, in flags = cv2.cv.CV_HAAR_SCALE_IMAGE AttributeError: 'module' object has no attribute 'cv'
to make sure i have the python bindings i typed the following in the terminal: python
import cv2
cv2.__version__
it returned the following '3.0.0-dev'
what could be wrong with it?
The Python "ModuleNotFoundError: No module named 'cv2'" occurs when we forget to install the opencv-python module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install opencv-python command.
If you're working with Image Processing,hands down OpenCV 3 is way better(The latest stable version 3.4 was released around Feb 2018). Significant differences that you will find between 3 and 2 are: T-API or Transparent API has been introduced in OpenCV 3. Only thing that you'll need to use is UMat instead of Mat.
read() in OpenCV returns 2 things, boolean and data. If there are not 2 variables, a tuple will be assigned to one variable. The boolean is mostly used for error catching.
the cv2.cv submodule got removed in opencv3.0, also some constants were changed.
please use cv2.CASCADE_SCALE_IMAGE instead
(do a help(cv2)
to see the updated constants)
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