We follow the instructions on
http://salaboy.com/2013/06/14/using-javacv-in-the-raspberry-pi-linux-arm/
The following are the actual steps we did:
Install the dependency:
sudo apt-get install build-essential cmake pkg-config libpng12-0 libpng12-dev libpng++-dev libpng3 sudo apt-get install libpnglite-dev libpng12-0 libpng12-dev libpng++-dev libpng3 zlib1g-dbg zlib1g zlib1g-dev pngtools libtiff4-dev sudo apt-get install libtiff4 libtiffxx0c2 libtiff-tools libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-progs ffmpeg libavcodec-dev sudo apt-get install libavcodec53 libavformat53 libavformat-dev libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev sudo apt-get install libxine1-ffmpeg libxine-dev libxine1-bin libunicap2 libunicap2-dev libdc1394-22-dev libdc1394-22 libdc1394-utils sudo apt-get install swig libv4l-0 libv4l-dev
Download, compile, and install OpenCV:
wget http://netcologne.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.5/opencv-2.4.5.tar.gz tar -xvzf opencv-2.4.5.tar.gz cd opencv-2.4.5 mkdir release cd release/ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=OFF -D BUILD_EXAMPLES=OFF .. make sudo make install
The above steps will take about 2 hours.
sudo ldconfig
Now, we begin to download and compile javacv. Before we do that, we need to install:
sudo apt-get install maven sudo apt-get install git sudo apt-get install openjdk-6-jdk
Configure the java path:
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-armhf/ ubuntu@ubuntu:~/opencv-2.4.5/release/javacv$ export $JAVA_HOME export PATH=$PATH:$JAVA_HOME/bin
Download JavaCV:
git clone https://code.google.com/p/javacv/ git clone https://code.google.com/p/javacpp/
We need to remove preload=’tbb’ in open_core.java:
cd javacv leafpad ./src/main/java/com/googlecode/javacv/cpp/opencv_core.java
search for preload=”tbb” can remove this term
sudo ln -s /usr/lib/jvm/java-6-openjdk-armhf/jre/lib/arm/server/libjvm.so libjvm.so.0
Now we can build javac by doing:
cd javacv mvn clean install -Dplatform.name=linux-arm
Leave a Reply
You must be logged in to post a comment.