#include <HxExportExtraIdentMaskMoments.h>
Public Types | |
typedef HxTagTransVar | TransVarianceCategory |
Functor is translation variant. More... | |
typedef HxTag1Phase | PhaseCategory |
1 phase. More... | |
Public Methods | |
HxExportExtraIdentMaskMoments (HxTagList &tags) | |
Constructor. More... | |
~HxExportExtraIdentMaskMoments () | |
Destructor. More... | |
void | doIt (const ImValT &imV, const ExtraValT &extraV, int x, int y, int z) |
Processing one pixel. More... | |
Static Public Methods | |
HxString | className () |
The name : "identMaskMoments". More... |
* Mpq = Sum[ x^p * y^q * f(x,y) ] * x,y * * The order in the resulting list is determined by: * for (int q=0 ; q<=N ; q++) * for (int p=0 ; p<=N ; p++) * if (p+q <= N) * [Mpq]; * * For N=1 the order is: m00, m10, m01 * For N=2 the order is: m00, m10, m20, m01, m11, m02 * For N=3 the order is: m00, m10, m20, m30, m01, m11, m21, m02, m12, m03. *
|
Functor is translation variant.
|
|
1 phase.
|
|
Constructor.
00072 : _tags(tags) 00073 { 00074 _maskVal = HxGetTag<int>(tags, "maskVal"); 00075 _order = HxGetTag<int>(tags, "order"); 00076 _valList = HxGetTag<HxValueList*>(tags, "valList"); 00077 _number = ((_order+1)*(_order+2))/2; 00078 _sums = new ResultT[_number]; 00079 ResultT *ptr = _sums; 00080 for (int i=0 ; i<_number; i++) 00081 *ptr++ = HxScalarInt(0); 00082 } |
|
Destructor.
00087 { 00088 HxValueListBackInserter res = std::back_inserter(*_valList); 00089 for (int i=0 ; i<_number ; i++) 00090 *res++ = HxValue(_sums[i]); 00091 delete _sums; 00092 } |
|
Processing one pixel.
00098 { 00099 if (extraV == _maskVal) { 00100 int i=0; 00101 for (int q=0 ; q<=_order ; q++) { 00102 for (int p=0 ; p<=_order ; p++) { 00103 if (p+q <= _order) { 00104 HxScalarDouble f = ::pow(x, p) * ::pow(y, q); 00105 _sums[i] += ResultT(f) * ResultT(imV); 00106 i++; 00107 } 00108 } 00109 } 00110 } 00111 } |
|
The name : "identMaskMoments".
00116 { 00117 return HxString("identMaskMoments"); 00118 } |