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

HxNgbIsMaxGradDir2d Class Template Reference

Non maximum suppression in the direction of the gradient. More...

#include <HxNgbIsMaxGradDir2d.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

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

 ~HxNgbIsMaxGradDir2d ()
 Destructor. More...

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

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

CnumType end ()
 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...

ResultT result () const
 Produce the result value. More...


Static Public Methods

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


Detailed Description

template<class ResultT, class ArithT>
class HxNgbIsMaxGradDir2d< ResultT, ArithT >

Non maximum suppression in the direction of the gradient.

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 ResultT, class ArithT>
typedef HxTagCnum HxNgbIsMaxGradDir2d::IteratorCategory
 

Coordinate enumerated version.

template<class ResultT, class ArithT>
typedef HxTag1Phase HxNgbIsMaxGradDir2d::PhaseCategory
 

1 phase.

template<class ResultT, class ArithT>
typedef HxCnum HxNgbIsMaxGradDir2d::CnumType
 

Coordinate enumerator type.


Constructor & Destructor Documentation

template<class ResultT, class ArithT>
HxNgbIsMaxGradDir2d< ResultT, ArithT >::HxNgbIsMaxGradDir2d HxTagList   tags
 

Constructor.

00028 {
00029     _coords = &_coordPairs[0];
00030     _level = HxScalarDouble(HxGetTag<HxValue>(tags, "level", HxValue(3.0))).x();
00031     if (_level < 0)
00032         _level = 0;
00033     _level *= _level;
00034 }

template<class ResultT, class ArithT>
HxNgbIsMaxGradDir2d< ResultT, ArithT >::~HxNgbIsMaxGradDir2d  
 

Destructor.

00038 {
00039 }


Member Function Documentation

template<class ResultT, class ArithT>
HxSizes HxNgbIsMaxGradDir2d< ResultT, ArithT >::size   [inline]
 

Size of the neighbourhood.

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

template<class ResultT, class ArithT>
HxNgbIsMaxGradDir2d< ResultT, ArithT >::CnumType HxNgbIsMaxGradDir2d< ResultT, ArithT >::begin   [inline]
 

The first of the coordinates.

00075 {
00076     return CnumType(&_coords[0]);
00077 }

template<class ResultT, class ArithT>
HxNgbIsMaxGradDir2d< ResultT, ArithT >::CnumType HxNgbIsMaxGradDir2d< ResultT, ArithT >::end   [inline]
 

The last of the coordinates.

00082 {
00083     return CnumType(&_coords[_endIdx]);
00084 }

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

Initialization.

00089 {
00090     static const double tan22_5 = 0.41421356;
00091     static const double tan67_5 = 2.41421356;
00092 
00093     double x(v.x()), y(v.y());
00094     _resultMag = x*x+y*y;
00095 
00096     if (_resultMag < _level)
00097     {
00098         _endIdx = 0;
00099         return;
00100     }
00101 
00102     if (x == 0)
00103     {
00104         _endIdx = 2;
00105         _coords = &_coordPairs[4];
00106         return;
00107     }
00108 
00109     double rc = y/x;
00110     double frc = fabs(rc);
00111     int i = (frc < tan22_5) ? 0 : ( (frc < tan67_5) ? 1 : 2 );
00112     if (rc < 0)
00113         i += 3;
00114     _endIdx = 2;
00115     _coords = &_coordPairs[i<<1];
00116 }

template<class ResultT, class ArithT>
void HxNgbIsMaxGradDir2d< ResultT, 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         _resultMag = 0;
00132 }

template<class ResultT, class ArithT>
ResultT HxNgbIsMaxGradDir2d< ResultT, ArithT >::result   const [inline]
 

Produce the result value.

00144 {
00145     return _resultMag >= _level ? 1 : 0;
00146 }

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

The name : "isMaxGradDir".

00121 {
00122     static HxString s("isMaxGradDir");
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