Skip to content

OpenCV installer with contrib modules #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions installOpencvWithModules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Install opencv with contrib modules for [ArUco](https://docs.opencv.org/3.4.0/db/da9/tutorial_aruco_board_detection.html) and [ChArUco](https://docs.opencv.org/3.1.0/df/d4a/tutorial_charuco_detection.html) boards
opencv_dnn module is placed in the secondary opencv_contrib repository, which isn't distributed in binary form, therefore you need to build it manually.

### For Windows and Mac users
I recommend you follow these [steps](https://docs.opencv.org/3.2.0/de/d25/tutorial_dnn_build.html). Liunx users can also follow but there is a faster way

### Linux users
if you go back to the folder, ["installOpencvWithModules"](https://github.com/N-kelkay/opencv-installer/tree/master/installOpencvWithModules), you will see a shell file called installopenCV.sh. all you need to do is
- Download that file, by either cloning the repository and taking it out or some other method.
- Open terminal or another command-line interpreter, then get to the directory where you saved the file
- Then type: `sudo chmod -x _path_installOpenCV.sh`. for "_path_" replace it with the path file starting from your home folder Example: `sudo chmod -x /home/"compuername"/Desktop/installOpenCV.sh`
- The type `sudo sh ./installopenCV.sh`. This will actually install it. It might take while, and it might also ask for admin password so make sure to watch for that
35 changes: 35 additions & 0 deletions installOpencvWithModules/installopenCV.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not run as root, exiting."
exit
fi
mkdir installOpenCV
cd installOpenCV
apt update
apt install -y unzip git
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout 3.3.1
cd ../
wget https://github.com/opencv/opencv/archive/3.3.1.zip
unzip 3.3.1.zip
cd opencv-3.3.1
apt install -y build-essential
apt install -y cmake libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
apt install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
apt install -y libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
apt install -y libxine2-dev libv4l-dev
apt install -y qt5-default libgtk2.0-dev libtbb-dev
apt install -y libatlas-base-dev
apt install -y libfaac-dev libmp3lame-dev libtheora-dev
apt install -y libvorbis-dev libxvidcore-dev
apt install -y libopencore-amrnb-dev libopencore-amrwb-dev
apt install -y x264 v4l-utils
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
make -j$(nproc)
make install
ldconfig
cd ../../..
rm -rf installOpenCV