diff --git a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h index 915c55b79b8..790ea37067d 100644 --- a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h +++ b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h @@ -236,7 +236,7 @@ namespace pcl private: /** \brief A pointer to the spatial search object */ - SearcherPtr searcher_; + SearcherPtr searcher_{nullptr}; /** \brief The condition function that needs to hold for clustering */ std::function condition_function_; @@ -248,16 +248,16 @@ namespace pcl int min_cluster_size_{1}; /** \brief The maximum cluster size (default = unlimited) */ - int max_cluster_size_; + int max_cluster_size_{0}; /** \brief Set to true if you want to be able to extract the clusters that are too large or too small (default = false) */ - bool extract_removed_clusters_; + bool extract_removed_clusters_{false}; /** \brief The resultant clusters that contain less than min_cluster_size points */ - pcl::IndicesClustersPtr small_clusters_; + pcl::IndicesClustersPtr small_clusters_{nullptr}; /** \brief The resultant clusters that contain more than max_cluster_size points */ - pcl::IndicesClustersPtr large_clusters_; + pcl::IndicesClustersPtr large_clusters_{nullptr}; public: PCL_MAKE_ALIGNED_OPERATOR_NEW diff --git a/segmentation/include/pcl/segmentation/cpc_segmentation.h b/segmentation/include/pcl/segmentation/cpc_segmentation.h index 0775d64a921..897070e3522 100644 --- a/segmentation/include/pcl/segmentation/cpc_segmentation.h +++ b/segmentation/include/pcl/segmentation/cpc_segmentation.h @@ -153,7 +153,7 @@ namespace pcl bool use_directed_weights_{true}; /** \brief Use clean cutting */ - bool use_clean_cutting_; + bool use_clean_cutting_{false}; /** \brief Iterations for RANSAC */ std::uint32_t ransac_itrs_{10000}; diff --git a/segmentation/include/pcl/segmentation/extract_clusters.h b/segmentation/include/pcl/segmentation/extract_clusters.h index 535e8865f20..d7e9bb3c8e8 100644 --- a/segmentation/include/pcl/segmentation/extract_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_clusters.h @@ -425,13 +425,13 @@ namespace pcl KdTreePtr tree_; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ - double cluster_tolerance_{0}; + double cluster_tolerance_{0.0}; /** \brief The minimum number of points that a cluster needs to contain in order to be considered valid (default = 1). */ pcl::uindex_t min_pts_per_cluster_{1}; /** \brief The maximum number of points that a cluster needs to contain in order to be considered valid (default = MAXINT). */ - pcl::uindex_t max_pts_per_cluster_; + pcl::uindex_t max_pts_per_cluster_{0}; /** \brief Class getName method. */ virtual std::string getClassName () const { return ("EuclideanClusterExtraction"); } diff --git a/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h b/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h index 3c6d3415804..a6ec6cb7c4f 100644 --- a/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h +++ b/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h @@ -185,7 +185,7 @@ namespace pcl protected: /** \brief A pointer to the input planar hull dataset. */ - PointCloudConstPtr planar_hull_; + PointCloudConstPtr planar_hull_{nullptr}; /** \brief The minimum number of points needed on the convex hull. */ int min_pts_hull_{3}; @@ -193,12 +193,12 @@ namespace pcl /** \brief The minimum allowed height (distance to the model) a point * will be considered from. */ - double height_limit_min_{0}; + double height_limit_min_{0.0}; /** \brief The maximum allowed height (distance to the model) a point * will be considered from. */ - double height_limit_max_; + double height_limit_max_{0.0}; /** \brief Values describing the data acquisition viewpoint. Default: 0,0,0. */ float vpx_{0}, vpy_{0}, vpz_{0}; diff --git a/segmentation/include/pcl/segmentation/grabcut_segmentation.h b/segmentation/include/pcl/segmentation/grabcut_segmentation.h index 00512e6cc9b..d17cbd5d8b6 100644 --- a/segmentation/include/pcl/segmentation/grabcut_segmentation.h +++ b/segmentation/include/pcl/segmentation/grabcut_segmentation.h @@ -259,9 +259,8 @@ namespace pcl GaussianFitter (float epsilon = 0.0001) : sum_ (Eigen::Vector3f::Zero ()) , accumulator_ (Eigen::Matrix3f::Zero ()) - , - epsilon_ (epsilon) - { } + , epsilon_ (epsilon) + {} /// Add a color sample void @@ -281,13 +280,13 @@ namespace pcl private: /// sum of r,g, and b - Eigen::Vector3f sum_; + Eigen::Vector3f sum_{}; /// matrix of products (i.e. r*r, r*g, r*b), some values are duplicated. - Eigen::Matrix3f accumulator_; + Eigen::Matrix3f accumulator_{}; /// count of color samples added to the gaussian std::uint32_t count_{0}; /// small value to add to covariance matrix diagonal to avoid singular values - float epsilon_; + float epsilon_{0.0f}; PCL_MAKE_ALIGNED_OPERATOR_NEW }; diff --git a/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp index 5ea8225dcfd..af52c822846 100644 --- a/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp @@ -48,9 +48,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template pcl::MinCutSegmentation::MinCutSegmentation () : - search_ (), - foreground_points_ (0), background_points_ (0), clusters_ (0), diff --git a/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp b/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp index e71703cc675..2c240d37c46 100644 --- a/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp +++ b/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp @@ -50,7 +50,6 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template pcl::RegionGrowingRGB::RegionGrowingRGB () : - point_distances_ (0), segment_neighbours_ (0), segment_distances_ (0), diff --git a/segmentation/include/pcl/segmentation/min_cut_segmentation.h b/segmentation/include/pcl/segmentation/min_cut_segmentation.h index 5d559bf6dfe..0e56705ff52 100644 --- a/segmentation/include/pcl/segmentation/min_cut_segmentation.h +++ b/segmentation/include/pcl/segmentation/min_cut_segmentation.h @@ -279,7 +279,7 @@ namespace pcl double source_weight_{0.8}; /** \brief Stores the search method that will be used for finding K nearest neighbors. Neighbours are used for building the graph. */ - KdTreePtr search_; + KdTreePtr search_{nullptr}; /** \brief Stores the number of neighbors to find. */ unsigned int number_of_neighbours_{14}; @@ -288,28 +288,28 @@ namespace pcl bool graph_is_valid_{false}; /** \brief Stores the points that are known to be in the foreground. */ - std::vector > foreground_points_; + std::vector > foreground_points_{}; /** \brief Stores the points that are known to be in the background. */ - std::vector > background_points_; + std::vector > background_points_{}; /** \brief After the segmentation it will contain the segments. */ - std::vector clusters_; + std::vector clusters_{}; /** \brief Stores the graph for finding the maximum flow. */ - mGraphPtr graph_; + mGraphPtr graph_{nullptr}; /** \brief Stores the capacity of every edge in the graph. */ - std::shared_ptr capacity_; + std::shared_ptr capacity_{nullptr}; /** \brief Stores reverse edges for every edge in the graph. */ - std::shared_ptr reverse_edges_; + std::shared_ptr reverse_edges_{nullptr}; /** \brief Stores the vertices of the graph. */ - std::vector< VertexDescriptor > vertices_; + std::vector< VertexDescriptor > vertices_{}; /** \brief Stores the information about the edges that were added to the graph. It is used to avoid the duplicate edges. */ - std::vector< std::set > edge_marker_; + std::vector< std::set > edge_marker_{}; /** \brief Stores the vertex that serves as source. */ VertexDescriptor source_{}; diff --git a/segmentation/include/pcl/segmentation/region_growing.h b/segmentation/include/pcl/segmentation/region_growing.h index 4a305505055..729c3a4db93 100644 --- a/segmentation/include/pcl/segmentation/region_growing.h +++ b/segmentation/include/pcl/segmentation/region_growing.h @@ -282,7 +282,7 @@ namespace pcl pcl::uindex_t min_pts_per_cluster_{1}; /** \brief Stores the maximum number of points that a cluster needs to contain in order to be considered valid. */ - pcl::uindex_t max_pts_per_cluster_; + pcl::uindex_t max_pts_per_cluster_{0}; /** \brief Flag that signalizes if the smoothness constraint will be used. */ bool smooth_mode_flag_{true}; @@ -294,7 +294,7 @@ namespace pcl bool residual_flag_{false}; /** \brief Threshold used for testing the smoothness between points. */ - float theta_threshold_; + float theta_threshold_{0.0f}; /** \brief Threshold used in residual test. */ float residual_threshold_{0.05f}; @@ -306,10 +306,10 @@ namespace pcl unsigned int neighbour_number_{30}; /** \brief Search method that will be used for KNN. */ - KdTreePtr search_; + KdTreePtr search_{nullptr}; /** \brief Contains normals of the points that will be segmented. */ - NormalPtr normals_; + NormalPtr normals_{nullptr}; /** \brief Contains neighbours of each point. */ std::vector point_neighbours_; diff --git a/segmentation/include/pcl/segmentation/sac_segmentation.h b/segmentation/include/pcl/segmentation/sac_segmentation.h index 0cbc6ec1eee..aed3a10154f 100644 --- a/segmentation/include/pcl/segmentation/sac_segmentation.h +++ b/segmentation/include/pcl/segmentation/sac_segmentation.h @@ -81,20 +81,15 @@ namespace pcl /** \brief Empty constructor. * \param[in] random if true set the random seed to the current time, else set to 12345 (default: false) */ - SACSegmentation (bool random = false) - : model_ () - , sac_ () - , - radius_min_ (-std::numeric_limits::max ()) - , radius_max_ (std::numeric_limits::max ()) - , - samples_radius_search_ () - , - axis_ (Eigen::Vector3f::Zero ()) - , - random_ (random) - { - } + SACSegmentation(bool random = false) + : model_() + , sac_() + , radius_min_(-std::numeric_limits::max()) + , radius_max_(std::numeric_limits::max()) + , samples_radius_search_() + , axis_(Eigen::Vector3f::Zero()) + , random_(random) + {} /** \brief Empty destructor. */ ~SACSegmentation () override = default; @@ -259,10 +254,10 @@ namespace pcl initSAC (const int method_type); /** \brief The model that needs to be segmented. */ - SampleConsensusModelPtr model_; + SampleConsensusModelPtr model_{nullptr}; /** \brief The sample consensus segmentation method. */ - SampleConsensusPtr sac_; + SampleConsensusPtr sac_{nullptr}; /** \brief The type of model to use (user given parameter). */ int model_type_{-1}; @@ -277,19 +272,19 @@ namespace pcl bool optimize_coefficients_{true}; /** \brief The minimum and maximum radius limits for the model. Applicable to all models that estimate a radius. */ - double radius_min_, radius_max_; + double radius_min_{0.0}, radius_max_{0.0}; /** \brief The maximum distance of subsequent samples from the first (radius search) */ double samples_radius_{0.0}; /** \brief The search object for picking subsequent samples using radius search */ - SearchPtr samples_radius_search_; + SearchPtr samples_radius_search_{nullptr}; /** \brief The maximum allowed difference between the model normal and the given axis. */ double eps_angle_{0.0}; /** \brief The axis along which we need to search for a model perpendicular to. */ - Eigen::Vector3f axis_; + Eigen::Vector3f axis_{}; /** \brief Maximum number of iterations before giving up (user given parameter). */ int max_iterations_{50}; @@ -301,7 +296,7 @@ namespace pcl double probability_{0.99}; /** \brief Set to true if we need a random seed. */ - bool random_; + bool random_{false}; /** \brief Class get name method. */ virtual std::string