Skip to content

Instantly share code, notes, and snippets.

@abdallahokasha
Last active February 13, 2019 23:42
Show Gist options
  • Save abdallahokasha/b6fc6e076017455299cc5871e52ea853 to your computer and use it in GitHub Desktop.
Save abdallahokasha/b6fc6e076017455299cc5871e52ea853 to your computer and use it in GitHub Desktop.

** 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" ..

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

http://stackoverflow.com/questions/17386551/how-to-build-opencv-with-java-under-linux-using-command-linegonna-use-it-in-ma

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment