00001 #ifndef __IGilbaoComplexDiffOp__ 00002 #define __IGilbaoComplexDiffOp__ 00003 00030 #include <stdio.h> 00031 #include <math.h> 00032 00033 #include "ICMultiImageOp.hpp" 00034 00035 #include "C3CImage.hpp" 00036 00037 00038 class IGilbaoComplexDiffOp : public ICMultiImageOp 00039 { 00040 private: 00041 00042 int type; // 0=linear diff,1=perona1, 2=perona2, 3=non linear diff & ramp preserving 00043 double tau; 00044 00045 double theta; 00046 double sigma; 00047 00048 double k; 00049 00050 protected: 00051 00052 // mono channel 00053 00054 virtual AnImage* greyFilter(AnImage* src, AnImage* dest=0); 00055 virtual AnImage* greySelectedFilter(AnImage* mask, AnImage* src, AnImage* dest=0); 00056 00057 // separate color channels 00058 00059 virtual C3CImage* scolorFilter(C3CImage* src, C3CImage* dest=0); 00060 virtual C3CImage* scolorSelectedFilter(AnImage* mask, C3CImage* src, C3CImage* dest=0); 00061 00062 // color channels 00063 00064 virtual C3CImage* fcolorFilter(C3CImage* src, C3CImage* dest=0); 00065 virtual C3CImage* fcolorSelectedFilter(AnImage* mask, C3CImage* src, C3CImage* dest=0); 00066 00067 public: 00068 00069 IGilbaoComplexDiffOp(int atype=0, int iterations=8, double t=0.2, double ctheta=0.001, double asigma=0.0, double kval=2.0) 00070 :ICMultiImageOp(iterations,false) 00071 { 00072 double PI= 4.0 * atan(1.0); 00073 theta= PI*ctheta; 00074 00075 type= atype; 00076 tau= t; 00077 sigma= asigma; 00078 k= kval; 00079 } 00080 virtual ~IGilbaoComplexDiffOp(){} 00081 00082 virtual AnImage* filter(AnImage* src, AnImage* dest=0); 00083 virtual AnImage* selectedFilter(AnImage* mask, AnImage* src, AnImage* dest=0); 00084 00085 virtual void report(FILE* file){} 00086 }; 00087 00088 00089 #endif