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