00001 #pragma once 00002 00003 //Refereanser til eksternt grensesnitt/kode som anvendes i denne filen 00004 #include "Region.h" 00005 00007 const float INFINITY = 1000000; 00008 00009 00017 class Feature 00018 { 00019 00020 protected: 00021 00023 unsigned short int ID; 00024 00026 unsigned short int DIM; 00027 00029 const char *NAME; 00030 00032 unsigned short int score; 00033 00035 float *req1; 00036 00038 float *req2; 00039 00041 float *homogenMax; 00042 00044 float *homogenMean; 00045 00047 float *inhomogenMean; 00048 00056 float absoluteValue(float value); 00057 00058 00066 float valueHandler(float value); 00067 00068 00069 public: 00070 00074 Feature(void); 00075 00076 00080 ~Feature(void); 00081 00082 00090 void initialize(float **abc); 00091 00092 00098 int getId(); 00099 00100 00106 const char * getName(); 00107 00108 00114 int getDim(); 00115 00116 00122 int getCredit(); 00123 00124 00135 virtual float * calculate(Region *r) = 0; 00136 00137 00147 float * difference(Region *r1, Region *r2); 00148 00149 00162 void add(bool homogen, float *diff); 00163 00164 00172 void maxHomogen(float *diff); 00173 00174 00185 void divide(bool homogen, int divisor); 00186 00187 };