OpenCV on Linux again with G++

Posted by Undermine on 17:36 comments (0)


After a long way try to develop C program with OpenCV library on Ubuntu Linux using NetBeans and Eclispe IDE, no succeed at all. There are always some problems occurs and the project cannot move on further so everything has to be move back onto Windows to be developed. But now all these thing can be developed in Linux by  using traditional GNU C Compiler (GCC) that most of Linux users know it very well. This is the complete procedure from the beginning(install) till the end(compile-build).
Part A. Install OpenCV 2.0.0
1. Install prerequisites
Enter this line into Linux Terminal:

Installing OpenCV from the cvs version for Ubuntu 5

Posted by Undermine on 17:33 comments (0)


First, there are a few dependencies to sort out. You will need to install the following packages - using Synaptic.

  • cvs - so you can get the files
    • If you don't use cvs normally, type touch ~/.cvpass to create an empty password file (or else you'll get error messages)
  • gcc - so you can compile them
  • g++ - "
  • libgtk2.0-dev
  • Various image libraries - libimlib2 and libimlib2-dev get most of them. OpenCV requires libpng, libjpeg and libtiff with the -dev versions so check they are there too...

Installing OpenCV for Ubuntu 6.06 (Dapper) UPDATED

Posted by Undermine on 17:31 comments (0)


You might want to use this distribution because it has longer support, some packages seem to be more stable than later ones and for me at least it runs faster than 7.04!
Note that there is an older section (struck out), which I have kept as we recently had a case where it was necessary to install the older version of ffmpeg!
  1. Install subversion and all the basic compilation packages such as g++ and gcc etc.
  2. Download ffmpeg with: svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg and then
    • ./configure --enable-shared --prefix=/opt/ffmpeg (the prefix bit is optional but I prefer to store special development packages like this one on their own directory so it is simpler to locate, configure, remove)

Installing OpenCV for Ubuntu 7.04 (Feisty)

Posted by Undermine on 17:30 comments (0)


You might want to use this distribution because it has corrected bugs from previous ones, supports your hardware better, etc.
Thanks to Leeds University for their guide on using OpenCV
  1. Install subversion and all the basic compilation packages such as g++ and gcc etc.
  2. Download ffmpeg with: svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg and then
    • ./configure --enable-shared --prefix=/opt/ffmpeg (the prefix bit is optional but I prefer to store special development packages like this one on their own directory so it is simpler to locate, configure, remove)
    • make
    • sudo make install

Installing OpenCV for Ubuntu 8.04

Posted by Undermine on 17:29 comments (0)


We have tried the officially supported version of this, i.e. runnning KDE 3.x instead of 4.x
Note that installation on version 7.10 follows the same procedure, but I never got round documenting it
Things seem to be getting easier!
Thanks to Leeds University for their guide on using OpenCV
  1. sudo apt-get install build-essential to get compiler, ld, make, ....
  2. Install the other necessary packages: sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev
  3. Now download and untar version 1.0.0 of OpenCV from http://sourceforge.net/project/showfiles.php?group_id=22870&package_id=16948
  4. Now do

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

Posted by Undermine on 17:26 comments (0)


เนื่องจากวิธีในครั้งที่แล้ว สามารถทำได้บนเครื่องบางเครื่องเท่านั้น (เฉพาะเครื่องผมที่ใช้ 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

เริ่มต้นกับ OpenCV บน linux

Posted by Undermine on 17:23 comments (0)


OpenCV เป็นไลบรารี่ภาษา C ตัวหนึ่ง  ที่ถูกสร้างขึ้นมาเพื่องาน Image Processing โดยที่สามารถทำงานร่วมกับ IDE ทั่วไป และสามารถทำงานได้บนทุกแพลตฟอร์ม ไม่ว่าจะเป็นวินโดว์ ลินุกซ์ หรือ MacOS
สิ่งที่มันทำได้ (โดยคร่าวๆ)
- ทำงาน Image Processing ได้เกือบทุกประเภท ไม่ว่าจะลด noise / edge detection / hough transform / Feature Detection (ถ้าให้อธิบายแบบชาวบ้านก็คือ ทำทุกอย่างที่ Photoshop ทำได้)
- สามารถทำงานได้กับทั้งภาพนิ่ง วีดีโอ (ไฟล์ทุกสกุลที่ codec สามารถอ่านได้) และทำงานกับกล้องแบบ real-time ได้