เริ่มต้นกับ OpenCV ภาค 2 : Revenge of the Linux

Posted by Undermine on 17:26


เนื่องจากวิธีในครั้งที่แล้ว สามารถทำได้บนเครื่องบางเครื่องเท่านั้น (เฉพาะเครื่องผมที่ใช้ Ubuntu 9.04 อยู่) แต่ปรากฎว่าพอลองเอาไปทำกับ Linux Mint 7 ของเพื่อนผม พบว่ามีปัญหากับ package SVN มาก Cmake ไม่ออกซักที ก็เลยโหลด binary ไฟล์มาคอมไพล์โดยตรงเลย
1. install compiler, open the Terminal and type this command:
sudo apt-get install build-essential
2. install related dependencies:
sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev


3. Download OpenCV source files fromhttp://sourceforge.net/project/showfiles.php?group_id=22870&package_id=16948, untar and place it wherever you want OpenCV to be at.
4. Type command as follows:
./configure --prefix=/opt/opencv --enable-apps --enable-shared --with-ffmpeg --with-gnu-ld --with-x --without-quicktime CXXFLAGS=-fno-strict-aliasing
make
sudo make install
sudo nano /etc/ld.so.conf.d/opencv.conf
Then add this /usr/local/lib into a file.
sudo ldconfig -v
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
That’s all. Now we can test this OpenCV by using examples in/opencv/samples/c
by: sudo sh build_all.sh
./edge (or any others examples)
ส่วน IDE ที่แนะนำ หลังจากลองใช้ Eclipse ดูซักพัก พบว่าไม่ค่อยเวิร์คสำหรับการทำภาษา C ซักเท่าไหร่ เลยแนะนำ netbean วิธีการเซ็ต netbean ให้ใช้งานได้

0 comments:

แสดงความคิดเห็น