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.

#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.

#define TL_DEFAULT_COLS   320

The default image width used in TLIB.

#define TL_DEFAULT_ROWS   240

The default image height used in TLIB.

#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

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

#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

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

#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.

#define TL_MAX_PIXEL_VAL   255

The highest value a pixel of type tlPixel can have.

#define TL_MAX_PIXEL_WIDTH   4

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

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

Returns the smallest of two values.

#define TL_MIN_PIXEL_VAL   0

The smallest value a pixel of type tlPixel can have.

#define TL_NOT_CONNEX   0

Indicates that no connectivity is to be used.

#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

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

#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).

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

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

#define TL_RGB_WIDTH   3

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

#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

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


Typedef Documentation

tlHistData

histogram data type (int,unsigned).

tlPixel

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).

void tl_set_verbose ( int  val  ) 

Set the level of verbosity displayed in the console.

Parameters:
val 0 for no output
1 for verbosity


Variable Documentation

int tlVerbose

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



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