BPI-M3 compile Opencv 3.1.0 source code, thank @zhiqing_yu do this work.
test image : raspbian-jessie for BPI-M3
As a result of the m3 processor performance is very powerful, very suitable for image processing, so want to use the m3 recently run opencv and through the control of unmanned aerial vehicle (uav) flight mavlink protocol. For terrain imaging, obstacle recognition, target track, etc.
Below, I combined with automatic shell script installation, the installation process of OpenCV.
#!/bin/bash # bpi m3 setup script for use as companion computer # update m3 to latest versions
1 Because of BPI-M3 emmc only 8 g installation system and compile opencv space is not enough, from emmc startup and cannot use the tf card, they are. In the end I chose in the tf card installed on the system, emmc as download and compile storage space.
sudo umount /dev/mmcblk1 sudo mkfs -V /dev/mmcblk1 sudo mount /dev/mmcblk1 /home/pi/emmc
delete wolfram-engine can save 600MB space.
sudo apt-get purge wolfram-engine
Raspberry pie source update slow at china, must be replaced for the domestic image
eidt etc/apt/sources.list first line to:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ jessie main contrib non-free rpi
Note : not edit others .
sudo apt-get update sudo apt-get upgrade
2 install python and pip, to prepare for the installation of the unmanned aerial vehicle (uav) control
sudo apt-get install python-dev sodo wget https://bootstrap.pypa.io/get-pip.py sudo python get-pip.py
3 Installation of unmanned aerial vehicle (uav) package:dronekit
sudo pip install dronekit dronekit-sitl sudo pip install mavproxy
4 Installation of dynamic image processing package, made two mistakes during installation, just repeat install to fixed it.
sudo apt-get install gstreamer1.0
5 Install hotspot service package:
sudo apt-get install hostapd isc-dhcp-server
6 begin to install OpenCV:
sudo apt-get install build-essential git cmake pkg-config sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev sudo apt-get install libxvidcore-dev libx264-dev sudo apt-get install libgtk2.0-dev sudo apt-get install libatlas-base-dev gfortran sudo apt-get install python2.7-dev python3-dev sudo pip install numpy
download opencv source , I tried 3.1 release package, gpu sample there are errors, compile and build with the latest source no problem.
cd emmc（mount location ） sudo git clone https://github.com/Itseez/opencv.git sudo git clone https://github.com/Itseez/opencv_contrib.git
Set up build directory
sudo mkdir emmc/opencv/build cd emmc/opencv/build
Run cmake to configured
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=/home/pi/emmc/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON ..
After the completion, compile installation
make -j8（m3 need 1 hour,raspberry pi 3 need 2 hour，raspberry pi 2 need 2.5 hour，rasperry pi 1 need 9 hour） sudo make install sudo ldconfig
At this point opencv compiler installed, good luck
The following is a control of unmanned aerial vehicle (uav) flight routine reference source, who are interested in his study
# picamera (likely already included from opencv) # sudo pip install "picamera[array]" # cherrypy web server (used by red balloon finder) sudo pip install cherrypy # install red balloon finder sudo apt-get install screen cd ~ git clone https://github.com/diydrones/companion.git git clone https://github.com/rmackay9/ardupilot-balloon-finder