/**
* @file ClassificationResult.cpp
* @brief classification result, what else?
* @author Erik Rodner
* @date 02/13/2008

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

#include <iostream>

#include "vislearning/cbaselib/ClassificationResult.h"

using namespace OBJREC;

using namespace std;
using namespace NICE;



ClassificationResult::ClassificationResult ( int _rejection_status, int maxClassNo ) : scores ( maxClassNo + 1 )
{
  rejection_status = _rejection_status;
  classno = -1;
  classno_groundtruth = -1;
  classname = "rejected";
  uncertainty = 0.0;
}

ClassificationResult::ClassificationResult ( int _classno, double _score, int maxClassNo ) : scores ( maxClassNo + 1 )
{
  rejection_status = REJECTION_NONE;
  classno = _classno;
  scores[classno] = _score;
  classname = "unknown";
  classno_groundtruth = -1;
  uncertainty = 0.0;
}

ClassificationResult::ClassificationResult ( int _classno, const FullVector & _scores )
{
  rejection_status = REJECTION_NONE;
  classno = _classno;
  scores = _scores;
  classname = "unknown";
  classno_groundtruth = -1;
  uncertainty = 0.0;
}

ClassificationResult::~ClassificationResult()
{
}

double ClassificationResult::confidence () const
{
  return scores.get ( classno );
}

bool ClassificationResult::ok () const
{
  return ( rejection_status == REJECTION_NONE );
}
