TLIB documentation
 

tlVision.h File Reference


Detailed Description

Main TLIB header file.

#include <iostream>
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include "tlChannel.h"
#include "tlConvolution.h"
#include "tlEdges.h"
#include "tlError.h"
#include "tlExtract.h"
#include "tlFile.h"
#include "tlFilter.h"
#include "tlFind.h"
#include "tlFormatConversion.h"
#include "tlMemory.h"
#include "tlMorph.h"
#include "tlNormalize.h"
#include "tlPixel.h"
#include "tlScale.h"
#include "tlThread.h"
#include "tlTimer.h"
#include "tlTransforms.h"
#include "tlSize.h"
#include "tlLocation.h"
#include "tlRect.h"
#include "tlPixelArray.h"
#include "tlBackground.h"
#include "tlBlobs.h"
#include "tlChain.h"
#include "tlColor.h"
#include "tlColorModel.h"
#include "tlConst.h"
#include "tlHist.h"
#include "tlHist2D.h"
#include "tlHough.h"
#include "tlImage.h"
#include "tlLine.h"
#include "tlMask.h"
#include "tlObject.h"
#include "tlPoint.h"
#include "tlSpiral.h"

Include dependency graph for tlVision.h:

Go to the source code of this file.

Defines

#define TL_PI   3.14159265358979323846
#define TL_DEFAULT_COLS   320
#define TL_DEFAULT_ROWS   240
#define TL_MAX_PIXEL_VAL   255
#define TL_MIN_PIXEL_VAL   0
#define TL_NOT_CONNEX   0
#define TL_CONNEX_4   1
#define TL_CONNEX_8   2
#define TL_PIXEL(row, col, width)   (((row)*(width))+(col))
#define TL_MIN(a, b)   (((a)<(b))?(a):(b))
#define TL_MAX(a, b)   (((a)>(b))?(a):(b))
#define TL_HMHL_TO_HVAL(hm, hl)   (((hm) << 8) | (hl))
#define TL_HVAL_TO_HM(hval)   ((hval) >> 8)
#define TL_HVAL_TO_HL(hval)   ((hval & 0xff))
#define TL_DEG_TO_HVAL(deg)   (unsigned short int) (TL_MAX_HPIXEL_VAL*(deg)/360)
#define TL_HVAL_TO_DEG(hval)   (360.0f*(hval)/TL_MAX_HPIXEL_VAL)
#define TL_PCT_TO_SVAL(pct)   (tlPixel) (TL_MAX_PIXEL_VAL*(pct)/100)
#define TL_SVAL_TO_PCT(sval)   (100.0f*(sval)/TL_MAX_PIXEL_VAL)
#define TL_PCT_TO_IVAL(pct)   (tlPixel) (TL_MAX_PIXEL_VAL*(pct)/100)
#define TL_IVAL_TO_PCT(ival)   (100.0f*(ival)/TL_MAX_PIXEL_VAL)
#define TL_PAUSE   getc();
#define TL_NOT_IMPLEMENTED
#define TL_RGB_WIDTH   3
#define TL_NRG_WIDTH   2
#define TL_HSI_WIDTH   4
#define TL_YUV_WIDTH   3
#define TL_GRAY_WIDTH   1
#define TL_BIN_WIDTH   1
#define TL_STEREO_WIDTH   1
#define TL_MAX_PIXEL_WIDTH   4
#define TL_CHANNEL_RED   0
#define TL_CHANNEL_GREEN   1
#define TL_CHANNEL_BLUE   2
#define TL_CHANNEL_H   0
#define TL_CHANNEL_S   2
#define TL_CHANNEL_I   3
#define TL_CHANNEL_NR   0
#define TL_CHANNEL_NG   1
#define TL_CHANNEL_GRAY   0
#define TL_CHANNEL_BIN   0
#define TL_CHANNEL_STEREO   0

Typedefs

typedef unsigned char tlPixel
typedef int tlHistData

Enumerations

enum  tl_format {
  RGB, NRG, HSI, YUV,
  GRAY, BIN, STEREO, CUSTOM
}

Functions

void tl_set_verbose (int val)
int tl_init_lib (int argc, char **argv)

Variables

int tlVerbose


Define Documentation

#define TL_BIN_WIDTH   1

Size (in bytes) of one pixel from a BIN image.

Referenced by tl_gray2bin(), tl_hsi2bin(), tl_nrg2bin(), tl_rgb2bin(), and tl_yuv2bin().

#define TL_CHANNEL_BIN   0

Shortcut to the binary channel of a BIN image.

#define TL_CHANNEL_BLUE   2

Shortcut to the B channel of a RGB image.

#define TL_CHANNEL_GRAY   0

Shortcut to the intensity channel of a GRAY image.

#define TL_CHANNEL_GREEN   1

Shortcut to the G channel of a RGB image.

#define TL_CHANNEL_H   0

Shortcut to the first H channel of a HSI image.

#define TL_CHANNEL_I   3

Shortcut to the first i of a HSI image.

#define TL_CHANNEL_NG   1

Shortcut to the normalized G channel of a NRG image.

#define TL_CHANNEL_NR   0

Shortcut to the normalized R channel of a NRG image.

#define TL_CHANNEL_RED   0

Shortcut to the R channel of a RGB image.

#define TL_CHANNEL_S   2

Shortcut to the S channel of a HSI image.

#define TL_CHANNEL_STEREO   0

Shortcut to the disparity channel of a STEREO image.

#define TL_CONNEX_4   1

Indicates that 4-connex pixels are considered.

#define TL_CONNEX_8   2

Indicates that 8-connex pixels are considered.

Referenced by tlBlobs::clear(), tlChain::extract(), tl_extract(), tl_extract_cm_hsi(), tl_extract_cm_nrg(), and tlBlobs::tlBlobs().

#define TL_DEFAULT_COLS   320

#define TL_DEFAULT_ROWS   240

#define TL_DEG_TO_HVAL ( deg   )     (unsigned short int) (TL_MAX_HPIXEL_VAL*(deg)/360)

Convert hue: [0,360] deg to scaled 16-bit.
See image formats for details on the HSI format.

#define TL_GRAY_WIDTH   1

#define TL_HMHL_TO_HVAL ( hm,
hl   )     (((hm) << 8) | (hl))

Convert hue MSB and LSB to 16-bit HVAL.
See image formats for details on the HSI format.

#define TL_HSI_WIDTH   4

#define TL_HVAL_TO_DEG ( hval   )     (360.0f*(hval)/TL_MAX_HPIXEL_VAL)

Convert hue: scaled 16-bit to [0,360] deg.
See image formats for details on the HSI format.

#define TL_HVAL_TO_HL ( hval   )     ((hval & 0xff))

convert 16-bit HVAL to hue LSB.
See image formats for details on the HSI format.

#define TL_HVAL_TO_HM ( hval   )     ((hval) >> 8)

convert 16-bit HVAL to hue MSB.
See image formats for details on the HSI format.

#define TL_IVAL_TO_PCT ( ival   )     (100.0f*(ival)/TL_MAX_PIXEL_VAL)

Convert intensity: [0,100] percent to [0,TL_MAX_PIXEL_VAL].
See image formats for details on the HSI format.

#define TL_MAX ( a,
 )     (((a)>(b))?(a):(b))

Returns the greatest of two values.

Referenced by tlMask::adjust(), tlChain::blindExtract(), tlHist2D::build(), tlHist::build(), tlPixelArray::clear(), tlPixelArray::copy(), tlImage::crop(), tlImage::drawCross(), tlImage::drawPoint(), tlImage::drawRect(), tlObject::extract(), tlChain::extract(), tlImage::fillRect(), tlColorModel::filter(), tlBackground::filter(), tlCameraSVSBase::getDisparity(), tlPixelArray::getMax(), tlPixelArray::getMin(), tlCameraSVSBase::getRight(), tlSourceVideoFile::grab(), tlDigitizerVRm::grab(), tlDigitizerV4L::grab(), tlDigitizerPXC200::grab(), tlDigitizerDX::grab(), tlDigitizerDT3130::grab(), tlCameraSVSHead::grab(), tlSourceVideoFile::grabQueued(), tlDigitizerPXC200::grabQueued(), tlDigitizerDT3130::grabQueued(), tlSpiral::init(), tlMask::invert(), tlPixelArray::mask(), tlPixelArray::median(), tlMask::set(), tl_channel_put(), tl_channel_swap(), tl_convolution(), tl_convolution_x(), tl_convolution_y(), tl_copy_array(), tl_copy_hrarray(), tl_copy_hrsubarray(), tl_copy_subarray(), tl_dilate_all(), tl_dilate_bin(), tl_dilate_gray(), tl_edges_bin(), tl_erode_all(), tl_erode_bin(), tl_erode_gray(), tl_extract(), tl_extract_color_gray(), tl_extract_color_hsi(), tl_extract_color_max_gray(), tl_extract_color_max_hsi(), tl_extract_color_max_nrg(), tl_extract_color_max_rgb(), tl_extract_color_max_yuv(), tl_extract_color_min_gray(), tl_extract_color_min_hsi(), tl_extract_color_min_nrg(), tl_extract_color_min_rgb(), tl_extract_color_min_yuv(), tl_extract_color_nrg(), tl_extract_color_rgb(), tl_extract_color_yuv(), tl_extract_nr(), tl_filter_gray(), tl_filter_hrgray(), tl_filter_hsi(), tl_filter_nrg(), tl_filter_rgb(), tl_find_best_object(), tl_find_best_shape(), tl_find_object(), tl_find_shape(), tl_gray2bin(), tl_gray2rgb(), tl_hrgray2bin(), tl_hrgray2gray(), tl_hsi2bin(), tl_hsi2gray(), tl_hsi2rgb(), tl_normalize_gray(), tl_nrg2bin(), tl_nrg2gray(), tl_pixel_add(), tl_pixel_hradd(), tl_pixel_hrscale(), tl_pixel_hrsub(), tl_pixel_scale(), tl_pixel_sub(), tl_rgb2bin(), tl_rgb2gray(), tl_rgb2hsi(), tl_rgb2nrg(), tl_rgb2yuv(), tl_thin_hitandmiss(), tl_to_channel(), tl_yuv2bin(), tl_yuv2gray(), tl_yuv2nrg(), tl_yuv2rgb(), tlColor::toRgb(), and tlBackground::update().

#define TL_MAX_PIXEL_VAL   255

#define TL_MAX_PIXEL_WIDTH   4

Maximum size (in bytes) a single pixel can have in an image.

Referenced by tl_convolution(), tl_convolution_x(), tl_convolution_y(), and tl_scale_bspline().

#define TL_MIN ( a,
 )     (((a)<(b))?(a):(b))

Returns the smallest of two values.

Referenced by tlColor::add(), tlMask::adjust(), tlChain::blindExtract(), tlHist2D::build(), tlHist::build(), tlPixelArray::clear(), tlHist2D::compare(), tlHist::compare(), tlPixelArray::copy(), tlImage::crop(), tlImage::drawCross(), tlImage::drawImage(), tlImage::drawMask(), tlImage::drawObject(), tlImage::drawPoint(), tlImage::drawRect(), tlImage::drawText(), tlObject::extract(), tlChain::extract(), tlImage::fillObject(), tlImage::fillRect(), tlColorModel::filter(), tlBackground::filter(), tlCameraSVSBase::getDisparity(), tlPixelArray::getMax(), tlPixelArray::getMin(), tlCameraSVSBase::getRight(), tlSourceVideoFile::grab(), tlDigitizerVRm::grab(), tlDigitizerV4L::grab(), tlDigitizerPXC200::grab(), tlDigitizerDX::grab(), tlDigitizerDT3130::grab(), tlCameraSVSHead::grab(), tlSourceVideoFile::grabQueued(), tlDigitizerPXC200::grabQueued(), tlDigitizerDT3130::grabQueued(), tlSpiral::init(), tlMask::invert(), tlPixelArray::mask(), tlPixelArray::median(), tlMask::set(), tl_channel_put(), tl_channel_swap(), tl_convolution(), tl_convolution_x(), tl_convolution_y(), tl_copy_array(), tl_copy_hrarray(), tl_copy_hrsubarray(), tl_copy_subarray(), tl_dilate_all(), tl_dilate_bin(), tl_dilate_gray(), tl_edges_bin(), tl_erode_all(), tl_erode_bin(), tl_erode_gray(), tl_extract(), tl_extract_color_gray(), tl_extract_color_hsi(), tl_extract_color_max_gray(), tl_extract_color_max_hsi(), tl_extract_color_max_nrg(), tl_extract_color_max_rgb(), tl_extract_color_max_yuv(), tl_extract_color_min_gray(), tl_extract_color_min_hsi(), tl_extract_color_min_nrg(), tl_extract_color_min_rgb(), tl_extract_color_min_yuv(), tl_extract_color_nrg(), tl_extract_color_rgb(), tl_extract_color_yuv(), tl_extract_nr(), tl_filter_gray(), tl_filter_hrgray(), tl_filter_hsi(), tl_filter_nrg(), tl_filter_rgb(), tl_find_best_object(), tl_find_best_shape(), tl_find_object(), tl_find_shape(), tl_gray2bin(), tl_gray2rgb(), tl_hrgray2bin(), tl_hrgray2gray(), tl_hsi2bin(), tl_hsi2gray(), tl_hsi2rgb(), tl_normalize_gray(), tl_nrg2bin(), tl_nrg2gray(), tl_pixel_add(), tl_pixel_hradd(), tl_pixel_hrscale(), tl_pixel_hrsub(), tl_pixel_scale(), tl_pixel_sub(), tl_rgb2bin(), tl_rgb2gray(), tl_rgb2hsi(), tl_rgb2nrg(), tl_rgb2yuv(), tl_thin_hitandmiss(), tl_to_channel(), tl_yuv2bin(), tl_yuv2gray(), tl_yuv2nrg(), tl_yuv2rgb(), tlColor::toHsi(), tlColor::toRgb(), and tlBackground::update().

#define TL_MIN_PIXEL_VAL   0

#define TL_NOT_CONNEX   0

Indicates that no connectivity is to be used.

Referenced by tlChain::clear(), and tlChain::tlChain().

#define TL_NOT_IMPLEMENTED

Value:

{ \
  printf ("TL lib error: call to an unimplemented routine\n");  \
  return TL_ERROR_NOT_IMPLEMENTED;                              \
}
Lazy seb emergency macro.

#define TL_NRG_WIDTH   2

#define TL_PAUSE   getc();

Waits for the user to hit the ENTER key.

tl_verbose HSI-RGB conversion macro Wait for the ENTER key...

#define TL_PCT_TO_IVAL ( pct   )     (tlPixel) (TL_MAX_PIXEL_VAL*(pct)/100)

Convert intensity: [0,100] percent to [0,TL_MAX_PIXEL_VAL].
See image formats for details on the HSI format.

#define TL_PCT_TO_SVAL ( pct   )     (tlPixel) (TL_MAX_PIXEL_VAL*(pct)/100)

Convert saturation: [0,100] percent to [0,TL_MAX_PIXEL_VAL].
See image formats for details on the HSI format.

#define TL_PI   3.14159265358979323846

Default value for the PI constant (defined here for portability reasons).

Referenced by tlChain::corners(), tl_hsi2rgb(), tl_rgb2hsi(), tlColor::toHsi(), and tlColor::toRgb().

#define TL_PIXEL ( row,
col,
width   )     (((row)*(width))+(col))

Compute the address of a pixel in a given array of dimension 1.

Referenced by tlChain::blindExtract(), tlHist2D::build(), tlHist::build(), tlImage::drawCross(), tlImage::drawImage(), tlImage::drawLine(), tlImage::drawMask(), tlImage::drawObject(), tlImage::drawPoint(), tlImage::drawRect(), tlChain::extract(), tlImage::fillObject(), tlImage::fillRect(), tlPixelArray::getPixel(), tlMask::invert(), tlPixelArray::mask(), tlMask::set(), tlPixelArray::setPixel(), tl_channel_put(), tl_copy_array(), tl_copy_hrarray(), tl_copy_hrsubarray(), tl_copy_subarray(), tl_dilate_all(), tl_edges_bin(), tl_erode_all(), tl_erode_bin(), tl_erode_gray(), tl_extract_color_gray(), tl_extract_color_hsi(), tl_extract_color_max_gray(), tl_extract_color_max_hsi(), tl_extract_color_max_nrg(), tl_extract_color_max_rgb(), tl_extract_color_max_yuv(), tl_extract_color_min_gray(), tl_extract_color_min_hsi(), tl_extract_color_min_nrg(), tl_extract_color_min_rgb(), tl_extract_color_min_yuv(), tl_extract_color_nrg(), tl_extract_color_rgb(), tl_extract_color_yuv(), tl_filter_gray(), tl_filter_hrgray(), tl_filter_hsi(), tl_filter_nrg(), tl_filter_rgb(), tl_find_best_object(), tl_find_best_shape(), tl_find_object(), tl_find_shape(), tl_gray2bin(), tl_gray2rgb(), tl_hrgray2bin(), tl_hsi2bin(), tl_hsi2gray(), tl_hsi2rgb(), tl_normalize_gray(), tl_nrg2bin(), tl_nrg2gray(), tl_pixel_add(), tl_pixel_hradd(), tl_pixel_hrscale(), tl_pixel_hrsub(), tl_pixel_scale(), tl_pixel_sub(), tl_rgb2bin(), tl_rgb2gray(), tl_rgb2hsi(), tl_rgb2nrg(), and tl_to_channel().

#define TL_RGB_WIDTH   3

#define TL_STEREO_WIDTH   1

Size (in bytes) of one pixel from a STEREO image.

#define TL_SVAL_TO_PCT ( sval   )     (100.0f*(sval)/TL_MAX_PIXEL_VAL)

Convert saturation: [0,TL_MAX_PIXEL_VAL] to [0,100] percent.
See image formats for details on the HSI format.

#define TL_YUV_WIDTH   3


Typedef Documentation

histogram data type (int,unsigned).

pixel element (8 bits,unsigned).


Enumeration Type Documentation

enum tl_format

See image formats for more details on image formats implementation.

Enumerator:
RGB  common RGB format [TL_RGB_WIDTH bytes wide]
NRG  normalized RGB format (in the normalized red NR and normalized green NG plane) [TL_NRG_WIDTH bytes wide]
HSI  HSI format [TL_HSI_WIDTH bytes wide]
Hue is encoded on 2 bytes (H1 and H2) to preserve resolution. The following macros can be used to manipulate the HSI format:
TL_HMHL_TO_HVAL(hm, hl)
TL_HVAL_TO_HM(hval)
TL_HVAL_TO_HL(hval)
TL_DEG_TO_HVAL(deg)
TL_HVAL_TO_DEG(hval)
TL_PCT_TO_SVAL(pct)
TL_SVAL_TO_PCT(sval)
TL_PCT_TO_IVAL(pct)
TL_IVAL_TO_PCT(ival)
YUV  YUV format (PAL color standard) [TL_YUV_WIDTH bytes wide]
Note:
The YUV format encodes RGB data in a way that requires less bandwidth for analogous transmission. Y (luma) encapsulate the B/W information. In TLIB, intensity data (or GRAY conversion) from YUV will always be luma. It is therefore NOT the same "intensity" as computed from RGB format.
GRAY  common GRAY format [TL_GRAY_WIDTH bytes wide]
BIN  binary image format [TL_BIN_WIDTH bytes wide]
Any non-null pixel value is enabled/active, while null pixels are disabled/inactive.
STEREO  stereo (disparity map) format [TL_BIN_WIDTH bytes wide]
Negative pixel value indicate pixels whose disparity could not be computed. The tlDisplay "hides" pixels with negative value in the case of stereo images for easthetic purposes.
CUSTOM  do-it-yourself format [width unspecified].
Programmers can use the routines in tlChannel.h to build their own image format as a combination of image channels from various sources/formats.


Function Documentation

int tl_init_lib ( int  argc,
char **  argv 
)

Initialize library components.
This consists in setting the application name, as well as initializing the high-resolution timers used in TLIB.

Parameters:
argc number of arguments
argv arguments array
Returns:
0 on success, -1 otherwise.
See error management for details.
Remarks:
The arguments (argv,argc) should be the ones fed to the main() call in a C ANSI application (console mode).

References TL_NO_ERROR.

void tl_set_verbose ( int  val  ) 

Set the level of verbosity displayed in the console.

Parameters:
val 0 for no output
1 for verbosity

References tl_set_verbose(), and tlVerbose.

Referenced by tl_set_verbose().


Variable Documentation

int tlVerbose

Verbosity flag, can be set via tl_set_verbose(int verbosity).



TLIB 1.1 documentation&nbsp-  generated on 30 Apr 2008
Please address any questions to sebastien.grange@epfl.ch
(C) 2001-2008 - S. Grange VRAI, (C) 2001-2007 - LSRo, EPFL
All Rights Reserved.