00001 #ifndef __WeickertFilter__ 00002 #define __WeickertFilter__ 00003 00004 00005 00024 #include <stdio.h> 00025 00026 #include "AnImage.hpp" 00027 #include "AbsRImageFilter.hpp" 00028 00029 #include "BeltramiFlow.hpp" 00030 00031 class WeickertFilter : public AbsRImageFilter 00032 { 00033 protected: 00034 00035 RImage* I0; // origin image 00036 RImage* I; // current image 00037 00038 double lambda; // used for linear constrains around the origin 00039 00040 int niterations; 00041 double alpha; 00042 00043 RImage* ux; 00044 RImage* uy; 00045 00046 RImage* j1; 00047 RImage* j2; 00048 00049 double m; 00050 double Cm; 00051 00052 protected: 00053 00054 void precompute(); 00055 void precompute(AnImage& mask); 00056 00057 double divergentJ(int x, int y) 00058 { 00059 return (j1->dfX_0(x,y) + j2->dfY_0(x,y)); 00060 } 00061 00062 virtual void operations(RImage& result); 00063 virtual void operations(AnImage& mask, RImage& result); 00064 00065 public: 00066 00067 WeickertFilter(int n=100, double ralpha=0.1, double rlambda=5.0, double rCm=3.31488); 00068 virtual ~WeickertFilter(){} 00069 00070 00071 virtual RImage* filter(RImage* src, RImage* dest=0); 00072 virtual RImage* selectedFilter(AnImage* mask, RImage* src, RImage* dest=0); 00073 00074 virtual void report(FILE* file){} 00075 }; 00076 00077 00078 #endif