36 #include <visp3/core/vpConfig.h>
37 #include <visp3/visual_features/vpFeatureMoment.h>
38 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
46 void vpFeatureMomentDatabase::add(
vpFeatureMoment &featureMoment,
const std::string &name)
48 featureMomentsDataBase.insert(std::pair<const std::string, vpFeatureMoment *>(name, &featureMoment));
61 std::map<const std::string, vpFeatureMoment *, vpFeatureMomentDatabase::vpCmpStr_t>::const_iterator it =
62 featureMomentsDataBase.find(feature_name);
64 found = (it != featureMomentsDataBase.end());
76 std::map<const std::string, vpFeatureMoment *, vpFeatureMomentDatabase::vpCmpStr_t>::const_iterator itr;
77 #ifdef VISP_HAVE_OPENMP
78 std::vector<vpFeatureMoment *> values;
79 values.reserve(featureMomentsDataBase.size());
80 for (itr = featureMomentsDataBase.begin(); itr != featureMomentsDataBase.end(); ++itr) {
81 values.push_back((*itr).second);
83 #pragma omp parallel for shared(A, B, C)
84 for (
int i = 0; i < (int)values.size(); i++) {
85 unsigned int i_ =
static_cast<unsigned int>(i);
86 values[i_]->update(A, B, C);
89 for (itr = featureMomentsDataBase.begin(); itr != featureMomentsDataBase.end(); ++itr) {
90 (*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....