#include <HxKerNgbNormCorrelation.h>
Public Types | |
| typedef HxTagLoop | IteratorCategory |
| Loop version. More... | |
| typedef HxTag2Phase | PhaseCategory |
| 2 phases. More... | |
Public Methods | |
| HxKerNgbNormCorrelation (HxTagList &tags) | |
| Constructor. More... | |
| ~HxKerNgbNormCorrelation () | |
| Destructor. More... | |
| HxSizes | size () |
| Size of the neighbourhood. More... | |
| void | init (int ix, int iy, ArithT imVal) |
| Initialization first phase. More... | |
| void | next (int x, int y, ArithT pixV, ArithT maskV) |
| Processing one pixel in first phase. More... | |
| void | init2 (int ix, int iy, ArithT imVal) |
| Initialization second phase. More... | |
| void | next2 (int x, int y, ArithT pixV, ArithT maskV) |
| Processing one pixel in second phase. More... | |
| ResultT | result () |
| Produce the result value. More... | |
Static Public Methods | |
| HxString | className () |
| The name : "normalizedCorrelation". More... | |
Formula:
\begin{verbatim} Sum[f(x,y) - fBar(x,y)][w(x,y) - wBar] x,y --------------------------------------------------------- Sqrt[ Sum[f(x,y) - fBar(x,y)]^2 * Sum[w(x,y) - wBar]^2 ] x,y x,y \end{verbatim}
|
|||||
|
Loop version.
|
|
|||||
|
2 phases.
|
|
||||||||||
|
Constructor.
|
|
|||||||||
|
Destructor.
00025 {
00026 }
|
|
|||||||||
|
Size of the neighbourhood.
00039 {
00040 return _ngbSize;
00041 }
|
|
||||||||||||||||||||
|
Initialization first phase.
00047 {
00048 _num = 0;
00049 _fBar = HxScalarDouble(0);
00050 _wBar = HxScalarDouble(0);
00051 }
|
|
||||||||||||||||||||||||
|
Processing one pixel in first phase.
00057 {
00058 _num += 1;
00059 _fBar += pixV;
00060 _wBar += maskV;
00061 }
|
|
||||||||||||||||||||
|
Initialization second phase.
00066 {
00067 _fBar = _fBar / (ResultT) _num;
00068 _wBar = _wBar / (ResultT) _num;
00069 _sumFW = HxScalarDouble(0);
00070 _sumFSqr = HxScalarDouble(0);
00071 _sumWSqr = HxScalarDouble(0);
00072 }
|
|
||||||||||||||||||||||||
|
Processing one pixel in second phase.
00077 {
00078 ResultT p = pixV, m = maskV;
00079 _sumFW += (p - _fBar) * (m - _wBar);
00080 _sumFSqr += (p - _fBar) * (p - _fBar);
00081 _sumWSqr += (m - _wBar) * (m - _wBar);
00082 }
|
|
|||||||||
|
Produce the result value.
00087 {
00088 ResultT tmp = _sumFSqr * _sumWSqr;
00089 tmp = tmp.sqrt();
00090 if (HxScalarInt(tmp) == HxScalarInt(0))
00091 return ResultT(HxScalarInt(0));
00092 return _sumFW / tmp;
00093 }
|
|
|||||||||
|
The name : "normalizedCorrelation".
00031 {
00032 static HxString name("normalizedCorrelation");
00033 return name;
00034 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001