iSpike  2.1
Spike conversion library for robotics
D:/Home/Programs/iSpike/include/iSpike/VisualDataReducer/LogPolarVisualDataReducer.hpp
Go to the documentation of this file.
00001 #ifndef LOGPOLARVISUALDATAREDUCER_HPP_
00002 #define LOGPOLARVISUALDATAREDUCER_HPP_
00003 
00004 #include <iSpike/Bitmap.hpp>
00005 
00006 #include <vector>
00007 using namespace std;
00008 
00009 #include <boost/scoped_ptr.hpp>
00010 
00011 namespace ispike {
00012 
00014         class PolarCartCoords {
00015                 public:
00016                         PolarCartCoords(int radius, int theta, int x, int y) :
00017                                 radius(radius),
00018                                 theta(theta),
00019                                 x(x),
00020                                 y(y)
00021                         {
00022                                 ;
00023                         }
00024 
00025                         int radius;
00026                         int theta;
00027                         int x;
00028                         int y;
00029         };
00030 
00033         class LogPolarVisualDataReducer {
00034                 public:
00035                         LogPolarVisualDataReducer();
00036                         Bitmap& getReducedImage();
00037                         bool isInitialized() { return initialized; }
00038                         void setBitmap(Bitmap& bitmap);
00039                         void setOutputHeight(unsigned outputHeight);
00040                         void setOutputWidth(unsigned outputWidth);
00041                         void setFoveaRadius(double foveaRadius);
00042 
00043                 private:
00044                         //========================  VARIABLES  ============================
00046                         boost::scoped_ptr<Bitmap> reducedImage;
00047 
00049                         unsigned inputWidth;
00050 
00052                         unsigned inputHeight;
00053 
00055                         unsigned outputWidth;
00056 
00058                         unsigned outputHeight;
00059 
00061                         //CoordMapType polarToCartesianMap;
00062                         vector<PolarCartCoords> coordinatesVector;
00063 
00064 
00066                         double foveaRadius;
00067 
00069                         bool initialized;
00070 
00071 
00072                         //========================  METHODS  ==============================
00073                         void calculateReducedImage(Bitmap& bitmap);
00074                         pair<int, int> getInputCartesianCoordinate(double radius, double theta);
00075                         void initialize(Bitmap& bitmap);
00076                         void initialisePolarToCartesianVector();
00077 
00078         };
00079 
00080 }
00081 
00082 #endif /* LOGPOLARVISUALDATAREDUCER_HPP_ */
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines