#include <HxNgbNonMaxSuppression2d.h>
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... | |
| 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... | |
| const ArithT & | result () const |
| Produce the result value. More... | |
Static Public Methods | |
| HxString | className () |
| The name : "nonMaxSuppression". More... | |
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.
|
|||||
|
Coordinate enumerated version.
|
|
|||||
|
1 phase.
|
|
|||||
|
Coordinate enumerator type.
|
|
||||||||||
|
Constructor.
00028 : _nullPix(HxScalarInt(0)) 00029 { 00030 _coords = &_coordPairs[0]; 00031 } |
|
|||||||||
|
Destructor.
00035 {
00036 }
|
|
|||||||||
|
Size of the neighbourhood.
00137 {
00138 return HxSizes(3, 3, 1);
00139 }
|
|
|||||||||
|
The first of the coordinates.
00079 {
00080 return CnumType(&_coords[0]);
00081 }
|
|
|||||||||
|
The last of the coordinates.
00086 {
00087 return _end;
00088 }
|
|
||||||||||||||||||||
|
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 }
|
|
||||||||||||||||||||
|
Processing one pixel.
00129 {
00130 if ((v.x()*v.x() + v.y()*v.y()) > _resultMag)
00131 _suppressed = true;
00132 }
|
|
|||||||||
|
Produce the result value.
00144 {
00145 return _suppressed ? _nullPix : _resultPix;
00146 }
|
|
|||||||||
|
The name : "nonMaxSuppression".
00121 {
00122 static HxString s("nonMaxSuppression");
00123 return s;
00124 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001