#include <iostream>

#include <assert.h>

#include "vislearning/features/localfeatures/LocalFeatureLFInterface.h"

using namespace OBJREC;
using namespace std;
using namespace NICE;

LocalFeatureLFInterface::LocalFeatureLFInterface( const Config *conf, LocalFeatureRepresentation *_lfpres )
{
  lfpres = _lfpres;
}

LocalFeatureLFInterface::~LocalFeatureLFInterface()
{
  delete lfpres;
}


int LocalFeatureLFInterface::getDescriptors ( const NICE::Image & img, VVector & positions, VVector & descriptors ) const
{
  //TODO do we want to ignore the positions of lfrep and use the given ones, or do we indeed want to compute positions on our own? If so, why do we use the Interface to LocalFeature, and not directly LocalFeatureRepresentation?    
  lfpres->extractFeatures(img, descriptors, positions);
  assert(descriptors.size() == positions.size());
  return 0;
}

int LocalFeatureLFInterface::getDescriptors ( const NICE::ColorImage & img, VVector & positions, VVector & descriptors) const
{
  //TODO do we want to ignore the positions of lfrep and use the given ones, or do we indeed want to compute positions on our own? If so, why do we use the Interface to LocalFeature, and not directly LocalFeatureRepresentation?
  lfpres->extractFeatures(img, descriptors, positions);
  assert(descriptors.size() == positions.size());
  return 0;
}

void LocalFeatureLFInterface::visualizeFeatures ( NICE::Image & mark,
        const VVector & positions,
        size_t color ) const
{
  //cerr << "LocalFeatureLFInterface::visualizeFeatures(...) not yet implemented" << endl;
  lfpres->visualizeFeatures(mark, positions, color);
}

