00001 #ifndef __RMarquinaTVFilter__ 00002 #define __RMarquinaTVFilter__ 00003 00004 00005 00028 #include <stdio.h> 00029 00030 #include "AnImage.hpp" 00031 #include "AbsRImageFilter.hpp" 00032 00033 #include "AbsRImageFlow.hpp" 00034 00035 class RMarquinaTVFilter : public AbsRImageFilter 00036 { 00037 protected: 00038 00039 RImage* I; // current image 00040 RImage* v0; // origin image convolved with laplacian 00041 RImage* wik; // current image convolved^2 with laplacian 00042 00043 double lambda; // used for linear constrains around the origin 00044 double beta; 00045 00046 int niterations; 00047 double alpha; 00048 00049 AbsRImageFlow* meanCurvature; 00050 00051 AbsRImageFilter* laplacian; 00052 00053 protected: 00054 00055 virtual double operation(RImage& im, int x, int y); 00056 00057 virtual void operations(RImage& result); 00058 virtual void operations(AnImage& mask, RImage& result); 00059 00060 public: 00061 00062 RMarquinaTVFilter(int n, double ralpha, double alambda=1.5, double beta=0.05); 00063 virtual ~RMarquinaTVFilter(){ delete meanCurvature; delete laplacian;} 00064 00065 virtual void setMask(int n, int* xp, int* yp){ xm=xp; ym=yp; nMask=n; } 00066 00067 00068 virtual RImage* filter(RImage* src, RImage* dest=0); 00069 virtual RImage* selectedFilter(AnImage* mask, RImage* src, RImage* dest=0); 00070 00071 virtual void report(FILE* file){} 00072 }; 00073 00074 00075 #endif