-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_opencv.sh
More file actions
38 lines (24 loc) · 835 Bytes
/
install_opencv.sh
File metadata and controls
38 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
NC="\033[0m"
BLUE="\033[0;32m"
echo -e " ${BLUE}----------- Install OpenCV for C++ -------------------${NC} "
mkdir -p install_opencv/ && cd install_opencv/
sudo apt-get update
sudo apt-get upgrade
sudo aot-get install libgtk2.0-dev pkg-config
sudo apt install -y g++
sudo apt-get install -y cmake make
sudo apt-get install -y git
echo ">> g++ version: "
g++ --version
echo ">> cmake version: "
cmake --version
git clone https://github.com/opencv.git
git clone https://github.com/opencv_contrib.git
mkdir -p build/ && cd build/
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
make -j4
sudo make install
cd ../ # return to install_opencv/
cd ../ # return to the main folder
# We do not need that aymore, because opencv are saved in '/usr/local/bin' and '/usr/local/lib':
rm -rf install_opencv