Apbase Library Setup in Linux


Build/Test environments
Ubuntu versions 10.04, 12.04 (32/64-bit)


Required run-time libraries
• libusb-1.0 (libusb website: www.libusb.org)
• libtbb (sudo apt-get install libtbb) please check: http://www.threadingbuildingblocks.org
• libpython3.3
To install libusb in Linux:
sudo apt-get install libusb-1.0
To install Python library for Linux Users:
User needs to download and build the python source code for the Ubuntu earlier than 13.04.
User needs to activate the shared object option and set prefix to /usr/local (or your path settings) in the python configuration (e.g. ./configure --enable-shared --prefix=/usr/local)


Optional developer libraries
• Qt Framework (Please check: qt-project.org for details).


Installation Instructions
Apbase Platform Setup Instructions:
• Download and run the Aptina DevSuite installer.
• Verify the libapbase and libmidlib2 library/header files are installed in the sub-directory /lib and /include.
• Verify the libusb-1.0, libtbb and libpython.3.3m run time library files are installed in the Linux machine.
Note: Aptina apbase and midlib2 libraries use LibUSB 1.0.9.


Aptina DevWareX Directory Structure:
– /Aptina_Imaging_Dev/apps_data - contains Aptina sensor setting (.ini) files for the different supported sensors.
– /Aptina_Imaging_Dev /board_data - contains Aptina Demo boards (.cdat) files.
– /Aptina_Imaging_Dev /sensor_data - contains the Aptina sensor data (.sdat/.xsdat) files.
– /Aptina_Imaging_Dev /lib - contains Aptina shared object (.so) files for the Linux System.
– /Aptina_Imaging_Dev /include - contains apbase and midlib2 C/C++ header (.h) files.
– /Aptina_Imaging_Dev /samples - contains C/Qt sample files which use Aptina apbase and midlib2 libraries.
Note: Please keep the same directory structure. Apbase use relative directory to search the data files if user does not specify the sensor data file in the code.
Required files in data directories: "sensor_data", "apps_data" and "board_data"

Test Application (SimpleQt) Build Instructions
./samples/SimpleQt/ is a sample test program that opens Aptina Demo kits and sensors, initializes it and display captured images. User needs Administrator account to access the USB devices. (sudo ./SimpleQt).

To build SimpleQt in Linux: Modify the SimpleQt.pro file and use Qt Creator and open the SimpleQt.pro file then build all. Or use qmake/make from the command-line. Please read Qt document (qt-project.org) for more information.
The two .so files required for SimpleQt are:
libmidlib2.so and libapbase.so
Note:
1. Type 'export LD_LIBRARY_PATH=SimpleQt_directory' before execute the binary.
2. Modify the SimpleQt.pro file based on your System (Linux 32/64).


Test Application (SimpleCapture) Build Instructions
./samples/SimpleCapture/ is a sample test program that opens Aptina Demo kits and sensors, initializes it, captures one or more frames, save it and exists. User needs Admin right to access the USB devices. (sudo ./SimpleCapture).

To build SimpleCapture in Linux:
1. Modify SimpleCapture.cpp for the target sensor.
2. Modify makefile.linux with the location of the apbase, midlib2 libraries and include files.
3. Make sure the correct sensor data file (.xsdat file) is in the "/sensor_data/" directory and an INI file in the "/apps_data/" directory. Or user can specify the file locations in the C code.
4. Create a section in the application to make sensor specific register calls if it is required.
5. Build the test application by typing 'make -f makefile.linux'.
6. Execute by typing 'sudo ./SimpleCapture'
Note: SimpleCapture will capture a frame and store it in a file (something like img.raw).