5

I thought the quickest way to get opencv running in my environment would be as simple as.

sudo pip install opencv-python

It seemed to work properly, I could import

import cv2
img = cv2.imread("a.jpg", 0)

but any other functions as "cv2.SURF" or even "cv2.imshow" are not loaded. So the pip install is giving just a basic opencv?

user1767754
  • 23,311
  • 18
  • 141
  • 164

4 Answers4

3

This issue was solved here Opencv-python is not official. I tried to install it in a macbook running Ubuntu and, as you, I could import cv2, but some functions were not working.

From the opencv-python website:

MacOS and Linux wheels have some limitations:

video related functionality is not supported (not compiled with FFmpeg) for example cv.imshow() will not work (not compiled with GTK+ 2.x or Carbon support)

Now you might have problems trying to install the official opencv. You have to completely uninstall opencv-python before you attempt to install opencv.

Community
  • 1
  • 1
daniel_hck
  • 1,100
  • 3
  • 19
  • 38
1

This post is aging. I have Anaconda, and I have installed OpenCV as

conda install -c- conda-forge ffmpeg
pip install opencv-python

Maybe opencv-python had problems before, but now, is funcional

0

In the OpenCV docs, it is mentioned that sudo pip install opencv-python is an unofficial package for python. Quote : This package contains only the OpenCV core modules without the optional contrib modules.

It is meant for OpenCV Python bindings only. Additionally, some functions still don't work for MacOS and Linux (cv2.imshow as you mentioned).

If you want the full installation, follow the steps here.

Rick M.
  • 3,045
  • 1
  • 21
  • 39
0

Suggest you to install Anaconda and use its package manager conda to install OpenCV 3.2.0 for linux-64, including OSX. The installation command is conda install -c menpo opencv3=3.2.0.

Checked the OpenCV 3.2.0 package available in Anaconda repository. It includes the features2d.so which is the extra module in opencv_contrib for supporting SIRF.

See this SO Answer for some more information.

Community
  • 1
  • 1
thewaywewere
  • 8,128
  • 11
  • 41
  • 46