** First of all you should install dependencies sudo apt-get update sudo apt-get install -y build-essential sudo apt-get install -y cmake sudo apt-get install -y libgtk2.0-dev sudo apt-get install -y pkg-config sudo apt-get install -y python-numpy python-dev sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
1- go to github URL (Install opencv on Ubuntu) https://github.com/BVLC/caffe/wiki/OpenCV-3.1-Installation-Guide-on-Ubuntu-16.04
2- Here u can clone or download Opencv: https://github.com/opencv/opencv
3- run these commands in the first URL. go to ur Opencv directory
- mkdir build
- cd /build
and then run cmake: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" ..
- for java ant & jni issue u can visit: opencv/opencv#6027
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_C_EXAMPLES=OFF
-D INSTALL_PYTHON_EXAMPLES=ON
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules
-D BUILD_EXAMPLES=ON ..
- If you still have a problem with Java ant, Run:
- sudo apt-get install ant
Now, u should have ant (YES) and jni (YES) installed :)
To install opencv-2.4.11, you can follow steps in this gist: https://gist.github.com/dynamicguy/3d1fce8dae65e765f7c4
Also this video may help you to add Opencv to Netbeans & Eclipse (in Arabic). https://www.youtube.com/watch?v=JPwyg9xkEEk
And this in English: https://www.youtube.com/watch?v=DRH-EaIhOlc https://www.youtube.com/watch?v=RJkM_iI_WqE
We can Find Here Opencv-2.4.11 release and of course other releases: https://github.com/opencv/opencv/releases/tag/2.4.11