00001 #ifndef __RLysaker4thOrderFilter__ 00002 #define __RLysaker4thOrderFilter__ 00003 00004 00005 00038 #include <stdio.h> 00039 00040 00041 #include "AbsRImageFilter.hpp" 00042 00043 00044 class RLysaker4thOrderFilter : public AbsRImageFilter 00045 { 00046 protected: 00047 00048 RImage* u0; // origin image 00049 RImage* u; // current image 00050 00051 RImage* ux; // x gradient 00052 RImage* uy; // y gradient 00053 RImage* aDUxx; // second order norme 00054 RImage* bDUyy; // second order norme 00055 RImage* deltaU; //difference to target to compute dynamicaly lambda 00056 00057 double lambda; // used for linear constrains around the origin 00058 double sigma2; 00059 double epsilon; 00060 00061 double sumI0_2; // cached value for sigma2 00062 00063 int niterations; 00064 double dt; 00065 00066 protected: 00067 00068 virtual void channelConstrain(); 00069 virtual void channelConstrain(AnImage& mask); 00070 00071 virtual double operation(RImage* im, int x, int y); 00072 00073 virtual void operations(RImage* result); 00074 virtual void operations(AnImage& mask, RImage* result); 00075 00076 public: 00077 00078 RLysaker4thOrderFilter(int n, double rdt=0.1); 00079 virtual ~RLysaker4thOrderFilter(){ } 00080 00081 virtual void setMask(int n, int* xp, int* yp){ xm=xp; ym=yp; nMask=n; } 00082 00083 00084 virtual RImage* filter(RImage* src, RImage* dest=0); 00085 virtual RImage* selectedFilter(AnImage* mask, RImage* src, RImage* dest=0); 00086 00087 virtual void report(FILE* file){} 00088 }; 00089 00090 00091 #endif