00001 #ifndef __ColorCoherenceEnhancement55__ 00002 #define __ColorCoherenceEnhancement55__ 00003 00025 #include <stdio.h> 00026 00027 #include "AnImage.hpp" 00028 #include "Real3CImage.hpp" 00029 #include "RImage.hpp" 00030 00031 #include "ARColorImageFilter.hpp" 00032 00033 00034 class ColorCoherenceEnhancement55 : public ARColorImageFilter 00035 { 00036 protected: 00037 00038 Real3CImage* I0; // origin image 00039 Real3CImage* I; // current image 00040 00041 00042 int niterations; 00043 double tau; 00044 00045 AbsRImageFilter* opX; // gradX 00046 AbsRImageFilter* opY; // gradY 00047 00048 Real3CImage* ux; 00049 Real3CImage* uy; 00050 00051 // diffusion matrix 00052 double a; 00053 double b; 00054 double c; 00055 00056 double sigma; // blurred image if used 00057 double c1; 00058 double c2; 00059 00060 double lambda1, lambda2; 00061 double cosAlpha, sinAlpha; 00062 00063 // structure matrix 00064 double rho; // blurred integration if used 00065 AbsRImageFilter* largeBlurrer; // used for structured tensors 00066 00067 RImage* jtmp; 00068 RImage* j11; 00069 RImage* j12; 00070 RImage* j22; 00071 00072 double mu1, mu2; 00073 00074 // flux 00075 Real3CImage* j1; 00076 Real3CImage* j2; 00077 Real3CImage* j1x; 00078 Real3CImage* j2y; 00079 00080 protected: 00081 00082 virtual void precompute(); 00083 00084 virtual void operations(Real3CImage& result); 00085 virtual void operations(AnImage& mask, Real3CImage& result); 00086 00087 public: 00088 00089 ColorCoherenceEnhancement55(int n=100, double dt=0.2, 00090 double sig=0.5, double arho=5.0, double ac1=0.001, double ac2=1.0); 00091 virtual ~ColorCoherenceEnhancement55(){ delete largeBlurrer; } 00092 00093 virtual void prepare(Real3CImage* src); // used to globally maintain subimages avoiding cons 00094 00095 // single shot filtering 00096 virtual Real3CImage* filter(Real3CImage* src, Real3CImage* dest=0); 00097 virtual Real3CImage* selectedFilter(AnImage* mask, Real3CImage* src, Real3CImage* dest=0); 00098 00099 00100 00101 virtual void report(FILE* file){} 00102 }; 00103 00104 00105 #endif