iSpike
2.1
Spike conversion library for robotics
|
00001 #ifndef DOGVISUALFILTER_HPP_ 00002 #define DOGVISUALFILTER_HPP_ 00003 00004 #include <iSpike/VisualDataReducer/LogPolarVisualDataReducer.hpp> 00005 #include <iSpike/Bitmap.hpp> 00006 00007 namespace ispike { 00008 00010 class DOGVisualFilter { 00011 public: 00012 DOGVisualFilter(LogPolarVisualDataReducer* reducer); 00013 ~DOGVisualFilter(); 00014 Bitmap& getBitmap(); 00015 bool isInitialized(){ return initialized; } 00016 void setPositiveSigma(double positiveSigma) { this->positiveSigma = positiveSigma; } 00017 void setNegativeSigma(double negativeSigma) { this->negativeSigma = negativeSigma; } 00018 void setPositiveFactor(double positiveFactor) { this->positiveFactor = positiveFactor; } 00019 void setNegativeFactor(double negativeFactor) { this->negativeFactor = negativeFactor; } 00020 void setOpponencyTypeID(int opponencyTypeID); 00021 void update(); 00022 00023 private: 00024 //========================== VARIABLES ======================= 00025 LogPolarVisualDataReducer* reducer; 00026 00028 double positiveSigma; 00029 00031 double negativeSigma; 00032 00034 double positiveFactor; 00035 00037 double negativeFactor; 00038 00040 int opponencyTypeID; 00041 00043 bool normalize; 00044 00046 bool initialized; 00047 00049 Bitmap* outputBitmap; 00050 00052 Bitmap* redBitmap; 00053 00055 Bitmap* greenBitmap; 00056 00058 Bitmap* blueBitmap; 00059 00061 Bitmap* yellowBitmap; 00062 00064 Bitmap* greyBitmap1; 00065 00067 Bitmap* greyBitmap2; 00068 00070 bool useGreyBitmap1; 00071 00073 Bitmap* positiveBlurredBitmap; 00074 00076 Bitmap* negativeBlurredBitmap; 00077 00078 00079 //========================== METHODS ========================= 00080 void calculateLogDifference(Bitmap& bitmap1, Bitmap& bitmap2); 00081 void calculateOpponency(Bitmap& bitmap1, Bitmap& bitmap2); 00082 void extractRedChannel(Bitmap& inputImage); 00083 void extractGreenChannel(Bitmap& inputImage); 00084 void extractBlueChannel(Bitmap& inputImage); 00085 void extractYellowChannel(); 00086 void extractGreyChannel(Bitmap& inputBitmap, Bitmap& newBitmap, bool logInput); 00087 void gaussianBlur(Bitmap& inputBitmap, Bitmap& resultBitmap, double sigma); 00088 void initialize(int width, int height); 00089 void normalizeImage(Bitmap& image); 00090 void subtractImages(Bitmap& firstImage, Bitmap& secondImage, Bitmap& result); 00091 void subtractImages(Bitmap& firstImage, Bitmap& secondImage, double positiveFactor, double negativeFactor, Bitmap& result); 00092 }; 00093 00094 } 00095 00096 #endif /* DOGVISUALFILTER_HPP_ */