Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxSftMoments.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 HxSftMoments_h
00012 #define HxSftMoments_h
00013 
00014 #include "HxSampleFunctorTem.h"
00015 
00016 /*  Generates all moments up to order N.
00017  *
00018  *  Mpq = Sum[ x^p * y^q * f(x,y) ]
00019  *        x,y
00020  *
00021  *  The order in the resulting list is determined by:
00022  *  for (int q=0 ; q<=N ; q++)
00023  *      for (int p=0 ; p<=N ; p++)
00024  *          if (p+q <= N)
00025  *              [Mpq];
00026  *  For N=1 the order is: m00, m10, m01
00027  *  For N=2 the order is: m00, m10, m20, m01, m11, m02
00028  *  For N=3 the order is: m00, m10, m20, m30, m01, m11, m21, m02, m12, m03.
00029  */
00030 template <class ArgType, class ResType>
00031 class HxSftMoments : public HxSampleFunctorTem<ArgType,ResType>
00032 {
00033 public:
00034                         HxSftMoments(int order, HxString name);
00035     virtual             ~HxSftMoments();
00036 
00037     virtual void        init();
00038     virtual void        next(ArgType pixV, ArgType maskV, HxPoint p);
00039     virtual void        result(HxValueListBackInserter res);
00040 
00041 private:
00042     int                 _order;
00043     int                 _number;
00044     ResType*            _sums;
00045 };
00046 
00047 #ifdef INC_TEMPLATE_SRC
00048 #include "HxSftMoments.c"
00049 #endif
00050 
00051 #endif

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