diff --git a/installOpencvWithModules/README.md b/installOpencvWithModules/README.md new file mode 100644 index 0000000..db8db81 --- /dev/null +++ b/installOpencvWithModules/README.md @@ -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 diff --git a/installOpencvWithModules/installopenCV.sh b/installOpencvWithModules/installopenCV.sh new file mode 100755 index 0000000..626ef06 --- /dev/null +++ b/installOpencvWithModules/installopenCV.sh @@ -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