latest version v1.9 - last update 10 Apr 2010 |
Harris Corner Detector. More...
#include <ltiHarrisCorners.h>
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 |
harrisCorners & | copy (const harrisCorners &other) |
harrisCorners & | operator= (const harrisCorners &other) |
virtual functor * | clone () const |
const parameters & | getParameters () 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 |
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:
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:
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.
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
other | the object to be copied |
virtual lti::harrisCorners::~harrisCorners | ( | ) | [virtual] |
destructor
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.
src | channel with the source data. | |
cornerness | channel containing the cornerness of the source data. | |
maxCornerness | maximum value found in cornerness. |
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.
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. |
Extract the corners in src and leave them in dest.
src | channel with the source data. | |
dest | list of corners |
Implements lti::cornerDetector.
Extract the corners in src and leave them in dest.
src | channel8 with the source data. | |
dest | list of corners |
Implements lti::cornerDetector.
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).
Reimplemented from lti::cornerDetector.
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).
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).
srcdest | channel with the source data. The result will be left here too. |
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).
srcdest | channel8 with the source data. The result will be left here too. |
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.
other | the functor to be copied |
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.
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
other | the functor to be copied |
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.
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. |
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!
Reimplemented from lti::functor.
gradientFunctor lti::harrisCorners::gradient [protected] |
gradientFunctor used to calculate x and y gradients.