From f7b8625e1d16034451e85cd2c62a4b25b6129bef Mon Sep 17 00:00:00 2001 From: Stefan Holzer Date: Tue, 18 Dec 2012 17:46:03 +0000 Subject: [PATCH] fixed stuff again git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@8286 a9d63959-f2ad-4865-b262-bf0e56cfafb6 --- .../pcl/ml/impl/dt/decision_tree_trainer.hpp | 9 ++++++--- ...ulti_channel_2d_comparison_feature_handler.h | 3 +++ ml/include/pcl/ml/multi_channel_2d_data_set.h | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ml/include/pcl/ml/impl/dt/decision_tree_trainer.hpp b/ml/include/pcl/ml/impl/dt/decision_tree_trainer.hpp index 810d72f0100..d27dbf4bd4f 100644 --- a/ml/include/pcl/ml/impl/dt/decision_tree_trainer.hpp +++ b/ml/include/pcl/ml/impl/dt/decision_tree_trainer.hpp @@ -49,6 +49,7 @@ pcl::DecisionTreeTrainergetDatasetAndLabels (data_set_, label_data_, examples_); trainDecisionTreeNode (features, examples_, label_data_, max_tree_depth_, tree.getRoot ()); label_data_.clear (); @@ -105,7 +108,7 @@ pcl::DecisionTreeTrainercomputeAndSetNodeStats (data_set_, examples, label_data, node); diff --git a/ml/include/pcl/ml/multi_channel_2d_comparison_feature_handler.h b/ml/include/pcl/ml/multi_channel_2d_comparison_feature_handler.h index d64601e84fe..7650ab13a4d 100644 --- a/ml/include/pcl/ml/multi_channel_2d_comparison_feature_handler.h +++ b/ml/include/pcl/ml/multi_channel_2d_comparison_feature_handler.h @@ -279,6 +279,9 @@ namespace pcl else scale = static_cast (data_set (example.data_set_id, center_col_index, center_row_index)[SCALE_CHANNEL]); + + + const size_t p1_col = static_cast (scale * feature.p1.x + center_col_index); const size_t p1_row = static_cast (scale * feature.p1.y + center_row_index); diff --git a/ml/include/pcl/ml/multi_channel_2d_data_set.h b/ml/include/pcl/ml/multi_channel_2d_data_set.h index f0f61f4f757..99e6d094d13 100644 --- a/ml/include/pcl/ml/multi_channel_2d_data_set.h +++ b/ml/include/pcl/ml/multi_channel_2d_data_set.h @@ -68,6 +68,16 @@ namespace pcl width_ = width; height_ = height; } + + /** \brief Clears the internal data storage and sets width and height to 0. + */ + void + clear () + { + width_ = 0; + height_ = 0; + data_.clear (); + } /** \brief Returns a pointer to the internal data at the specified location. * \param[in] col_index The column index. @@ -157,6 +167,13 @@ namespace pcl } } + /** \brief Releases the data stored in the data set. */ + void + clear () + { + releaseDataSet (); + } + /** \brief Returns a pointer to the specified data block at the specified location. * \param[in] data_set_id The index of the data block. * \param[in] col The column of the desired location.