Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/
- sudo raspi-config #use all of the SD card.
- sudo apt purge wolfram-engine #and libreoffice
- sudo apt install -y build-essential git cmake pkg-config
- sudo apt update; sudo apt-get upgrade; sudo rpi-update
- sudo apt-get -y install python2.7-dev python3-dev
- sudo apt install -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
- sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
- sudo apt-get install -y libxvidcore-dev libx264-dev
- sudo apt-get install -y libgtk2.0-dev
- sudo apt-get install -y libatlas-base-dev gfortran
- wget https://bootstrap.pypa.io/get-pip.py
- sudo python get-pip.py
- pip install numpy
- cd ~
- #### do github clone here rather.
- #wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.0.zip
- #unzip opencv.zip
- wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.0.zip
- unzip opencv_contrib.zip
- cd /etc/dphys-swapfile
- # set size to absolute value, leaving empty (default) then uses computed value
- # you most likely don't want this, unless you have an special disk situation
- # CONF_SWAPSIZE=100
- # https://www.bitpi.co/2015/02/11/how-to-change-raspberry-pis-swapfile-size-on-rasbian/
- CONF_SWAPSIZE=1024
- sudo /etc/init.d/dphys-swapfile stop
- sudo /etc/init.d/dphys-swapfile start
- cd ~/opencv-3.3.0/
- mkdir build
- cd build
- cmake -D CMAKE_BUILD_TYPE=RELEASE \
- -D CMAKE_INSTALL_PREFIX=/usr/local \
- -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
- -D ENABLE_NEON=ON \
- -D ENABLE_VFPV3=ON \
- -D BUILD_TESTS=OFF \
- -D INSTALL_PYTHON_EXAMPLES=ON \
- -D BUILD_EXAMPLES=ON ..
- make -j4; sudo make install; sudo ldconfig
- #go back to swap file reset to 100mb!
- #https://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/
- # make certain that cv2.so in site packages are in both python2 and 3 . See web for details.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement