Install ArUco on Ubuntu Linux

aruco

ArUco is a library for Augmented Reality applications with a BSD license. The main features of ArUco are: detect markers with a single line of C++ code, detection of AR boards (markers composed by several markers), up to to 1024 different markers, trivial integration with OpenGL and OGRE, fast, reliable and cross-platform. ArUco will help you to get running your AR application in less than 5 minutes.

Install ArUco is simple, just follow these steps:

1. INSTALL OPENCV

The first step is install OpenCV on Ubuntu Linux.

3. DOWNLOAD AND DECOMPRESS ARUCO

Enter the ArUco official website and download the latest version for ArUco. Then decompress the downloaded file.

4. COMPILE ARUCO

Now, in your terminal, make sure you are within the ArUco directory and run the following commands:

mkdir build

cd build

cmake ..

make

sudo make install

5. CONFIGURE ARUCO

In your terminal, execute:

sudo gedit /etc/ld.so.conf.d/aruco.conf

Add the following line and save it:

/usr/local/lib

Now, in your terminal, execute:

sudo ldconfig

Again, execute:

sudo gedit /etc/bash.bashrc

Check if the following two lines are at the end of the file. If not, add them and save the file:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

Finally, reboot your computer.

6. TRY AN EXAMPLE

To test an example, from your terminal enters in the ArUco folder. Once you're inside it, enters in build/utils. Now, execute:

./aruco_create_board 5:2 board.png board.yml

With this, we have created a marker board with a size of 5×2. The image is board.png and board.yml is the board configuration.

boardaruco

Install OpenCV on Ubuntu Linux

opencvubuntu

Note: This tutorial has been tested on Ubuntu 12.04 LTS with OpenCV 2.4.3.

Install OpenCV on Ubuntu Linux is a bit long but very easy. Simply, follow these steps:

1. UPDATE AND UPGRADE UBUNTU

Open your terminal and execute:

sudo apt-get update

sudo apt-get upgrade

2. INSTALL THE DEPENDENCIES

Now execute:

sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev

3. DOWNLOAD AND DECOMPRESS OPENCV

Enter the OpenCV official website and download the latest version for Ubuntu Linux. Then decompress the downloaded file.

4. COMPILE OPENCV

Now, in your terminal, make sure you are within the OpenCV directory and run the following commands:

mkdir build

cd build

cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

make

sudo make install

5. CONFIGURE OPENCV

In your terminal, execute:

sudo gedit /etc/ld.so.conf.d/opencv.conf

Add the following line and save it:

/usr/local/lib

Now, in your terminal, execute:

sudo ldconfig

Again, execute:

sudo gedit /etc/bash.bashrc

Add the following two lines at the end of the file and save it:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

Finally, reboot your computer.

6. TRY AN EXAMPLE

To test an example, from your terminal enters in the OpenCV folder. Once you're inside it enters in samples/c.

Now, execute:

chmod +x build_all.sh

./build_all.sh

./facedetect lena.jpg

lenaopencv