Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opencv 3.0.0-dev python bindings not working properly

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?

like image 962
Aly Shmahell Avatar asked May 03 '15 10:05

Aly Shmahell


People also ask

Why is cv2 not working in Python?

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.

Which OpenCV version should I use?

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.

What does .read do OpenCV?

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.


1 Answers

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)

like image 121
berak Avatar answered Sep 21 '22 23:09

berak