00001 #ifndef __SelectiveDericheFilter__ 00002 #define __SelectiveDericheFilter__ 00003 00004 00005 00027 #include <stdio.h> 00028 00029 #include "AnImage.hpp" 00030 #include "RImage.hpp" 00031 00032 #include "ARColorImageFilter.hpp" 00033 00034 class SelectiveDericheFilter : public ARColorImageFilter 00035 { 00036 protected: 00037 00038 Real3CImage* I0; // origin image 00039 Real3CImage* I; // current image 00040 00041 double lambda; 00042 00043 double tau; 00044 00045 int niterations; 00046 double alpha; 00047 00048 RImage* Nxy; // sqrt de lambda+ 00049 00050 protected: 00051 00052 virtual double g(double indicator); 00053 00054 virtual void computeIndicator(Real3CImage& image); 00055 virtual void computeIndicator(AnImage& mask, Real3CImage& image); 00056 00057 virtual double operation(RImage& channel, int c, int x, int y); 00058 00059 virtual void operations(Real3CImage& result, Real3CImage& image); 00060 virtual void operations(AnImage& mask, Real3CImage& result, Real3CImage& image); 00061 00062 public: 00063 00064 SelectiveDericheFilter(int n=50, double ralpha=0.05, double atau=0.1); 00065 virtual ~SelectiveDericheFilter(){} 00066 00067 00068 // single shot filtering 00069 virtual Real3CImage* filter(Real3CImage* src, Real3CImage* dest=0); 00070 virtual Real3CImage* selectedFilter(AnImage* mask, Real3CImage* src, Real3CImage* dest=0); 00071 00072 00073 00074 virtual void report(FILE* file){} 00075 }; 00076 00077 00078 #endif