Skip to content

Instantly share code, notes, and snippets.

@zeroows
Last active August 19, 2018 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroows/4b85151f11536ffb6bafe10ebc6dc325 to your computer and use it in GitHub Desktop.
Save zeroows/4b85151f11536ffb6bafe10ebc6dc325 to your computer and use it in GitHub Desktop.
I found a great post by Adrian Rosebrock for how to install OpenCV on Ubuntu 18.04 and for the cmake command I was able to build it using Anaconda
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH='~/Downloads/opencv/opencv_contrib-3.4.2/modules/' \
-D PYTHON3_INCLUDE_DIR='~/anaconda3/envs/tf/include/python3.6m' \
-D PYTHON_EXECUTABLE='~/anaconda3/envs/tf/bin/python' \
-D PYTHON3_LIBRARY='~/anaconda3/envs/tf/lib/libpython3.6m.so' \
-D PYTHON3_PACKAGES_PATH='~/anaconda3/envs/tf/lib/python3.6/site-packages' \
-D PYTHON3_NUMPY_INCLUDE_DIRS='~/anaconda3/envs/tf/lib/python3.6/site-packages/numpy/core/include' \
-D BUILD_EXAMPLES=ON -D BUILD_NEW_PYTHON_SUPPORT=ON ..
@zeroows
Copy link
Author

zeroows commented Jul 21, 2018

Adrian Rosebrock great guide

Hope this will help.

BTW thanks Adrian

@anujpahade
Copy link

anujpahade commented Aug 19, 2018

Hello @zeroows,
I'm trying to install opencv for anaconda python 3.6.
I was able to complete 4 steps of Adrian's guide but I'm unable to find the cv2.cpython-36m-x86_64-linux-gnu.so file
in anaconda3/lib/python3.6/site-packages. Can you help?

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