PARP Research Group University of Murcia, Spain


Starting guide

Framework setup

This guide is intended to help in the installation and configuration of the QVision on a new system. It also includes instructions to get a first "hands-on", not so simple "kind-of-hello-world" QVision sample application running.

Dependencies of the QVision

Right now, QVision needs the following libraries and programs to be installed. The framework will be a modular library in a future, so you will be able to compile the core features without unneeded functionality:

Setting up Ubuntu systems

If you are planning to install QVision on a Ubuntu, Debian or any other distribution with a package management system based on apt-get, synaptic, or adept, you can directly install the following packages:
  • Packages for Qt library: libqt4-core, libqt4-debug, libqt4-dev, libqt4-gui, libqt4-qt3support, qt4-designer, qt4-dev-tools and qt4-doc.
    Version 4.3.2-0ubuntu3.1 of these packages was tested and works correctly for current version of QVision.
  • Packages for QWT library: libqwt5-qt4 and libqwt5-qt4-dev.
    Version 5.0.1-2 of these packages was tested and worked correctly for current version of QVision.
  • Packages for MPlayer: mencoder and mplayer.
    Version 2:1.0 was tested and worked correctly for current version of QVision.
  • Packages for GSL and scientific calculus: libgsl0 and libgsl0-dev.
    Version 1.9-3 for the GSL library was tested and worked correctly for current version of QVision.
  • Packages for Intel's IPP: there are no packages available in apt-get for that library. A free (consult conditions here) version is available for Linux platforms. You can download it from Intel's IPP homepage. Version 5.3 of this library was tested and worked correctly for current version of QVision.
  • Package for g++: Qt uses this compiler to built programs, but is not generally included with Ubuntu's base install. It should be included with the package g++.

Compilation and Install.

Latest release and older versions can be downloaded from the following url:

http://forja.rediris.es/frs/?group_id=321

Once you have the tar file for QVision, named QVision.<version>.tgz, copy it to your home directory (or a temporary location for compiling), and untar-it using this line:

# tar xzvf QVision.<version>.tgz

Then you should rename or copy the file config.pri.example inside the QVision directory to config.pri. This file contains several configuration variables which can be modified to tune the compilation and installation of the library. You can read the text information included in the own config.pri file about them.

Once customized the config.pri file to your needs and system, compile the library using the following commands inside the QVision directory:

# qmake
# make

This will compile the library. When compilation is done, you should install it in your system. This will copy some files in the directory specified in the variable 'INSTALL_PATH'. If that route is in your home directory, or other place you have permissions to write, you should simply do the following:

	# make install

Otherwise, you should use sudo console command, to copy the files as a super-user:

	# sudo make install

If you need to uninstall the library, simply compile again, and use the following line:

	# sudo make uninstall

This will erase QVision's library files from the directory where you installed it previously.

First application under the QVision

QVision projects

QVision applications are created inside Qt projects, which are specified by Qt project file. These files contain configuration information to compile the C++ sources of the application under the Qt, and in our QVision applications, also to link with the QVision library.

The following is the content of an example Qt project file to create a QVision application from a single C++ source file named example.cpp:

include(/usr/local/QVision/qvproject.pri)
TARGET = example
SOURCES = example.cpp

The include directive is used to load the configuration contained in other project files. Every QVision project should include the file qvproject.pri, located in the QVision installation directory, which contains the proper configuration to compile QVision applications. The route to the qvproject.pri file must be modified, according to the installation directory of the library.

The TARGET variable must be set to the name of the target executable file for the application. The SOURCES variable must contain a list of the names of the source files in the project. In our example, the project will have only one file, named example.cpp.

The first program

We can store the previous project file with the name example.pro and the example.cpp source file in the same directory. The latter source file will contain the following code:

#include <iostream>
#include <qvio.h>
#include <qvipp.h>
int main(int argc, char *argv[])
        {
        // Check if the user provided enough command line parameters.
        if (argc < 3)
                {
                std::cout << "Usage: " << argv[0] << " <input image> <output image>" << std::endl;
                return -1;
                }

        // Input and output images
        QVImage<uChar, 3> inputImage, outputImage;

        // Read the input image
        readQVImageFromFile(argv[1], inputImage);

        // Apply Gauss filter
        FilterGauss(inputImage, outputImage);

        // Write output image
        writeQVImageToFile(argv[2], outputImage);
        }

The application applies a Gaussian filter on the contents of the image file specified in the first command line parameter, and stores the resulting image in the file specified in the second command line parameter.

Compiling and executing the program

Once the files example.cpp and example.pro are created in the same directory, you can compile the application using the qmake and the make tools:

        # qmake
        # make

This should create the binary executable example. You can execute the application using a command line like the following:

        # ./example lena.png lena-gauss.png

Assuming that an image file named lena.png exists, and contains the following image:

lena.png

The application creates a new image named lena-gauss.png as indicated by the second command line paramenter, storing the following image:

lena-gauss.png



QVision framework. PARP research group, copyright 2007, 2008.