Sei sulla pagina 1di 2

STEPS FOR OPENCV+ROS on LUBUNTU 13.04:

install lubuntu 13.04 on a 16 GB uSD card.

copy hard kernel folder to /usr/local/lib and odroid-config.sh in /usr/local/sbin folder

change ownership of hard kernel folder and odroid-config using chown chown -R root /usr/local/lib/hardkernel cd /usr/local/sbin chmod 777 odroid-config

go to the folder sbin run sudo odroid-config

now expand the filesystem, enable SSH, change screen resolution if required and reboot

now update your kernel from this link using the following commands. This is necessary for changing the default external video devices channel nos to 0-9, i.e for example your webcam will now take device 0 or 1 instead of 13 or 14. device nos 13/14 will not work in opencv wget http://builder.mdrjr.net/tools/kernel-update.sh chmod +x kernel-update.sh sudo ./kernel-update.sh

change sources file to install updates. without this, you will not be able to install ROS.

go to /etc/apt/sources.list and replace all ‘archives’ to ‘old-releases’ and all ‘ubuntu-ports’ to

‘ubuntu’. ex.: http://old-releases.ubuntu.com/ubuntu/ you will need superuser rights to make changes to this file, so open the file like this : sudo edit sources.list

now run sudo apt-get update

instructions as mentioned on ROS website

OPENCV:

sudo apt-get -qq remove ffmpeg x264 libx264-dev

Install dependencies

sudo apt-get install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 libxvid-dev v4l-utils

Install jpeg turbo:

download latest jpeg turbo tar ball and unzip

cd libjpeg-turbo-1.3.0

mkdir build

cd build

/configure --enable-static

Open the Makefile (in the build directory) to add the compiler flags. gedit Makefile

Find "CFLAGS" in the Makefile to add the C compiler flags. (Ctrl+F). Replace that line with:

CFLAGS =-O3 -mfpu=neon -mcpu=cortex-a9 -mfloat-abi=hard -ftree-vectorize -ftree-vectorizer- verbose=9 -fPIC Similarly Find the "CXXFLAGS" and replace it to :

CXXFLAGS = -g -O2 -mcpu=cortex-a9 -mfloat-abi=hard -ftree-vectorize -ftree-vectorizer- verbose=9 -fPIC sudo make sudo make install

libjpeg-turbo is now installed at /opt/libjpeg-turbo

Install ffmpeg:

download latest ffmpeg tar ball and unzip cd ffmpeg ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable- libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable- nonfree --enable-postproc --enable-version3 --enable-x11grab —enable-shared

sudo make sudo make install

Put in all cmake flags

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local - DENABLE_NEON=ON -DWITH_TBB=ON -DBUILD_TBB=ON -DBUILD_EXAMPLES=ON - DWITH_JPEG=ON -DBUILD_JPEG=OFF -DJPEG_INCLUDE_DIR=/opt/libjpeg-turbo/include/ -

DJPEG_LIBRARY=/opt/libjpeg-turbo/lib32/libjpeg.a -D BUILD_NEW_PYTHON_SUPPORT=ON -D

WITH_V4L=ON -D WITH_OPENCL=ON -D WITH_OPENGL=ON -DENABLE_VFPV3=ON CMAKE_OUTPUT.txt

|& tee

make -j4 sudo checkinstall sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' sudo ldconfig