mimas::find_line< ImageIteratorSource > Class Template Reference

Line finding using the Hough transform. More...

#include <hough_transform2.h>

Collaboration diagram for mimas::find_line< ImageIteratorSource >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

segment< pointpolar_to_castesian (double theta, double r)
 find_line (ImageIteratorSource ul, ImageIteratorSource lr, double thresh_factor=.7, int orientationDivision=180)
image< unsigned char > exec (void)
std::vector< segment< point > > getLines (void)

Public Attributes

std::vector< segment< point > > lines

Protected Member Functions

void hough (void)
void findMax (void)
void findLine (void)
image< unsigned char > displayLine (void)

Protected Attributes

int nbOrientationDiv
double thresh
double maxVal
ImageIteratorSource ul
ImageIteratorSource lr
int w
int h
int imageDiagonalSize
int center_x
int center_y
Array2D parameterSpace

Detailed Description

template<typename ImageIteratorSource>
class mimas::find_line< ImageIteratorSource >

Line finding using the Hough transform.

Works on sub-images thanks to image iterators

Take as input an image< of not a composed type> (i.e. not rgba< unsigned char >) Pixels which value is different from 0 are considered as being candidate for belonging to a line.

after h.exec() has been executed results are stored in std::vector< segment< point > > lines

This was originally implemented as a short exercice for myself to understand the Hough transform. As such the value of the code is quite poor however it might allow other people to understand the Hough transform with a simple implementation as well as providing them with a starting point for further experimentations.

It is thus possible to continue improving this class adding other high-level as well as low level functionalities. A bit more of work is still needed to put it in the include of mimas. Need to be tested for color images ...

Check what can be borrowed from hough_transform one of the first improvement is to locate localy a maximum when adjacent bins have number of hits above the threshold

Have a look to the gandalf implementation of the fast Hough transform

at the moment a sample code using this class would look like:

find_line< image< int >::ImageIterator > h(image.ul(), image.lr() , .7, 145); display << h.exec();

Author:
: Manuel Boissenin
Date:
: 28 november 2004

Definition at line 67 of file hough_transform2.h.


Constructor & Destructor Documentation

template<typename ImageIteratorSource>
mimas::find_line< ImageIteratorSource >::find_line ( ImageIteratorSource  ul,
ImageIteratorSource  lr,
double  thresh_factor = .7,
int  orientationDivision = 180 
) [inline]

Definition at line 168 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::center_x, mimas::find_line< ImageIteratorSource >::center_y, mimas::find_line< ImageIteratorSource >::h, mimas::find_line< ImageIteratorSource >::thresh, and mimas::find_line< ImageIteratorSource >::w.


Member Function Documentation

template<typename ImageIteratorSource>
void mimas::find_line< ImageIteratorSource >::hough ( void   )  [inline, protected]

Definition at line 87 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::center_x, mimas::find_line< ImageIteratorSource >::center_y, mimas::find_line< ImageIteratorSource >::h, mimas::find_line< ImageIteratorSource >::imageDiagonalSize, mimas::find_line< ImageIteratorSource >::nbOrientationDiv, mimas::find_line< ImageIteratorSource >::parameterSpace, mimas::find_line< ImageIteratorSource >::ul, and mimas::find_line< ImageIteratorSource >::w.

Referenced by mimas::find_line< ImageIteratorSource >::exec(), and mimas::find_line< ImageIteratorSource >::getLines().

template<typename ImageIteratorSource>
void mimas::find_line< ImageIteratorSource >::findMax ( void   )  [inline, protected]

Definition at line 111 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::maxVal, and mimas::find_line< ImageIteratorSource >::parameterSpace.

Referenced by mimas::find_line< ImageIteratorSource >::exec(), and mimas::find_line< ImageIteratorSource >::getLines().

template<typename ImageIteratorSource>
void mimas::find_line< ImageIteratorSource >::findLine ( void   )  [inline, protected]

Definition at line 119 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::imageDiagonalSize, mimas::find_line< ImageIteratorSource >::lines, mimas::find_line< ImageIteratorSource >::maxVal, mimas::find_line< ImageIteratorSource >::nbOrientationDiv, mimas::find_line< ImageIteratorSource >::parameterSpace, mimas::find_line< ImageIteratorSource >::polar_to_castesian(), and mimas::find_line< ImageIteratorSource >::thresh.

Referenced by mimas::find_line< ImageIteratorSource >::exec(), and mimas::find_line< ImageIteratorSource >::getLines().

Here is the call graph for this function:

template<typename ImageIteratorSource>
image<unsigned char> mimas::find_line< ImageIteratorSource >::displayLine ( void   )  [inline, protected]

Definition at line 128 of file hough_transform2.h.

References mimas::drawLine(), mimas::find_line< ImageIteratorSource >::h, mimas::image< T >::init(), mimas::find_line< ImageIteratorSource >::lines, and mimas::find_line< ImageIteratorSource >::w.

Referenced by mimas::find_line< ImageIteratorSource >::exec().

Here is the call graph for this function:

template<typename ImageIteratorSource>
segment< point > mimas::find_line< ImageIteratorSource >::polar_to_castesian ( double  theta,
double  r 
) [inline]

Definition at line 143 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::center_x, mimas::find_line< ImageIteratorSource >::center_y, and mimas::find_line< ImageIteratorSource >::nbOrientationDiv.

Referenced by mimas::find_line< ImageIteratorSource >::findLine().

template<typename ImageIteratorSource>
image< unsigned char > mimas::find_line< ImageIteratorSource >::exec ( void   )  [inline]

Definition at line 183 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::displayLine(), mimas::find_line< ImageIteratorSource >::findLine(), mimas::find_line< ImageIteratorSource >::findMax(), and mimas::find_line< ImageIteratorSource >::hough().

Here is the call graph for this function:

template<typename ImageIteratorSource>
std::vector< segment< point > > mimas::find_line< ImageIteratorSource >::getLines ( void   )  [inline]

Definition at line 190 of file hough_transform2.h.

References mimas::find_line< ImageIteratorSource >::findLine(), mimas::find_line< ImageIteratorSource >::findMax(), mimas::find_line< ImageIteratorSource >::hough(), and mimas::find_line< ImageIteratorSource >::lines.

Here is the call graph for this function:


Member Data Documentation

template<typename ImageIteratorSource>
int mimas::find_line< ImageIteratorSource >::nbOrientationDiv [protected]

Definition at line 70 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::findLine(), mimas::find_line< ImageIteratorSource >::hough(), and mimas::find_line< ImageIteratorSource >::polar_to_castesian().

template<typename ImageIteratorSource>
double mimas::find_line< ImageIteratorSource >::thresh [protected]

Definition at line 71 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::find_line(), and mimas::find_line< ImageIteratorSource >::findLine().

template<typename ImageIteratorSource>
double mimas::find_line< ImageIteratorSource >::maxVal [protected]

Definition at line 73 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::findLine(), and mimas::find_line< ImageIteratorSource >::findMax().

template<typename ImageIteratorSource>
ImageIteratorSource mimas::find_line< ImageIteratorSource >::ul [protected]

Definition at line 75 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::hough().

template<typename ImageIteratorSource>
ImageIteratorSource mimas::find_line< ImageIteratorSource >::lr [protected]

Definition at line 76 of file hough_transform2.h.

template<typename ImageIteratorSource>
int mimas::find_line< ImageIteratorSource >::w [protected]

Definition at line 78 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::displayLine(), mimas::find_line< ImageIteratorSource >::find_line(), and mimas::find_line< ImageIteratorSource >::hough().

template<typename ImageIteratorSource>
int mimas::find_line< ImageIteratorSource >::h [protected]

Definition at line 78 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::displayLine(), mimas::find_line< ImageIteratorSource >::find_line(), and mimas::find_line< ImageIteratorSource >::hough().

template<typename ImageIteratorSource>
int mimas::find_line< ImageIteratorSource >::imageDiagonalSize [protected]

Definition at line 79 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::findLine(), and mimas::find_line< ImageIteratorSource >::hough().

template<typename ImageIteratorSource>
int mimas::find_line< ImageIteratorSource >::center_x [protected]

Definition at line 80 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::find_line(), mimas::find_line< ImageIteratorSource >::hough(), and mimas::find_line< ImageIteratorSource >::polar_to_castesian().

template<typename ImageIteratorSource>
int mimas::find_line< ImageIteratorSource >::center_y [protected]

Definition at line 80 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::find_line(), mimas::find_line< ImageIteratorSource >::hough(), and mimas::find_line< ImageIteratorSource >::polar_to_castesian().

template<typename ImageIteratorSource>
Array2D mimas::find_line< ImageIteratorSource >::parameterSpace [protected]

Definition at line 82 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::findLine(), mimas::find_line< ImageIteratorSource >::findMax(), and mimas::find_line< ImageIteratorSource >::hough().

template<typename ImageIteratorSource>
std::vector< segment< point > > mimas::find_line< ImageIteratorSource >::lines

Definition at line 139 of file hough_transform2.h.

Referenced by mimas::find_line< ImageIteratorSource >::displayLine(), mimas::find_line< ImageIteratorSource >::findLine(), and mimas::find_line< ImageIteratorSource >::getLines().


The documentation for this class was generated from the following file:
[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:29 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...