KeyPoint.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *  KeyPoint.h
00003  *
00004  *  (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de>
00005  *           Universitaet Koblenz-Landau
00006  *
00007  *  Additional information:
00008  *  $Id: $
00009  *******************************************************************************/
00010 
00011 #ifndef KeyPoint_H
00012 #define KeyPoint_H
00013 
00014 #include <vector>
00015 #include "Workers/Math/Point2D.h"
00016 
00017 //#include "Architecture/Serializer/ExtendedOutStream.h" TODO
00018 //#include "Architecture/Serializer/ExtendedInStream.h"
00019 
00025 class KeyPoint
00026 {
00027   public:
00028 
00038     KeyPoint( float _x, float _y, float _scale, float _strength, int _sign, float _orientation, std::vector<double> _featureVector );
00039     KeyPoint( float _x, float _y, float _scale, float _strength, int _sign );
00040     KeyPoint( );
00041 
00043     ~KeyPoint();
00044 
00045     KeyPoint( const KeyPoint& other );
00046 
00047     KeyPoint& operator=( const KeyPoint& other );
00048 
00050     template< class T >
00051     void copyDescriptor( T* descriptor, int length );
00052 
00053     void addDescriptor( std::vector<double> descriptor );
00054 
00055     Point2D position() { return Point2D( x, y ); }
00056 
00058     double squaredDistance( const KeyPoint& other ) const;
00059 
00064     double squaredDistance( const KeyPoint& other, double max ) const;
00065 
00067     std::vector<Point2D> getCircle() const;
00068 
00070     std::vector<Point2D> getBoundingBox() const;
00071 
00073     std::vector<Point2D> getCenterArrow() const;
00074 
00075     // SERIALIZATION
00076 
00077 //    /** @brief Serialize to stream */
00078 //    void storer( ExtendedOutStream& extStrm );
00079 
00080 //    /** @brief Deserialize from stream */
00081 //    KeyPoint( ExtendedInStream& extStrm );
00082 
00084     std::string toASCII();
00085 
00087     std::string toString();
00088 
00090     double calcIntersection( const KeyPoint& other );
00091 
00093     double calcOverlap( const KeyPoint& other );
00094 
00097     float x;
00098     float y;
00099 
00100     float scale;
00101     float strength;
00102     float orientation;
00103     int sign;
00104 
00105     std::vector<double> featureVector;
00106     std::vector<unsigned> vectorLimits;
00107 };
00108 
00109 
00110 template< class T >
00111 void KeyPoint::copyDescriptor( T* descriptor, int length )
00112 {
00113   featureVector.resize(length);
00114   for ( int i = 0; i<length; i++ )
00115   {
00116     featureVector[i] = descriptor[i];
00117   }
00118 
00119 }
00120 
00121 
00122 
00123 #endif


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43