Advertisement
Guest User

opencv raspberry pi

a guest
Nov 4th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.98 KB | None | 0 0
  1. #https://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/
  2. sudo raspi-config  #use all of the SD card.
  3.  
  4. sudo apt purge wolfram-engine  #and libreoffice
  5.  
  6. sudo apt install     -y build-essential git cmake pkg-config
  7. sudo apt update; sudo apt-get upgrade; sudo rpi-update
  8. sudo apt-get         -y install python2.7-dev python3-dev
  9. sudo apt install     -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
  10. sudo apt-get install -y  libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
  11. sudo apt-get install -y libxvidcore-dev libx264-dev
  12. sudo apt-get install -y libgtk2.0-dev
  13. sudo apt-get install -y libatlas-base-dev gfortran
  14. wget https://bootstrap.pypa.io/get-pip.py
  15. sudo python get-pip.py
  16. pip install numpy
  17.  
  18. cd ~
  19. #### do github clone here rather.
  20. #wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.0.zip
  21. #unzip opencv.zip
  22.  
  23. wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.0.zip
  24. unzip opencv_contrib.zip
  25.    
  26. cd /etc/dphys-swapfile
  27. # set size to absolute value, leaving empty (default) then uses computed value
  28. #  you most likely don't want this, unless you have an special disk situation
  29. # CONF_SWAPSIZE=100
  30. # https://www.bitpi.co/2015/02/11/how-to-change-raspberry-pis-swapfile-size-on-rasbian/
  31. CONF_SWAPSIZE=1024
  32.  
  33. sudo /etc/init.d/dphys-swapfile stop
  34. sudo /etc/init.d/dphys-swapfile start
  35.  
  36. cd ~/opencv-3.3.0/
  37. mkdir build
  38. cd build
  39. cmake -D CMAKE_BUILD_TYPE=RELEASE \
  40.     -D CMAKE_INSTALL_PREFIX=/usr/local \
  41.     -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
  42.     -D ENABLE_NEON=ON \
  43.     -D ENABLE_VFPV3=ON \
  44.     -D BUILD_TESTS=OFF \
  45.     -D INSTALL_PYTHON_EXAMPLES=ON \
  46.     -D BUILD_EXAMPLES=ON ..
  47. make -j4; sudo make install; sudo ldconfig
  48. #go back to swap file reset to 100mb!
  49.  
  50.  
  51. #https://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/
  52. # 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