Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

EDIT:

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 at 16:58

2 Answers 2

up vote 1 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(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 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 https://github.com/Itseez/opencv.git
cd opencv/
mkdir release
cd release/
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
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 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 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 at 16:52

Open terminal, then launch python interpeter:

python

then, import opencv:

import cv2

finally, print version:

cv2.__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
    
useful to know the current version but does not provide guidelines to install the dev version of opencv –  Sylvain Pineau Apr 14 at 8:38

Your Answer

 
discard

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.