- 背景资料
- 作者:瑞典朋友圈
- 分类:Linux
--- enable SSH ---
sudo raspi-config
--- eable GPIO programming ---
$ sudo apt-get update
$ sudo apt-get install python-rpi.gpio
$ sudo pip install --upgrade pip -i https://pypi.python.org/simple/
$ sudo pip install imutils -i https://pypi.python.org/simple/
$ sudo pip install matplotlib -i https://pypi.python.org/simple/
$ sudo pip install numpy -i https://pypi.python.org/simple/
--- OpenCV ---
$ sudo apt-get update && sudo apt-get upgrade && sudo rpi-update
$ sudo apt-get install build-essential git cmake pkg-config
$ sudo apt-get install sudo apt install libgdk-pixbuf2.0-dev libpango1.0-dev libcairo2-dev
$ sudo apt-get install libjpeg-dev libtiff-dev libjasper-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk2.0-dev libatlas-base-dev gfortran
$ git clone https://github.com/Itseez/opencv.git && cd opencv &&git checkout 3.0.0
$ sudo apt-get install python2.7-dev
$ cd ~ && wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
$ pip install numpy
Sometimes pip install is very slow, because it is compiling.
$ cd ~/opencv && mkdir build && cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_EXAMPLES=ON ..
$ make -j4
$ sudo make install && sudo ldconfig