00001 #ifndef __ImagePotential__ 00002 #define __ImagePotential__ 00003 00027 #include <stdio.h> 00028 00029 00030 #include "AnImage.hpp" 00031 #include "IndependentBayesClassifier.hpp" 00032 00033 class ImagePotential 00034 { 00035 protected: 00036 00037 double w; 00038 00039 bool regularisationFlag; 00040 double sigmaReg; 00041 00042 00043 int width, height, colors; 00044 AnImage* I0; 00045 00046 bool opposedPotential; 00047 00048 protected: 00049 00050 void regularize(AnImage* im); 00051 00052 public: 00053 00054 ImagePotential(double aw=0.01, bool opposed=true, bool reg=false, double sigmaR=2.0) 00055 {w=aw; I0=0; regularisationFlag= reg; sigmaReg=sigmaR; opposedPotential= opposed;} 00056 virtual ~ImagePotential(){} 00057 00058 virtual void set(AnImage* im); 00059 virtual void set(IndependentBayesClassifier* cl){} 00060 00061 virtual void setW(double value){ w= value; } 00062 00063 virtual void setPoint0(int x, int y){} 00064 virtual void setPoint1(int x, int y){} 00065 00066 virtual int getX0(){return 0;} 00067 virtual int getY0(){return 0;} 00068 00069 virtual int getX1(){return 1;} 00070 virtual int getY1(){return 1;} 00071 00072 virtual int getWidth(){ return I0->getWidth(); } 00073 virtual int getHeight(){ return I0->getHeight(); } 00074 00075 virtual double getTermination(int x, int y){ return getP(x,y); } 00076 00077 virtual double getP(int x, int y); 00078 virtual double getPotential(int x, int y); 00079 00080 00081 00082 virtual void report(FILE* file){} 00083 }; 00084 00085 #endif