00001 #ifndef __RSimplePentaAosOp__ 00002 #define __RSimplePentaAosOp__ 00003 00004 00047 #include <stdio.h> 00048 00049 #include "AbsRImageFilter.hpp" 00050 00051 #include "AbsPentaDiagonalLS.hpp" 00052 00053 class RSimplePentaAosOp : public AbsRImageFilter 00054 { 00055 protected: 00056 00057 // basic filter parameters 00058 00059 int m; // m is the number of dimension (here m=2) 00060 00061 int w, h; 00062 00063 int iterMax; 00064 double tau; 00065 double K,K2; 00066 00067 double sigma; // to build a regularised image 00068 bool iirUsed; // use IIR bluring or LOD Heat flow for regularisation 00069 00070 bool nonLinear; // flag to recompute gradient each iteration 00071 00072 AbsRImageFilter* blurrer; // IIR bluring or LOD Heat flow 00073 AbsRImageFilter* gradient2; // gradient2 00074 00075 RImage* Isigma; 00076 RImage* Igrad2Norme; // regularized gradient image 00077 00078 AbsPentaDiagonalLS* hThomasLS; // usually a Thomas Solver, but other are possible !!! 00079 AbsPentaDiagonalLS* vThomasLS; // usually a Thomas Solver, but other are possible !!! 00080 00081 protected: 00082 00083 virtual void init(RImage* im); 00084 virtual void gradient2Regularisation(RImage* im); 00085 00086 virtual double g(int i, int j)=0; // conductivity to define later 00087 00088 public: 00089 00090 RSimplePentaAosOp(int iterations=8, double t=0.5, 00091 double k=16.0, double asigma=5.0, 00092 bool iirFlag=false, bool nonLinearFlag=true); 00093 virtual ~RSimplePentaAosOp(){delete gradient2;} 00094 00095 // single shot filtering 00096 virtual RImage* filter(RImage* src, RImage* dest=0); 00097 virtual RImage* selectedFilter(AnImage* mask, RImage* src, RImage* dest=0); 00098 00099 virtual void report(FILE* file){ fprintf(file,"Real Simple Aos Operator\n"); } 00100 }; 00101 00102 00103 #endif