/** 
* @file LocalFeature.h
* @brief Abstract class for Local Features ( ONLY DESCRIPTORS, NO DETECTORS )
* @author Erik Rodner, Alexander Freytag
* @date 02/05/2008

*/
#ifndef LOCALFEATUREINCLUDE
#define LOCALFEATUREINCLUDE

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

namespace OBJREC {

/** @class LocalFeature
* @brief Abstract class for Local Features ( ONLY DESCRIPTORS, NO DETECTORS )
*
*/
class LocalFeature : public NICE::Persistent
{

  protected:

  public:
    
    ///////////////////// ///////////////////// /////////////////////
    //                   CONSTRUCTORS / DESTRUCTORS
    ///////////////////// ///////////////////// /////////////////////      
    
    /** simple constructor */
    LocalFeature();
        
    /** simple destructor */
    virtual ~LocalFeature();
    
    /** 
     * @brief Jobs previously performed in the config-version of the constructor, read settings etc.
     * @author Alexander Freytag
     * @date 09-02-2014 ( dd-mm-yyyy )
     */    
    virtual void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "LocalFeature") = 0;     
    
    ///////////////////// ///////////////////// /////////////////////
    //                      FEATURE STUFF
    ///////////////////// ///////////////////// //////////////////
    

    virtual int getDescSize() const = 0;

    virtual int getDescriptors ( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors) const = 0;
    
    virtual int getDescriptors ( const NICE::ColorImage & img, NICE::VVector & positions, NICE::VVector & descriptors) const;
    
    virtual void visualizeFeatures ( NICE::Image & mark,
          const NICE::VVector & positions,
          size_t color ) 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
