Last active
September 11, 2020 11:41
-
-
Save seunboy1/613866033f44222c2ee63b9546a33031 to your computer and use it in GitHub Desktop.
This tutorial shows how to install opencv on vscode (Ubuntu) for c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was gotten from https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/ | |
# Create your working directory | |
mkdir project && cd project | |
#Visit to follow the article | |
Change CMAKE_INSTALL_PREFIX=$cwd/installation/OpenCV-"$cvVersion" \ to CMAKE_INSTALL_PREFIX=/usr/local \. and | |
OPENCV_PYTHON3_INSTALL_PATH=$cwd/OpenCV-$cvVersion-py3/lib/python3.5/site-packages \ to the right directory | |
# Ignore step 2 in the article and do the following: | |
set (CMAKE_CXX_STANDARD 14) | |
find_package(OpenCV REQUIRED PATHS /usr/local/lib/cmake/opencv4/) | |
include_directories(${OpenCV_INCLUDE_DIRS}) | |
set(LIBS ${OpenCV_LIBS}) | |
target_link_libraries( OPENCVTUT ${OpenCV_LIBS} ) | |
# Go to your current working directory and do the following : | |
mkdir build | |
cmake -H. -B build | |
cmake --build build | |
ls ./build/<executable file> | |
To build for android use this tutorial | |
https://github.com/VlSomers/native-opencv-android-template |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment