LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::harrisCorners Class Reference

Harris Corner Detector. More...

#include <ltiHarrisCorners.h>

Inheritance diagram for lti::harrisCorners:
Inheritance graph
[legend]
Collaboration diagram for lti::harrisCorners:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class harrisCorners More...

Public Member Functions

 harrisCorners ()
 harrisCorners (const parameters &par)
 harrisCorners (const harrisCorners &other)
virtual ~harrisCorners ()
virtual const char * getTypeName () const
virtual bool updateParameters ()
virtual bool read (ioHandler &handler, const bool complete=true)
virtual bool apply (channel8 &srcdest) const
virtual bool apply (channel &srcdest) const
virtual bool apply (const channel8 &src, channel8 &dest) const
virtual bool apply (const channel &src, channel &dest) const
virtual bool apply (const channel8 &src, pointList &dest) const
virtual bool apply (const channel &src, pointList &dest) const
virtual bool apply (const channel &src, channel &cornerness, float &maxCornerness, pointList &dest) const
virtual bool apply (const channel &src, channel &cornerness, float &maxCornerness) const
harrisCornerscopy (const harrisCorners &other)
harrisCornersoperator= (const harrisCorners &other)
virtual functorclone () const
const parametersgetParameters () const

Protected Member Functions

bool getSecondOrder (channel &gx, channel &gy, channel &fxy) const
bool getCornerness (const channel &fxx, const channel &fxy, const channel &fyy, const float scale, channel &cornerness, float &maxCornerness) const
bool findCornerMaxima (const channel &cornerness, channel &cornersOnly, pointList &cornerMax) const

Protected Attributes

gradientFunctor gradient

Detailed Description

Harris Corner Detector.

The Harris corner detector is based on

C. Harris and M. Stephens, "A Combined Corner and Edge Detector", in Proc. 4th Alvey Vision Conference, pp. 147-151, 1988

It uses a matrix A that averages element-wise products of the gradients Ix and Iy over a Gaussian window W:

\[ A(x,y) = \begin{bmatrix} \sum_W I_x^2 & \sum_W I_xI_y \\ \sum_W I_xI_y & \sum_W I_y^2 \end{bmatrix} \]

The corners are defined as the local maxima of a cornerness channel. The cornerness c(x,y) of a channel f(x,y) is defined as:

\[ c(x,y)= \det(A(x,y)) - s \cdot\mathrm{tr}(A(x,y))^2 \]

Remember that the product of the eigenvalues equals the determinant of the matrix and the sum of eigenvalues equals its trace.

Slight modifications are used in order to increase the quality of the detection.

The default paramters use the Harris Kernel (see harrisKernelX) as gradient. However, you can choose freely from all available gradient kernels. Most notably, by using gradientFunctor::parameters::OGD, the harrisCorners functor should behave similarly to the improved Harris introduced by Schmid et al.


Constructor & Destructor Documentation

lti::harrisCorners::harrisCorners (  ) 

default constructor

lti::harrisCorners::harrisCorners ( const parameters par  ) 

Construct a functor using the given parameters.

lti::harrisCorners::harrisCorners ( const harrisCorners other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::harrisCorners::~harrisCorners (  )  [virtual]

destructor


Member Function Documentation

virtual bool lti::harrisCorners::apply ( const channel src,
channel cornerness,
float &  maxCornerness 
) const [virtual]

Extract the cornerness channel belonging to src.

Note that this is in principle a partial result. It would require further processing to get the corners, but some other functors could make use of this.

Parameters:
src channel with the source data.
cornerness channel containing the cornerness of the source data.
maxCornerness maximum value found in cornerness.
Returns:
true if apply successful or false otherwise.
virtual bool lti::harrisCorners::apply ( const channel src,
channel cornerness,
float &  maxCornerness,
pointList dest 
) const [virtual]

Extract the cornerness channel belonging to src.

Note that the cornerness is in principle a partial result.

Parameters:
src channel with the source data.
cornerness channel containing the cornerness of the source data.
maxCornerness maximum value found in cornerness.
dest list containing the position of all detected corners.
Returns:
true if apply successful or false otherwise.
virtual bool lti::harrisCorners::apply ( const channel src,
pointList dest 
) const [virtual]

Extract the corners in src and leave them in dest.

Parameters:
src channel with the source data.
dest list of corners
Returns:
true if apply successful or false otherwise.

Implements lti::cornerDetector.

virtual bool lti::harrisCorners::apply ( const channel8 src,
pointList dest 
) const [virtual]

Extract the corners in src and leave them in dest.

Parameters:
src channel8 with the source data.
dest list of corners
Returns:
true if apply successful or false otherwise.

Implements lti::cornerDetector.

virtual bool lti::harrisCorners::apply ( const channel src,
channel dest 
) const [virtual]

Extract the corners in src and leave the result in dest.

The result is a mask containing only the corners. The background will be marked using parameters::noCornerValue/255 and the corners will have the value parameters::cornerValue/255 (these are inherited from the parent class).

Parameters:
src channel with the source data.
dest channel where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::cornerDetector.

virtual bool lti::harrisCorners::apply ( const channel8 src,
channel8 dest 
) const [virtual]

Extract the corners in src and leave the result in dest.

The result is a mask containing only the corners. The background will be marked using parameters::noCornerValue and the corners will have the value parameters::cornerValue (these are inherited from the parent class).

Parameters:
src channel8 with the source data.
dest channel8 where the result will be left.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::cornerDetector.

virtual bool lti::harrisCorners::apply ( channel srcdest  )  const [virtual]

Extract the corners in srcdest and leave the result there too.

The result is a mask containing only the corners. The background will be marked using parameters::noCornerValue/255 and the corners will have the value parameters::cornerValue/255 (these are inherited from the parent class).

Parameters:
srcdest channel with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::cornerDetector.

virtual bool lti::harrisCorners::apply ( channel8 srcdest  )  const [virtual]

Extract the corners in srcdest and leave the result there too.

The result is a mask containing only the corners. The background will be marked using parameters::noCornerValue and the corners will have the value parameters::cornerValue (these are inherited from the parent class).

Parameters:
srcdest channel8 with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Reimplemented from lti::cornerDetector.

virtual functor* lti::harrisCorners::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::cornerDetector.

harrisCorners& lti::harrisCorners::copy ( const harrisCorners other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::cornerDetector.

bool lti::harrisCorners::findCornerMaxima ( const channel cornerness,
channel cornersOnly,
pointList cornerMax 
) const [protected]

find corners with maximal cornerness

bool lti::harrisCorners::getCornerness ( const channel fxx,
const channel fxy,
const channel fyy,
const float  scale,
channel cornerness,
float &  maxCornerness 
) const [protected]

compute cornerness

const parameters& lti::harrisCorners::getParameters (  )  const

returns used parameters

Reimplemented from lti::cornerDetector.

bool lti::harrisCorners::getSecondOrder ( channel gx,
channel gy,
channel fxy 
) const [protected]

compute the second order.

Parameters:
gx contains the gradient in x direction as input and the second derivative fxx as output.
gy contains the gradient in y direction as input and the second derivative fyy as output.
fxy contains the mixed second derivative as output.
virtual const char* lti::harrisCorners::getTypeName (  )  const [virtual]

returns the name of this type ("harrisCorners")

Reimplemented from lti::cornerDetector.

harrisCorners& lti::harrisCorners::operator= ( const harrisCorners other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::cornerDetector.

virtual bool lti::harrisCorners::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

Read the functor from the given ioHandler.

Also sets the gradientFunctor parameters.

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::functor.

virtual bool lti::harrisCorners::updateParameters (  )  [virtual]

set functor's parameters.

The gradientFunctorParameters are checked for compliancy with the definitions above. See parameters::gradientFunctorParameters.

This member makes a copy of theParam: the functor will keep its own copy of the parameters!

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.


Member Data Documentation

gradientFunctor used to calculate x and y gradients.


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

Generated on Sat Apr 10 15:27:24 2010 for LTI-Lib by Doxygen 1.6.1