Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxNftNormCorrelation.h

00001 /*
00002  *  Copyright (c) 1998, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Dennis Koelma (koelma@wins.uva.nl)
00008  *  Edo Poll (poll@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxNftNormCorrelation_h
00012 #define HxNftNormCorrelation_h
00013 
00014 #include "HxNeighbFunctorTem.h"
00015 
00016 /* Formula:
00017 
00018 Sum[f(x,y) - fBar(x,y)][w(x,y) - wBar]
00019 x,y
00020 ---------------------------------------------------------
00021 Sqrt[ Sum[f(x,y) - fBar(x,y)]^2  * Sum[w(x,y) - wBar]^2 ]
00022       x,y                          x,y
00023 
00024 */
00025 template <class ArgType, class ResType>
00026 class HxNftNormCorrelation : public HxNeighbFunctorTem<ArgType,ResType>
00027 {
00028 public:
00029                         HxNftNormCorrelation();
00030     virtual             ~HxNftNormCorrelation();
00031 
00032     virtual void        init();
00033     virtual void        next(ArgType pixV, ArgType maskV, HxPoint p);
00034     virtual ResType     result();
00035 
00036     virtual int         hasPhase2();
00037 
00038     virtual void        init2();
00039     virtual void        next2(ArgType pixV, ArgType maskV, HxPoint p);
00040     virtual ResType     result2();
00041 
00042 private:
00043     HxScalarInt         _num;
00044     ResType             _fBar;
00045     ResType             _wBar;
00046     ResType             _sumFW;
00047     ResType             _sumFSqr;
00048     ResType             _sumWSqr;
00049 };
00050 
00051 #ifdef INC_TEMPLATE_SRC
00052 #include "HxNftNormCorrelation.c"
00053 #endif
00054 
00055 #endif

Generated on Tue Jan 8 13:59:15 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001