Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been having the exact same problem as described in this post and someone in the answers suggested that you upgrade to opencv version 2.9. I was wondering how do that? I installed the version I have now by doing

sudo apt-get install python-opencv

Also, how can I check what version I'm running now? I'm on Ubuntu 13.10


After girardengo answer I know I'm on version 2.4.5 Thank you for that!

share|improve this question
May I know how to type the "version" command? – user315365 Aug 13 '14 at 16:58
up vote 6 down vote accepted

Before installing the development version of OpenCV, I'd suggest to use this code to set the capture size (from the link you posted I assume you're using python):

import cv2

cap = cv2.VideoCapture(device_no)
cap.set(, width)
cap.set(, height)

To install the development version of opencv (3.0.0-dev today) please follow the steps below:

cd $HOME
mkdir opencv_src
cd opencv_src/
git clone
cd opencv/
mkdir release
cd release/
sudo make install
share|improve this answer
I've tried the commands you suggest and they don't work for my camera logitech c910. I'm compiling / installing the latest version now and will see if that makes a difference. thank you – evan54 Apr 14 '14 at 16:22
Weird, I have a C920 and with opencv 2.4.5 (the default 13.10 version) it works fine. You can check one of mys script here – Sylvain Pineau Apr 14 '14 at 16:27
it didn't work with the dev :( I'll mark this solved and post a new question about the error message I get. – evan54 Apr 14 '14 at 16:52
hi evan54, just curious - are you using a mac? also, did you install 2.9 or 3.0 based on the above instructions? if you used opencv 3.0 in python did you still refer to it as cv2? – user391339 Feb 10 '15 at 8:54
Sometimes you have to link the module cd ~/.virtualenvs/cv/lib/python2.7/site-packages/ && ln -s /usr/local/lib/python2.7/site-packages/ – Yauhen Yakimovich Nov 23 '15 at 11:47

Open terminal, then launch python interpeter:


then, import opencv:

import cv2

finally, print version:


if you want to install the latest development version of opencv, you can follow the instructions of the official documentation of opencv from here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.