OpenCV installeerimine: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Mernits (talk | contribs)
Mernits (talk | contribs)
 
(20 intermediate revisions by the same user not shown)
Line 4: Line 4:


Käivita järgnevad korraldused
Käivita järgnevad korraldused
<pre>
sudo apt-get install libpng12-0 pkg-config -y
sudo apt-get install zlib1g zlib1g-dev libjpeg-dev libtiff4  -y
sudo apt-get install libtiff4-dev libjasper1 libjasper-dev -y
sudo apt-get install libgtk2.0-dev swig -y
sudo apt-get install automake -y
sudo apt-get install libcv-dev -y
sudo apt-get install build-essential cmake make g++ -y
</pre>


QT4 installeerimine
<source lang="bash">
<pre>
sudo apt-get install pkg-config cmake  build-essential -y
sudo apt-get install libqt4-dev -y
sudo apt-get build-dep opencv -y
</pre>
sudo apt-get install qt4-qmake qtcreator -y


ITK robootikaklubi svn hoidlast asjade saamiseks tuleb paigaldada subversion
</source>
<pre>
Lisaks võib paigaldada ka pakke: qtcreator
sudo apt-get install subversion -y
</pre>


Tõmba viimane vers robotvision projektist
==OpenCV kompileerimine==
<pre>
Lae alla OpenCV Unix versioon 2.4.3
svn co http://robot.itcollege.ee/svn/vision/robotvision2009/
</pre>


C++ IDE qtcreator installeerimine
<pre>
sudo apt-get install qtcreator qt4-doc-html git-core -y
</pre>


<pre>
sudo aptitude install libcvaux-dev libhighgui-dev -y
</pre>


==OpenCV kompileerimine==
*lae alla opencv stabiilse haru algteks http://opencv.willowgarage.com/wiki/ Dowloads alt;
*paki tulemus lahti
*sisene lahtipakkimisel loodud kausta
*loo alamkaust release
*sisene kausta relase ja käivita
<source lang="bash">
<source lang="bash">
cmake .. -DWITH_JPEG=OFF -DCMAKE_BUILD_TYPE=RELEASE
 
 
cd ~
wget https://github.com/Itseez/opencv/archive/2.4.6.1.tar.gz
tar zxvf 2.4.6.1.tar.gz
cd opencv-2.4.6.1/
mkdir build
cd build
 
 
 
 
</source>
</source>


PS: võib muuta ka march=native cmake konfifailist, kui tegu on robotile mineva asusega


PPS: JPEG=OFF on hea, et kaamerast tuleb stream ei oleks MJPEG.
<source lang="bash">
cmake .. -DWITH_JPEG=OFF -DCMAKE_BUILD_TYPE=RELEASE  -DCMAKE_CXX_FLAGS="-march=native -O3 -ftree-vectorize"  -DCMAKE_C_FLAGS="-march=native -O3 -ftree-vectorize"
 
make -j4 #Kui sul on 4 trheadi/coret
sudo make install
sudo ldconfig


Kui nutetakse v4lv1 puudumise üle a'la OpenCV-2.2.0/modules/highgui/src/ cap_v4l.cpp:217:28: fatal error: linux/videodev.h: No such file or directory
</source>


Siis paigalda v4lv1 dev pakk
Tõmba viimane vers robotvision projektist
<source lang="bash">
<source lang="bash">
sudo apt-get install libv4l-dev
svn co https://robot.itcollege.ee/svn/vision/botmaster2012/
</source>
</source>
Ja muuta modules/highgui/src/cap_v4l.cpp


rida #include <linux/videodev.h> asendada reaga #include <libv4l1-videodev.h>
Probleemide korral uue ubuntuga: - http://tech.groups.yahoo.com/group/OpenCV/message/79758


PS: JPEG=OFF on hea, et kaamerast tuleb stream ei oleks MJPEG.
http://karytech.blogspot.com/2012/05/opencv-24-on-ubuntu-1204.html


[[Category:Robootika]]
[[Category:Robootika]]

Latest revision as of 14:37, 12 November 2013

Eeldused

Luba failis /etc/apt/sources.list seal vaikimisi väljakommenteeritud repositooriumid multiverse ja universe

Käivita järgnevad korraldused

sudo apt-get install pkg-config cmake  build-essential -y
sudo apt-get build-dep opencv -y
sudo apt-get install qt4-qmake qtcreator -y

Lisaks võib paigaldada ka pakke: qtcreator

OpenCV kompileerimine

Lae alla OpenCV Unix versioon 2.4.3


cd ~
wget https://github.com/Itseez/opencv/archive/2.4.6.1.tar.gz
tar zxvf 2.4.6.1.tar.gz 
cd opencv-2.4.6.1/
mkdir build
cd build


cmake .. -DWITH_JPEG=OFF -DCMAKE_BUILD_TYPE=RELEASE  -DCMAKE_CXX_FLAGS="-march=native -O3 -ftree-vectorize"  -DCMAKE_C_FLAGS="-march=native -O3 -ftree-vectorize"

make -j4 #Kui sul on 4 trheadi/coret
sudo make install
sudo ldconfig

Tõmba viimane vers robotvision projektist

svn co https://robot.itcollege.ee/svn/vision/botmaster2012/


PS: JPEG=OFF on hea, et kaamerast tuleb stream ei oleks MJPEG.

http://karytech.blogspot.com/2012/05/opencv-24-on-ubuntu-1204.html