36 #include <visp3/core/vpConfig.h>
37 #include <visp3/visual_features/vpFeatureMoment.h>
38 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
47 void vpFeatureMomentDatabase::add(
vpFeatureMoment &featureMoment,
const std::string &name)
49 featureMomentsDataBase.insert(std::pair<const std::string, vpFeatureMoment *>(name, &featureMoment));
62 std::map<const std::string, vpFeatureMoment *, vpFeatureMomentDatabase::vpCmpStr_t>::const_iterator it =
63 featureMomentsDataBase.find(feature_name);
65 found = (it != featureMomentsDataBase.end());
77 std::map<const std::string, vpFeatureMoment *, vpFeatureMomentDatabase::vpCmpStr_t>::const_iterator itr;
78 #ifdef VISP_HAVE_OPENMP
79 std::vector<vpFeatureMoment *> values;
80 values.reserve(featureMomentsDataBase.size());
81 for (itr = featureMomentsDataBase.begin(); itr != featureMomentsDataBase.end(); ++itr) {
82 values.push_back((*itr).second);
84 #pragma omp parallel for shared(A, B, C)
85 for (
int i = 0; i < (int)values.size(); i++) {
86 unsigned int i_ =
static_cast<unsigned int>(i);
87 values[i_]->update(A, B, C);
90 for (itr = featureMomentsDataBase.begin(); itr != featureMomentsDataBase.end(); ++itr) {
91 (*itr).second->update(A, B, C);
virtual void updateAll(double A=0.0, double B=0.0, double C=1.0)
vpFeatureMoment & get(const std::string &feature_name, bool &found)
This class defines shared system methods/attributes for 2D moment features but no functional code....