00001 #ifndef __SusanOp__
00002 #define __SusanOp__
00003
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00022
00023 #include "AnImageOp.hpp"
00024
00025
00026 class SusanFilter : public AnImageOp
00027 {
00028 private:
00029
00030 int width;
00031 int height;
00032
00033 int maxKernelSize;
00034 int maxKernelRange;
00035 int nmax;
00036
00037 double t;
00038 double g;
00039
00040 AnImage* image;
00041
00042 double** r0;
00043
00044
00045 double** n0;
00046 double** cgx;
00047 double** cgy;
00048 double** mu20;
00049 double** mu11;
00050 double** mu02;
00051
00052 protected:
00053
00054 void init(AnImage* im);
00055
00056 double distance2(int x0, int y0);
00057 bool isCorner(int x0, int y0);
00058 int getBrightness(int x, int y);
00059 int getResponse(int x, int y);
00060
00061 double c(int x, int y, int x0, int y0);
00062
00063 void computeLocalMoments(int x0,int y0);
00064 void computeUSAN();
00065
00066 public:
00067
00068 SusanFilter(double contrast, double geometricThreshold);
00069 SusanFilter(int kernelSize, double contrast, double geometricThreshold);
00070
00071 AnImage* filter(AnImage* src, AnImage* dest);
00072 };
00073
00074 #endif