/** 
* @file LocalFeatureRepresentation.h
* @brief Absract class for Local Feature Representations (Detector + Descriptor)
* @author Erik Rodner, Alexander Freytag
* @date 11/19/2007

*/
#ifndef LOCALFEATUREREPRESENTATIONINCLUDE
#define LOCALFEATUREREPRESENTATIONINCLUDE

// STL includes
#include <vector>

// nice-core includes
#include <core/basics/Exception.h>
#include <core/basics/Persistent.h>
// 
#include <core/image/ImageT.h>
#include <core/imagedisplay/ImageDisplay.h>
// 
#include <core/vector/VectorT.h>
#include <core/vector/MatrixT.h>
#include <core/vector/VVector.h>


namespace OBJREC {

/** absract class for the representation of an image with local feature descriptors */
/** NOTE: This class returns Descriptors, which DO NOT need any given positions. All Descriptors calculate there own positions, on DIFFERENT ways. **/

  /** @class LocalFeatureRepresentation
 * @brief Absract class for Local Feature Representations (Detector + Descriptor)
 *
 */
class LocalFeatureRepresentation : public NICE::Persistent
{

  protected:

  public:
    
    ///////////////////// ///////////////////// /////////////////////
    //                   CONSTRUCTORS / DESTRUCTORS
    ///////////////////// ///////////////////// /////////////////////         

    /** simple constructor */
    LocalFeatureRepresentation();
    
    /** simple destructor */
    virtual ~LocalFeatureRepresentation();

    ///////////////////// ///////////////////// /////////////////////
    //                      FEATURE STUFF
    ///////////////////// ///////////////////// //////////////////

    virtual int getDescSize () const = 0;

    virtual int extractFeatures ( const NICE::Image & img,
                                  NICE::VVector & features,
                                  NICE::VVector & positions ) const = 0;

    virtual int extractFeatures ( const NICE::ColorImage & img,
                                  NICE::VVector & features,
                                  NICE::VVector & positions ) const;

    virtual void visualizeFeatures ( NICE::Image & mark,
                                    const NICE::VVector & positions,
                                    size_t color ) const;

    virtual void visualize ( NICE::Image & img,
                            const NICE::Vector & feature ) const;

    ///////////////////// INTERFACE PERSISTENT /////////////////////
    // interface specific methods for store and restore
    ///////////////////// INTERFACE PERSISTENT /////////////////////

    /**
    * @brief Load object from external file (stream)
    * @author Alexander Freytag
    * @date 09-02-2014 ( dd-mm-yyyy )
    */
    void restore ( std::istream & is, int format = 0 ) = 0;

    /**
    * @brief Save object to external file (stream)
    * @author Alexander Freytag
    * @date 09-02-2014 ( dd-mm-yyyy )
    */
    void store ( std::ostream & os, int format = 0 ) const = 0;

    /**
    * @brief Clear object
    * @author Alexander Freytag
    * @date 09-02-2014 ( dd-mm-yyyy )
    */
    void clear () = 0;  

};


} // namespace

#endif
