TLIB documentation
 

tlHough Class Reference

Collaboration diagram for tlHough:

Collaboration graph
[legend]

List of all members.


Detailed Description

This class implements a Hough transform of a tlImage in order to identify straight line segments. The number of lines to extract and the angular resolution of the line construction can be adjusted to suit the application and/or to optimize performance.

Public Member Functions

 tlHough (int sWidth, int sHeight, float angIncr=0.0f)
virtual ~tlHough ()
int setParam (int sWidth, int sHeight, float angIncr=0.0f)
int setAngularIncrement (float angIncr)
int extract (tlImage *image, int lineCount=1)
int getLineCount ()
tlLinegetLine (int index)
tlLinegetLinePtr (int index)
int getLineCopy (tlLine *line, int index)
int getHoughImage (tlImage *image)

Constructor & Destructor Documentation

tlHough::tlHough ( int  sWidth,
int  sHeight,
float  angIncr = 0.0f 
)

Constructor.

Parameters:
sWidth input image width.
sHeight input image height.
angIncr the angular resolution in [deg]. The default is optimized with respect to the image input size.
Returns:
See error management for details.

tlHough::~tlHough (  )  [virtual]

Destructor.

Returns:
See error management for details.


Member Function Documentation

int tlHough::setParam ( int  sWidth,
int  sHeight,
float  angIncr = 0.0f 
)

Initialize the Hough accumulators for a given input image size.

Parameters:
sWidth input image width.
sHeight input image height.
angIncr the angular resolution in [deg]. The default is optimized with respect to the image input size.
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlHough::setAngularIncrement ( float  angIncr  ) 

Configure the angular resolution of the Hough line representation.

Parameters:
angIncr the angular resolution in [deg].
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlHough::extract ( tlImage image,
int  lineCount = 1 
)

Extract a given number of lines from a single-channel image. The lines are sorted by weight (i.e. the first one in the list has the more pixels contributing to it).

Parameters:
image single-channel image to process.
lineCount number of lines to extract.
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlHough::getLineCount (  ) 

Return the actual number of lines detected.

Returns:
The number of lines.
See error management for details.

tlLine * tlHough::getLine ( int  index  ) 

Return a pointer to a copy of the detected line at a given index.

Parameters:
index the ranking of the line to return.
Returns:
a pointer to a tlLine object on success, NULL otherwise.
See error management for details.
Note:
It is the responsibility of the programmer to delete the returned tlLine object.

tlLine * tlHough::getLinePtr ( int  index  ) 

Return a pointer to the detected line at a given index.

Parameters:
index the ranking of the line to retrieve.
Returns:
a pointer to a tlLine object on success, NULL otherwise.
See error management for details.
Note:
The pointer is managed by the tlHough object, and the memory block it references will be freed by the tlHough object eventually. Use at your own risk !

int tlHough::getLineCopy ( tlLine line,
int  index 
)

Return a copy of the detected line at a given index.

Parameters:
line a pointer to the destination line object.
index the ranking of the line to return.
Returns:
0 on success, -1 otherwise.
See error management for details.

int tlHough::getHoughImage ( tlImage image  ) 

Fill-in a tlImage object with the Hough accumulator. The resuling tlImage is fit for display with tlDisplay.

Parameters:
image image object to fill-in.
Returns:
0 on success, -1 otherwise.
See error management for details.


The documentation for this class was generated from the following files:

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.