00001 #ifndef __IMeanShiftOp__ 00002 #define __IMeanShiftOp__ 00003 00004 00005 00024 #include <stdio.h> 00025 00026 #include "AnImageOp.hpp" 00027 00028 typedef struct 00029 { 00030 float x,y; 00031 float grey; 00032 } MsGreyPoint; 00033 00034 typedef struct 00035 { 00036 float x,y; 00037 float c1, c2, c3; 00038 } Ms3ChannelPoint; 00039 00040 00041 class IMeanShiftOp : public AnImageOp 00042 { 00043 protected: 00044 00045 float sigmaSpace; 00046 float sigmaRange; 00047 00048 int s, r, d; 00049 00050 int nmax; 00051 00052 int w,h; 00053 00054 protected: 00055 00056 virtual bool greyWindow(AnImage* src, MsGreyPoint& yk1, MsGreyPoint& yk); 00057 virtual bool rgbWindow(AnImage* src, Ms3ChannelPoint& yk1, Ms3ChannelPoint& yk); 00058 00059 public: 00060 00061 IMeanShiftOp(float sigmaS=8.0, float sigmaR=4.0, int iterMax=3) 00062 {sigmaSpace= sigmaS; sigmaRange= sigmaR; nmax= iterMax; s=2; r=1; d= s+r;} 00063 virtual ~IMeanShiftOp(){} 00064 00065 virtual AnImage* filter(AnImage* src, AnImage* dest=0); 00066 00067 virtual void report(FILE* file){} 00068 }; 00069 00070 00071 #endif