41 #include <visp3/core/vpConfig.h> 42 #include <visp3/visual_features/vpFeatureMoment.h> 43 #include <visp3/visual_features/vpFeatureMomentDatabase.h> 51 void vpFeatureMomentDatabase::add(
vpFeatureMoment &featureMoment,
char *name)
53 featureMomentsDataBase.insert(std::pair<const char *, vpFeatureMoment *>((
const char *)name, &featureMoment));
66 std::map<const char *, vpFeatureMoment *, vpFeatureMomentDatabase::cmp_str>::const_iterator it =
67 featureMomentsDataBase.find(type);
69 found = (it != featureMomentsDataBase.end());
82 std::map<const char *, vpFeatureMoment *, vpFeatureMomentDatabase::cmp_str>::const_iterator itr;
83 #ifdef VISP_HAVE_OPENMP 84 std::vector<vpFeatureMoment *> values;
85 values.reserve(featureMomentsDataBase.size());
86 for (itr = featureMomentsDataBase.begin(); itr != featureMomentsDataBase.end(); ++itr) {
87 values.push_back((*itr).second);
89 #pragma omp parallel for shared(A, B, C) 90 for (
int i = 0; i < (int)values.size(); i++) {
91 unsigned int i_ =
static_cast<unsigned int>(i);
92 values[i_]->update(A, B, C);
95 for (itr = featureMomentsDataBase.begin(); itr != featureMomentsDataBase.end(); ++itr) {
96 (*itr).second->update(A, B, C);
This class defines shared system methods/attributes for 2D moment features but no functional code...
virtual void updateAll(double A=0.0, double B=0.0, double C=1.0)
vpFeatureMoment & get(const char *type, bool &found)