Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxNgbNonMaxSuppression2d Class Template Reference

Neighbourhood functor for non maximum suppression in the gradient direction. More...

#include <HxNgbNonMaxSuppression2d.h>

List of all members.

Public Types

typedef HxTagCnum IteratorCategory
 Coordinate enumerated version. More...

typedef HxTag1Phase PhaseCategory
 1 phase. More...

typedef HxCnum CnumType
 Coordinate enumerator type. More...


Public Methods

 HxNgbNonMaxSuppression2d (HxTagList &tags)
 Constructor. More...

 ~HxNgbNonMaxSuppression2d ()
 Destructor. More...

HxSizes size ()
 Size of the neighbourhood. More...

CnumType begin ()
 The first of the coordinates. More...

CnumTypeend ()
 The last of the coordinates. More...

void init (int x, int y, const ArithT &value)
 Initialization. More...

void next (int x, int y, const ArithT &value)
 Processing one pixel. More...

const ArithT & result () const
 Produce the result value. More...


Static Public Methods

HxString className ()
 The name : "nonMaxSuppression". More...


Detailed Description

template<class ArithT>
class HxNgbNonMaxSuppression2d< ArithT >

Neighbourhood functor for non maximum suppression in the gradient direction.

If the current pixel is smaller than the two pixels in the gradient and opposite direction it is set to 0. ArithT is required to be a 2 dimensional vector.


Member Typedef Documentation

template<class ArithT>
typedef HxTagCnum HxNgbNonMaxSuppression2d::IteratorCategory
 

Coordinate enumerated version.

template<class ArithT>
typedef HxTag1Phase HxNgbNonMaxSuppression2d::PhaseCategory
 

1 phase.

template<class ArithT>
typedef HxCnum HxNgbNonMaxSuppression2d::CnumType
 

Coordinate enumerator type.


Constructor & Destructor Documentation

template<class ArithT>
HxNgbNonMaxSuppression2d< ArithT >::HxNgbNonMaxSuppression2d HxTagList   tags
 

Constructor.

00028     : _nullPix(HxScalarInt(0))
00029 {
00030     _coords = &_coordPairs[0];
00031 }

template<class ArithT>
HxNgbNonMaxSuppression2d< ArithT >::~HxNgbNonMaxSuppression2d  
 

Destructor.

00035 {
00036 }


Member Function Documentation

template<class ArithT>
HxSizes HxNgbNonMaxSuppression2d< ArithT >::size   [inline]
 

Size of the neighbourhood.

00137 {
00138     return HxSizes(3, 3, 1);
00139 }

template<class ArithT>
TYPENAME HxNgbNonMaxSuppression2d< ArithT >::CnumType HxNgbNonMaxSuppression2d< ArithT >::begin   [inline]
 

The first of the coordinates.

00079 {
00080     return CnumType(&_coords[0]);
00081 }

template<class ArithT>
TYPENAME HxNgbNonMaxSuppression2d< ArithT >::CnumType & HxNgbNonMaxSuppression2d< ArithT >::end   [inline]
 

The last of the coordinates.

00086 {
00087     return _end;
00088 }

template<class ArithT>
void HxNgbNonMaxSuppression2d< ArithT >::init int    x,
int    y,
const ArithT &    v
[inline]
 

Initialization.

00095 {
00096     HxBreakPoint();
00097     static const double tan22_5 = 0.41421356;
00098     static const double tan67_5 = 2.41421356;
00099 
00100     double x(v.x()), y(v.y());
00101     _resultPix = v;
00102     _resultMag = x*x+y*y;
00103     _suppressed = false;
00104 
00105     if (x != 0) {
00106         double rc = y/x;
00107         double frc = fabs(rc);
00108         int i = (frc < tan22_5) ? 0 : ( (frc < tan67_5) ? 1 : 2 );
00109         if (rc < 0)
00110             i += 3;
00111         _coords = &_coordPairs[i<<1];
00112     } else {
00113         _coords = &_coordPairs[4];
00114     }
00115     _end = &_coords[2];
00116 }

template<class ArithT>
void HxNgbNonMaxSuppression2d< ArithT >::next int    x,
int    y,
const ArithT &    v
[inline]
 

Processing one pixel.

00129 {
00130     if ((v.x()*v.x() + v.y()*v.y()) > _resultMag)
00131         _suppressed = true;
00132 }

template<class ArithT>
const ArithT & HxNgbNonMaxSuppression2d< ArithT >::result   const [inline]
 

Produce the result value.

00144 {
00145     return _suppressed ? _nullPix : _resultPix;
00146 }

template<class ArithT>
HxString HxNgbNonMaxSuppression2d< ArithT >::className   [inline, static]
 

The name : "nonMaxSuppression".

00121 {
00122     static HxString s("nonMaxSuppression");
00123     return s;
00124 }


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:49:08 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001