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

lti::cannyEdges Class Reference

The Canny Edge Detector is a standard algorithm, designed to detect "optimal" edges. More...

#include <ltiCannyEdges.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class cannyEdges More...

Public Member Functions

 cannyEdges ()
 cannyEdges (const parameters &thePars)
 cannyEdges (const cannyEdges &other)
virtual ~cannyEdges ()
virtual const char * getTypeName () const
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 channel8 &src, channel8 &edges, channel &orientation) const
virtual bool apply (const channel &src, channel &dest) const
virtual bool apply (const channel &src, channel8 &dest) const
virtual bool apply (const channel &src, channel8 &edges, channel &orientation) const
virtual bool apply (const image &src, channel8 &dest) const
virtual bool apply (const image &src, channel8 &dest, channel &orientation) const
virtual bool apply (image &srcdest) const
virtual bool apply (const image &src, image &dest) const
virtual bool apply (const channel &c1, const channel &c2, const channel &c3, channel8 &edges, channel &orientation) const
cannyEdgescopy (const cannyEdges &other)
cannyEdgesoperator= (const cannyEdges &other)
virtual functorclone () const
virtual bool updateParameters ()
const parametersgetParameters () const

Detailed Description

The Canny Edge Detector is a standard algorithm, designed to detect "optimal" edges.

Almost every image processing book (e.g. Sonka et.al Image Processing, Analysis and Machine Vision) explains the details for the algorithm.

As all other edge detectors in this Library, the colors for the edges and background are specified in the parameters (see lti::edgeDetector::parameters)

The construction of the first cannyEdges functor in your application will take some time to initialize a Look-Up-Table that allows a much faster edge detection later (about 0.13 seconds on a Pentium III, 450MHz). The LUT will require about 1MB. Please see lti::arctanLUT for more information.

You can also choose between the "classic" simple gradient operator, which considers only two neighbors at each axis x and y or the more accurate gradient kernels (see lti::gradientKernelX). In the latter mode, the edge detection is about a factor 2 slower.

For color images the color contrast gradient is used.

See also:
lti::nonMaximumSuppression
lti::colorContrastGradient
lti::edgeDetector

Constructor & Destructor Documentation

lti::cannyEdges::cannyEdges (  ) 

default constructor

lti::cannyEdges::cannyEdges ( const parameters thePars  ) 

constructor with parameters

lti::cannyEdges::cannyEdges ( const cannyEdges other  ) 

copy constructor

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

destructor


Member Function Documentation

virtual bool lti::cannyEdges::apply ( const channel c1,
const channel c2,
const channel c3,
channel8 edges,
channel orientation 
) const [virtual]

Strictly speaking, this method does not do a Canny Edge Detection any more, but, because of the strong similarity with the Canny later stages, it is provided here.

The problem lies in the definition of the "gradient" for a color channel. Here, the approach introduced in A. Cumani, "Edge Detection in Multispectral Images", Technical Report, Istituto Elettrotecnico Nazionale "Galileo Ferraris", 1989 is followed.

With this approach, instead of the usual gradient, the maxima of the contrast function are searched. The contrast function defines the direction in the (x,y) plane at which the contrast change is maximal. See lti::colorContrastGradient for more information.

The Canny-typical non-maxima suppression procedure is applied on the contrast result.

Parameters:
c1 first channel
c2 second channel
c3 third channel
edges the found edges
orientation orientation of the found angles.
Returns:
true if apply successful or false otherwise.
virtual bool lti::cannyEdges::apply ( const image src,
image dest 
) const [virtual]

Compute the edges for the red, green and blue components of the image and leave the result in each channel of the destination image.

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

Reimplemented from lti::edgeDetector.

virtual bool lti::cannyEdges::apply ( image srcdest  )  const [virtual]

Compute the edges for the red, green and blue components of the image and leave the result in each channel of image.

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

Reimplemented from lti::edgeDetector.

virtual bool lti::cannyEdges::apply ( const image src,
channel8 dest,
channel orientation 
) const [virtual]

operates on a copy of the given parameters.

Parameters:
src image with the source data.
dest channel where the result will be left.
orientation channel where the orientation for the channel will be left.
Returns:
true if apply successful or false otherwise.
virtual bool lti::cannyEdges::apply ( const image src,
channel8 dest 
) const [virtual]

Strictly speaking, this method does not do a Canny Edge Detection any more, but, because of the strong similarity with the Canny later stages, it is provided here.

The problem lies in the definition of the "gradient" for a color channel. Here, the approach introduced in A. Cumani, "Edge Detection in Multispectral Images", Technical Report, Istituto Elettrotecnico Nazionale "Galileo Ferraris", 1989 is followed.

With this approach, instead of the usual gradient, the maxima of the contrast function are searched. The contrast function defines the direction in the (x,y) plane at which the contrast change is maximal. See lti::colorContrastGradient for more information.

The Canny-typical non-maxima suppression procedure is applied on the contrast result.

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

Reimplemented from lti::edgeDetector.

virtual bool lti::cannyEdges::apply ( const channel src,
channel8 edges,
channel orientation 
) const [virtual]

compute the canny edges for the given source channel.

The found edges will be left on the edges channel, and the orientation angle of the edges (that can be used in other functors, like the hough transform) is left on the orientation channel.

Parameters:
src channel with the source data.
edges channel8 where the result will be left.
orientation channel where the orientation for the channel will be left.
Returns:
true if apply successful or false otherwise.
virtual bool lti::cannyEdges::apply ( const channel src,
channel8 dest 
) const [virtual]

operates on a copy of the given parameters.

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::edgeDetector.

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

operates on a copy of the given parameters.

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::edgeDetector.

virtual bool lti::cannyEdges::apply ( const channel8 src,
channel8 edges,
channel orientation 
) const [virtual]

compute the canny edges for the given source channel.

The found edges will be left on the edges channel, and the orientation angle of the edges (that can be used in other functors, like the hough transform) is left on the orientation channel.

Parameters:
src channel8 with the source data.
edges channel8 where the result will be left.
orientation channel where the orientation for the channel will be left.
Returns:
true if apply successful or false otherwise.
virtual bool lti::cannyEdges::apply ( const channel8 src,
channel8 dest 
) const [virtual]

operates on a copy of the given parameters.

This one is the fastest, because it won't require casting the channel to any other type.

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::edgeDetector.

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

operates on the given parameter.

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::edgeDetector.

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

operates on the given parameter.

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::edgeDetector.

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

returns a pointer to a clone of this functor.

Implements lti::edgeDetector.

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

copy data of "other" functor.

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

Reimplemented from lti::edgeDetector.

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

returns used parameters

Reimplemented from lti::edgeDetector.

virtual const char* lti::cannyEdges::getTypeName (  )  const [virtual]

returns the name of this type ("cannyEdges")

Reimplemented from lti::edgeDetector.

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

alias for copy member

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

Reimplemented from lti::edgeDetector.

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

set functor's parameters.

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.


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

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