Setting up OpenCv in Qt

Discussion in 'General Programming Discussion' started by ji11x38, Nov 4, 2013.

  1. ji11x38

    ji11x38 New Member

    Joined:
    Nov 4, 2013
    Messages:
    22
    Likes Received:
    1
    HOW TO SETUP OPENCV ON YOUR UDOO AND WRITE A SAMPLE-PROGRAMM


    1. installing neccessary packages:
    Open up a Terminal [ctrl +alt + t] and install a few packages we will need later on via

    Code:
      sudo apt-get install build-essential cmake cmake-gui git git-gui libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev 

    2.Download the OpenCV- Source and unpack it

    ->
    -> Unpack the .tar via an archiv-manager or via consol (sudo tar -xvf filenameXXX.tar )




    4.Now, in your terminal, make sure you are within the OpenCV directory and run the following commands :

    To create a build-folder:
    Code:
    mkdir build
    	cd build
    to get cmake happy
    Code:
    	cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
    and to build
    Code:
    make
    -> have not done the next step yet but you should
    Code:
    sudo make install
    5. If everything went the way it should, you are now a proud owner of an Udoo-build Version of OpenCV!

    Or not..... :|


    Would be cool if somebody would take a look at this! have fun and keep up udooing :ugeek:
    ji11x38
     
  2. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    There is an OpenCV thread already.

    It's not resolved yet, but perhaps between you and the others interested in this topic you can sort it between you by comparing notes/teaming up?
     
  3. ji11x38

    ji11x38 New Member

    Joined:
    Nov 4, 2013
    Messages:
    22
    Likes Received:
    1
    -Deleted
     
  4. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    When the build crashes what error messages are you getting?
     
  5. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    Just tried compiling it this is the error I get:


    EDIT - I got it to build. I had to turn QT and OpenGL off with CMake. I had to fiddle with the device # to capture the image from the camera but I got the examples where it puts a circle around a color working
     
  6. ji11x38

    ji11x38 New Member

    Joined:
    Nov 4, 2013
    Messages:
    22
    Likes Received:
    1
    Hey jaeg,
    that sounds great!
    Didn't had time to post anything else yesterday....had some errors on building the opencv core what seems logic reading your post on disabling opengl!
    Will give it a try as soon as possible!

    After getting things running, i am going to update the how-to in my first post.
    Maybe an admin could make a sticky of this! I believe there are several people who could make use of it!

    Ji11x38
     
  7. ji11x38

    ji11x38 New Member

    Joined:
    Nov 4, 2013
    Messages:
    22
    Likes Received:
    1
    Me again.. Been working the whole evening and did't get any better results... could you please tell me how you managed to get things done? as exact as possible please.
    Where you referring to my how to ?

    if so, did you install all of the necessary packs of step one ?
    Working for quite a while (and to new images) i am getting lots of errors since some of them depend on the libegl1 and libegl2 (i know that we are not supposed to install them due to them breaking opencl-compatibility) dont know if am just missing something (or did an unnecessary extra step)
     
  8. jaeg

    jaeg Member

    Joined:
    Oct 22, 2013
    Messages:
    62
    Likes Received:
    0
    I followed this tutorial here:
    http://miloq.blogspot.com/2012/12/insta ... linux.html

    And changed this
    to

    And then it compiled. It took it about 2 hours to finish.

    I'm going to back up my Udoo tonight and try compiling this with the WITH_QT flag ON


    EDIT: I compiled with qt on and got the same error as above.
     
  9. ji11x38

    ji11x38 New Member

    Joined:
    Nov 4, 2013
    Messages:
    22
    Likes Received:
    1
    Hi jaeg,

    thanks for your help on getting opencv compiled! Turning off qt and opengl did the job!
    for me the process took also a bit while using 3 of the 4 cores (it seems , that there is not enough ram for running 4 cores at a time..did not try using swap-space yet but it might work out that way! )

    After things where settled in the way of compiling, i am now stuck on getting up a qt project....
    while you can usually create a CMakeLists.txt file with the necessary dependencies location etc. to fire up in the qt-creator, the creator crashs on running cmake.....
    Have you managed to do anything witch opencv or does anybody know how to get the Qt-Creator running as it should?
     
  10. jykm12

    jykm12 New Member

    Joined:
    Nov 15, 2013
    Messages:
    26
    Likes Received:
    0
    Please post an update on OpenCV progress for the rest of us.
     
  11. billy4184

    billy4184 New Member

    Joined:
    Feb 11, 2014
    Messages:
    6
    Likes Received:
    0
    Hi guys, I got opencv running with GTK by following Ozbot's guide at:
    http://www.ozbotz.org/opencv-installation/
    Feel free to ask me any questions on errors etc as I have spent much time on this problem and can probably point you in the right direction.

    Cheers, Billy
     
  12. sebasmora

    sebasmora New Member

    Joined:
    Dec 11, 2013
    Messages:
    7
    Likes Received:
    0
    I try to st up openCV but what i need the most is V4L, not V4L2. Once I build it it says V4L2 yes but V4L no. Any ideas? where can i get this V4L directly?
     
  13. Tannyveer

    Tannyveer New Member

    Joined:
    Feb 19, 2014
    Messages:
    33
    Likes Received:
    0
    Hey
    Ozbot's guide: setting up opencvprocedure working on udoo quad board
     

Share This Page