A. set proxy
1. System -> Preferences -> Network Proxy
2. Check "Automatic proxy configuration"
3. URL = http://proxy.cse.cuhk.edu.hk/proxy/cse.pac
4. Click the Apply System-Wide button
5. Should see some pop-up windows requesting password
6. Enter your password.
B. Update Ubuntu
1. System -> Administration -> Synaptic Package Manager
2. Enter Password if needed
3. Setting -> Repositories
4. Under "Ubuntu Software" tab, change "Download from" to "Main Server"
5. Under "Updates" tab, change "Release upgrade" to "Never"
6. Close the Repositories window
7. Click the "Reload" button at the top left corner.
8. Click the "Mark All Upgrades" button.
9. You may see a pop-up window showing the packages to be upgraded. Click "Mark"
10. Click the "Apply" button.
11. Click "Apply" in the pop-up window.
12. Since it is the first update, it may take a very long time to complete. (Depends on the traffic and number of updates, it may take around 30 minutes to complete.)
13. The upgrade may require reboot(e.g. update Kernel requires reboot). save you file and reboot.
***** NOTE *****
If you prefer using command line for step 7 to 12, here is the commands:
sudo apt-get update
sudo apt-get upgrade
C. Install package
Since some development packages are missing, we have to download them.
The packages are:
As we know the name of the package, we can use some command lines to install them very fast.
The command is :
sudo apt-get install build-essential cmake-qt-gui doxygen
After entering the password, the system will start download the packages and install them.
In fact, the system will not only install the specified packages but also their dependencies.
You don't have to worry about the dependency hell problem. The system will handle them for you.
By default, the system will look for update daily. The upgrades are safe because they are tested by
the ubuntu maintainers before release. Therefore, it is good to check and install the update daily.
***** Note *****
When you build OpenCV and other projects from source, you have to resolve the
dependency problem yourself. For example, libpng-dev is required by OpenCV.
You can search and install the package in Synaptic Package Manager.
D. Install OpenCV
1. Download the source tar ball from sourceforge and save it to your download directory (e.g. ~/Downloads)
2. Open a terminal:
Applications -> Accessories -> Terminal
3. Go to the download directory by typing this command:
4. unzip the tar ball
tar xfv OpenCV-2.2.0.tar.bz2
5. Go to the OpenCV source code directory
6. Run CMake-gui
7. Change the "binaries" directory to /home/your_name_here/Downloads/OpenCV-2.2.0/build/unix_27_june_2011
8. Click the "configure" button
9. If cmake prompts you about making the directory, please click "OK"
10. To specify the generator, choose "Unix Makefiles" and "Use default native compilers"
11. After a few seconds, a list will be shown and most of the entries are in red. It is because
some of the packages are missing. we need to install them otherwise, we cannot compile the
Here are the steps:
i) check the "Grouped" and "Advanced" box in CMake.
ii) Expand the tab called "JASPER" by click the small triangle next to it.
iii) Since we haven't install the JASPER library, CMake will show:
iv) Start the synaptic Package Manager
v) Search "libjasper" in the Quick Search box.
vi) A package called "libjasper-dev" will be shown in the results.
Right click the entry and choose "Mark for installation"
vii) Click the "Apply" button and wait until the installation complete.
viii) Go back to CMake and click the Configure button again. You should see
You should repeat the steps from (i) to (viii) for other libraries:
***** NOTE *****
you can use this command to install all of the dependencies:
sudo apt-get install libjasper-dev libjpeg62-dev libopenexr-dev libpng12-dev libtiff4-dev zlib1g-dev libgtk2.0-dev libavcodec-dev libv4l-dev libgstreamer0.10-dev
As the time goes by, the version number of the libraries may change. Please search them on Synaptic Package Manager.
12. After all the dependencies are resovled, you can click the "Configure" button and then "Generate" button.
13. Change the working directory of the terminal to where the binaries are built.
14. Compile the library: type the following in the terminal
15. Install the library: Type the following in the terminal
sudo make install
16. Update the library database:
17. Update PYTHONPATH:
open the bashrc file:
at the end of the file, add this line:
save and exit
run this command:
18. Test OpenCV:
go to the bin folder where you build the opencv:
run the "delaunay" example
if you have a camera connected, you can run the lkdemo or camshift
go to the samples code from the source code folder:
run the python
1. install it from Synaptic Package Manager
2. install the CDT from http://www.eclipse.org/cdt/
3. To config a eclipse C/C++ project to use OpenCV
i) Open the properties window of the project
ii) Go to C/C++ build -> Settings -> GCC C++ Compiler -> Directories
iii) Add "/usr/local/include/opencv" and "/usr/local/include/opencv2"
iv) Go to GCC C++ linker -> Libraries
v) Add these to Libraries(-l):
4. Now your project is ready for OpenCV development
1. install PyDev, follow http://catyku.pixnet.net/blog/post/24193322
BUT do the following change:
å†ä¾†åœ¨Help->SoftWare Updates -> Available Software - > æŒ‰Add Site
-----DONT USE THIS----> http://pydev.sourceforge.net/updates/
-------USE THIS-------> http://pydev.org/updates/
2. Add the cv library into your PyDev project:
project -> Properties -> PyDev - PYTHONPATH -> external Libraries -> Add source folder