00001 #ifndef __TVFilter__ 00002 #define __TVFilter__ 00003 00004 00005 00024 #include <stdio.h> 00025 00026 #include "AbsRImageFilter.hpp" 00027 00028 00029 class TVFilter : public AbsRImageFilter 00030 { 00031 protected: 00032 00033 RImage* I0; // origin image 00034 RImage* I; // current image 00035 00036 bool lambdaDynamic; 00037 00038 double lambda; // used for linear constrains around the origin 00039 double epsilon2; 00040 00041 double dt; 00042 00043 int niterations; 00044 00045 double sumI0_1; 00046 double sumI0_2; // cached value for sigma2 00047 00048 double I0mean; 00049 double I0sigma; 00050 00051 protected: 00052 00053 virtual void channelConstrain(); 00054 virtual void channelConstrain(AnImage& mask); 00055 00056 virtual double operation(RImage* im, int x, int y); 00057 00058 virtual void operations(RImage& result); 00059 virtual void operations(AnImage& mask, RImage& result); 00060 00061 public: 00062 00063 TVFilter(int n, double rdt, bool dynamic=false); 00064 virtual ~TVFilter(){} 00065 00066 00067 virtual RImage* filter(RImage* src, RImage* dest=0); 00068 virtual RImage* selectedFilter(AnImage* mask, RImage* src, RImage* dest=0); 00069 00070 virtual void report(FILE* file){} 00071 }; 00072 00073 00074 #endif