TLIB documentation




This document is a basic overview of TLIB that exposes the underlying concepts behind the design and organization of the software. It is not meant to be exhaustive but instead is just a general outline, explaining the key features of the library. A more thorough description of TLIB classes and functionalities can be found in the reference pages of this on-line manual.

Please note that the /examples directory provides useful examples that are a good starting point to understand how to write an application using TLIB.

TLIB can be downloaded in multiple flavors and wrapping:

  • full source archive
  • pre-compiled for Microsoft Visual C++ 2008 (Express Edition)
  • pre-compiled for Microsoft Visual C++ 2005 (Express Edition)
  • pre-compiled for Microsoft Visual Studio 2003
  • tlib-2.1.tar.gz pre-compiled for Linux (kernel 2.6)
  • pre-compiled for Microsoft Visual Studio 6.0
  • pre-compiled for Borland C++ Builder 6.0

    The current version is tlib-2.1. Take a look at the release notes to find out about features. Feel free to contact for contributions and/or requests.


    After downloading the distribution from the download page, uncompress it to the location of your choice, et voil ! Under Windows, you may be prompted for missing third-party DLLs, depending on what is already installed on your system (see third-party run-time libraries requirements). The missing DLLs files must be placed in the same folder as your TLIB application, or in the system32 folder of your Windows installation (recommended).

    Third-party run-time libraries requirements

    Special instructions for Visual Studio Express 2005


    TLIB is an image processing library written specifically for real-time object tracking. It is meant for people with basic C/C++ programming and image processing skills. TLIB aims at fulfilling several goals:

    Thus, TLIB has been designed to make it easy for most programmers to include efficient computer vision code into their applications rapidly, in particular for applications that require vision-based detection and tracking.


    This section covers some of the features and formats that TLIB supports.

    Image Formats

    TLIB uses a simple pixel array type that can be used for virtually any image format. Pixels are held in a unidimensional array, namely the pixel member or the tlPixelArray class. Depending on the image format, an image will have a number of channels. Pixels from various channels are transparently recorded in the pixel array. For instance, in the case of the RGB file format, pixel will contain an array of pixels in the following sequence: RGBRGBRGBRGBRGB...

    The pixel array starts at the upper left corner of the image and save pixels line after line. The tl_format section describes the different image formats and color spaces that TLIB can handle.


    The TLIB library is a set of optimized ANSI C functions that are wrapped up in a set of higher-level C++ objects. The benefits of this dual-level architecture are a significant reduction of the amount and of the redundancy of code written by the programmer.


    This section describes the different high-level objects that TLIB is made of.

    The following objects are wrappers for hardware/platform dependant components such as image digitizers and displays. They are provided as a convenience for commonly used hardware and operating systems, and can be used as templates for the programmer to write his/her own hardware drivers. The list below gives the currently available implementations available in TLIB.

    C functions

    C functions are the core of TLIB. They implement optimized operators on specific data types. Programmers should try to use objects structure, mostly because the objects method performs all the necessary data consistency checks and conversion before calling the low-level C function. However, experienced programmers that are familiar with TLIB data types and architecture may find it useful to work with C function to enhance performance or implement new object operators.

    All low-level C functions have a tl_ prefix. They are grouped by categories, as described below.

    Data type

    Here are the most important data types used in TLIB.

    Code optimization

    A word is required here on code optimization. There are two kinds of code optimization techniques, described below.

    For portability reasons, TLIB relies only on hardware-independant code optimization.

    Below is a list of simple guidelines for programmers who use TLIB and who wish to make their code more efficient. Please note that, generally, optimization leads to less readable code that is more difficult to debug (quite often, optimizing code introduces bugs). The recommended approach is to write "standard" code to test algorithms before applying optimization rules.

    Also, please note that these techniques are here to help the compiler do a better job only. Results will vary depending on the compiler, the optimization flags and the hardware.

    Support and contributions

    TLIB is, by definition, an ever-evolving library. As such, it is also likely to contain bugs and to display some design flaws. Questions and comments can be addressed to (please mention TLIB in the subject line).

    TLIB documentation - generated on 7 May 2008
    Please address any questions to
    (C) 2001-2008 - S. Grange
    (C) 2001-2007 - VRAI Group, EPFL
    All Rights Reserved.