Skip to content

Instantly share code, notes, and snippets.

@shivarajnaidu
Created September 18, 2018 03:36
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 shivarajnaidu/5973d15cae9a6f8ad2c0ce7ee31b9932 to your computer and use it in GitHub Desktop.
Save shivarajnaidu/5973d15cae9a6f8ad2c0ce7ee31b9932 to your computer and use it in GitHub Desktop.
Shell script to install opencv on ubuntu linux
#!/bin/sh
cd ~
sudo apt update
sudo apt install wget git build-essential pkg-config cmake -y
# Clone OpenCV repos
git clone https://github.com/opencv/opencv.git --depth=1
git clone https://github.com/opencv/opencv_contrib.git --depth=1
# Build And Compile
mkdir opencv/build
cd opencv/build
cmake ../
make
# Install
sudo make install
# Link
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
# Print The Version
pkg-config --modversion opencv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment