00001 #ifndef __RdivergentROF__ 00002 #define __RdivergentROF__ 00003 00004 00005 00038 #include <stdio.h> 00039 00040 00041 #include "AbsRImageFilter.hpp" 00042 00043 00044 class RdivergentROF : public AbsRImageFilter 00045 { 00046 protected: 00047 00048 RImage* I0; // origin image 00049 RImage* I; // current image 00050 00051 bool lambdaDynamic; 00052 00053 double lambda; // used for linear constrains around the origin 00054 double epsilon2; 00055 00056 double dt; 00057 00058 int niterations; 00059 00060 double sumI0_1; 00061 double sumI0_2; // cached value for sigma2 00062 00063 double I0mean; 00064 double I0sigma; 00065 00066 protected: 00067 00068 virtual void channelConstrain(); 00069 virtual void channelConstrain(AnImage& mask); 00070 00071 virtual double divergent(RImage* im, int x, int y); 00072 00073 virtual double operation(RImage* im, int x, int y); 00074 00075 virtual void operations(RImage* result); 00076 virtual void operations(AnImage& mask, RImage* result); 00077 00078 public: 00079 00080 RdivergentROF(int n, double rdt); 00081 RdivergentROF(int n, double rdt, double alambda0 /* 0.1 */ ); 00082 virtual ~RdivergentROF(){ } 00083 00084 virtual RImage* filter(RImage* src, RImage* dest=0); 00085 virtual RImage* selectedFilter(AnImage* mask, RImage* src, RImage* dest=0); 00086 00087 virtual void report(FILE* file){} 00088 }; 00089 00090 00091 #endif