How to install OpenCV 2.4.7 for Python , Ubuntu

asked 2018-11-25 21:41:51 -0600

mado gravatar image

updated 2018-11-25 23:34:06 -0600

I am going to use a code shared on GitHub on facial feature extraction. This code has OpenCV 2.4.7 and Python 2.7 dependencies. This code uses cv2.Boost() which is not found in OpenCV 3.4. I tried OpenCV 3.4, but it didn't work. Also, pypi only support OpenCV 3x. I couldn't install OpenCV 2.4.7 by pip install.

When I try following command.

pip install opencv-python==2.4.7

I get the error:

Could not find a version that satisfies the requirement opencv-python==2.4.7 (from versions: 3.1.0.0, 3.1.0.1, 3.1.0.2, 3.1.0.3, 3.1.0.4, 3.1.0.5, 3.2.0.6, 3.2.0.7, 3.2.0.8, 3.3.0.9, 3.3.0.10, 3.3.1.11, 3.4.0.12, 3.4.0.14, 3.4.1.15, 3.4.2.16, 3.4.2.17, 3.4.3.18). No matching distribution found for opencv-python==2.4.7

Could you please let me know how I can install OpenCV 2.4.7 for Python? I prefer to install it in a Conda virtual environment.

O.S: Ubuntu 16.

I can use Windows 10 too.

edit retag flag offensive close merge delete

Comments

wouldn't it be easier & better to rpair the python script instead ? (e.g. it's cv2.ml.Boost_create)

berak gravatar imageberak ( 2018-11-26 00:37:29 -0600 )edit

Thanks. I tried to import cv2.ml.Boost_create. But, error message said cv2.ml is not a package. I checked the documentation. It seems that I need to use cv.ml.Boost_create. But, I cannot import cv or any package from cv. https://docs.opencv.org/3.4.4/d6/d7a/...

mado gravatar imagemado ( 2018-11-26 01:22:55 -0600 )edit

can we see your code ?

(btw, the 3.4 samples use a line like: import cv2 as cv)

berak gravatar imageberak ( 2018-11-26 01:28:35 -0600 )edit

Code is in GitHub: https://github.com/derek-schultz/aude...

cv.Boost() is used in "detect.py" , audetect folder.

I installed OpenCv 3.4 and as I explained I couldn't import cv2.ml.Boost_create. I didn't change the GitHib code yet.

mado gravatar imagemado ( 2018-11-26 01:46:13 -0600 )edit