MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
mds::img::CCanny< I > Class Template Reference

Canny edge detector. More...

#include <mdsCanny.h>

Inheritance diagram for mds::img::CCanny< I >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { TEMPLATE_PARAMETER_IS_NOT_IMAGE = I::CLASS_IMAGE }
 Check that I is an image. More...
typedef CImageEdgeDetector< I > base
 Image edge detector base.
typedef base::tImage tImage
 Image type.
typedef base::tPixel tPixel
 Image pixel type.

Public Member Functions

 CCanny (double dSigma, double dT1, double dT2)
 Default constructor.
double getSigma () const
 Returns smoothing filter standard deviation.
void getThresholds (double &dT1, double &dT2)
 Returns thresholds of the non-maximal suppression algorithm.
bool operator() (const tImage &SrcImage, tImage &DstImage)
 Edge detection in a given image.
void setSigma (double dSigma)
 Sets the smoothing filter standard deviation.
void setThresholds (double dT1, double dT2)
 Sets thresholds of the non-maximal suppression algorithm.
 ~CCanny ()
 Destructor.

Protected Member Functions

bool checkNeighbours (tImage &Image, tSize x, tSize y, tPixel T)
 Returns true if any neighbouring pixel has greater value than a given threshold.
void hysteresis (tImage &MagnitudeImage, tImage &Image, tPixel T1, tPixel T2)
 Hystersis controlled by two given thresholds.
void nonMaxSuppression (const tImage &GradImageX, const tImage &GradImageY, tImage &MagnitudeImage, tImage &Image)
 Non-maximal suppression.

Protected Attributes

double m_dT1
 Thresholds used by hysteresis algorithm.
double m_dT2
CGaussFilter< tImagem_GaussFilter
 Gaussian smoothing filter.
CSobelX< tImage, CShiftZero2Graym_SobelX
 Sobel operators.
CSobelY< tImage, CShiftZero2Graym_SobelY

Detailed Description

template<class I>
class mds::img::CCanny< I >

Canny edge detector.


Member Typedef Documentation

template<class I >
typedef CImageEdgeDetector<I> mds::img::CCanny< I >::base

Image edge detector base.

template<class I >
typedef base::tImage mds::img::CCanny< I >::tImage

Image type.

Reimplemented from mds::img::CImageEdgeDetector< I >.

template<class I >
typedef base::tPixel mds::img::CCanny< I >::tPixel

Image pixel type.

Reimplemented from mds::img::CImageEdgeDetector< I >.


Member Enumeration Documentation

template<class I >
anonymous enum [inherited]

Check that I is an image.

You will see name of this enum somewhere in compiler error message if the type I is not image.

Enumerator:
TEMPLATE_PARAMETER_IS_NOT_IMAGE 

Constructor & Destructor Documentation

template<class I >
mds::img::CCanny< I >::CCanny ( double  dSigma,
double  dT1,
double  dT2 
)

Default constructor.

  • Standard deviation ("sigma" parameter) of the Gaussian filter which is used for the smoothing.
  • Thresholds for the hysteresis (0..1).
template<class I >
mds::img::CCanny< I >::~CCanny ( )

Destructor.


Member Function Documentation

template<class I >
bool CCanny::checkNeighbours ( tImage Image,
tSize  x,
tSize  y,
tPixel  T 
) [protected]

Returns true if any neighbouring pixel has greater value than a given threshold.

template<class I >
double mds::img::CCanny< I >::getSigma ( ) const

Returns smoothing filter standard deviation.

template<class I >
void CCanny::getThresholds ( double &  dT1,
double &  dT2 
)

Returns thresholds of the non-maximal suppression algorithm.

template<class I >
void CCanny::hysteresis ( tImage MagnitudeImage,
tImage Image,
tPixel  T1,
tPixel  T2 
) [protected]

Hystersis controlled by two given thresholds.

  • Applies the hysteresis to the provided slice. It checks each pixel against an upper threshhold 'T1'. If the pixel value is equal or higher, the current pixel is an edge pixel. Then all direct neighbours of the pixel are compared to a lower threshhold 'T2' and if their values are equal or higher than this threshhold, they become edge pixels as well.
  • In practice the threshold T1 = (2-3) * T2.
template<class I >
void CCanny::nonMaxSuppression ( const tImage GradImageX,
const tImage GradImageY,
tImage MagnitudeImage,
tImage Image 
) [protected]

Non-maximal suppression.

template<class I >
bool CCanny::operator() ( const tImage SrcImage,
tImage DstImage 
) [virtual]

Edge detection in a given image.

  • Magnitude image is produced.
  • Returns false on failure.

Implements mds::img::CImageEdgeDetector< I >.

template<class I >
void mds::img::CCanny< I >::setSigma ( double  dSigma)

Sets the smoothing filter standard deviation.

template<class I >
void CCanny::setThresholds ( double  dT1,
double  dT2 
)

Sets thresholds of the non-maximal suppression algorithm.


Member Data Documentation

template<class I >
double mds::img::CCanny< I >::m_dT1 [protected]

Thresholds used by hysteresis algorithm.

template<class I >
double mds::img::CCanny< I >::m_dT2 [protected]
template<class I >
CGaussFilter<tImage> mds::img::CCanny< I >::m_GaussFilter [protected]

Gaussian smoothing filter.

template<class I >
CSobelX<tImage, CShiftZero2Gray> mds::img::CCanny< I >::m_SobelX [protected]

Sobel operators.

template<class I >
CSobelY<tImage, CShiftZero2Gray> mds::img::CCanny< I >::m_SobelY [protected]

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