#ifndef _NICE_OBJREC_GENERICDISTANCESELECTION_INCLUDE #define _NICE_OBJREC_GENERICDISTANCESELECTION_INCLUDE #include namespace OBJREC { class GenericDistanceSelection { public: static NICE::VectorDistance *selectDistance ( std::string distance_type ) { NICE::VectorDistance *distance = NULL; if ( distance_type == "euclidean" ) { distance = new NICE::EuclidianDistance(); } else if ( distance_type == "manhattan" || distance_type == "cityblock" ) { distance = new NICE::ManhattanDistance(); } else if ( distance_type == "median" ) { distance = new NICE::MedianDistance(); } else if ( distance_type == "cosinus" ) { distance = new NICE::CosDistance(); } else if ( distance_type == "spherical" ) { distance = new NICE::SphericalDistance(); } else if ( distance_type == "chisquare" || distance_type == "chi2" ) { distance = new NICE::Chi2Distance(); } else if ( distance_type == "kl" || distance_type == "kullbackleibler" ) { distance = new NICE::KLDistance(); } else if ( distance_type == "bhattacharyya" ) { distance = new NICE::BhattacharyyaDistance(); } else { fthrow ( NICE::Exception, "Distance type " << distance_type << " is unknown - euclidean distance used" ); distance = new NICE::EuclidianDistance(); } return distance; } }; } //namespace #endif