/** 
* @file LFGenericLocal.h
* @brief generic local features ( Random Sampling of POIs and SIFT as descriptor)
* @author Erik Rodner
* @date 02/05/2008
*/
#ifndef LFGENERICLOCALINCLUDE
#define LFGENERICLOCALINCLUDE

#include "core/vector/VectorT.h"
#include "core/vector/MatrixT.h"
#include "core/image/ImageT.h"
 
#include "core/basics/Config.h"

#include "LocalFeatureRepresentation.h"
#include "InterestDetector.h"
#include "LocalFeature.h"


namespace OBJREC {

/** generic local features */
/** @class LFGenericLocal
* @brief Generic local features ( actually: Random Sampling of POIs followed by SIFT as descriptor)
*/  
class LFGenericLocal : public LocalFeatureRepresentation
{

  protected:
    LocalFeature *lf;
    InterestDetector *id;

  public:
        
    ///////////////////// ///////////////////// /////////////////////
    //                   CONSTRUCTORS / DESTRUCTORS
    ///////////////////// ///////////////////// /////////////////////
    
    /** 
     * @brief default constructor
     * @date 10-02-2014 (dd-mm-yyyy )
     * @author Alexander Freytag
     */
    LFGenericLocal();        
    
    /** simple constructor */
    LFGenericLocal( const NICE::Config *conf, int numFeatures );
        
    /** simple destructor */
    virtual ~LFGenericLocal();
    
    ///////////////////// ///////////////////// /////////////////////
    //                      FEATURE STUFF
    ///////////////////// ///////////////////// //////////////////      
      
    int getDescSize () const;

    int extractFeatures ( const NICE::Image & img, 
              NICE::VVector & features, 
              NICE::VVector & positions) const;
              
    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 10-02-2014 ( dd-mmyyyy)
     */     
    virtual void restore ( std::istream & is, int format = 0 );
    
    /** 
     * @brief Save object to external file (stream)
     * @author Alexander Freytag
     * @date 10-02-2014 ( dd-mmyyyy)
     */       
    virtual void store( std::ostream & os, int format = 0 ) const;
    
    /** 
     * @brief Clear  object
     * @author Alexander Freytag
     * @date 10-02-2014 ( dd-mmyyyy)
     */    
    virtual void clear ();           

};


} // namespace

#endif
