From 6cebc64012c58f364bb1feb76553393bc9b1c235 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Fri, 27 Oct 2023 09:10:51 -0700 Subject: [PATCH 1/9] Part G of transition to support modernize-use-default-member-init --- .../include/pcl/registration/impl/ndt.hpp | 2 +- ...oximate_progressive_morphological_filter.h | 16 +++--- .../conditional_euclidean_clustering.h | 7 ++- .../pcl/segmentation/cpc_segmentation.h | 12 ++--- .../pcl/segmentation/extract_clusters.h | 7 ++- .../segmentation/extract_labeled_clusters.h | 9 ++-- .../extract_polygonal_prism_data.h | 12 ++--- .../pcl/segmentation/grabcut_segmentation.h | 24 ++++----- ...imate_progressive_morphological_filter.hpp | 12 +---- .../segmentation/impl/cpc_segmentation.hpp | 10 +--- .../segmentation/impl/lccp_segmentation.hpp | 14 +---- .../impl/min_cut_segmentation.hpp | 16 ++---- .../impl/progressive_morphological_filter.hpp | 11 +--- .../pcl/segmentation/impl/region_growing.hpp | 30 ++++------- .../segmentation/impl/region_growing_rgb.hpp | 5 +- .../impl/supervoxel_clustering.hpp | 19 +++---- .../segmentation/impl/unary_classifier.hpp | 11 ++-- .../pcl/segmentation/lccp_segmentation.h | 33 ++++++------ .../pcl/segmentation/min_cut_segmentation.h | 22 ++++---- .../organized_multi_plane_segmentation.h | 14 +++-- .../progressive_morphological_filter.h | 14 ++--- .../include/pcl/segmentation/region_growing.h | 18 +++---- .../pcl/segmentation/region_growing_rgb.h | 8 +-- .../pcl/segmentation/sac_segmentation.h | 52 ++++++++----------- .../segmentation/seeded_hue_segmentation.h | 6 +-- .../pcl/segmentation/segment_differences.h | 4 +- .../pcl/segmentation/supervoxel_clustering.h | 18 +++---- .../pcl/segmentation/unary_classifier.h | 8 +-- segmentation/src/grabcut_segmentation.cpp | 1 - .../pcl/stereo/digital_elevation_map.h | 6 +-- .../pcl/stereo/disparity_map_converter.h | 16 +++--- .../stereo/impl/disparity_map_converter.hpp | 11 +--- stereo/src/digital_elevation_map.cpp | 4 +- tools/obj_rec_ransac_accepted_hypotheses.cpp | 7 ++- tools/octree_viewer.cpp | 13 ++--- tools/openni_image.cpp | 3 +- tools/openni_viewer.cpp | 14 +++-- tools/ply2obj.cpp | 14 ++--- tools/ply2ply.cpp | 12 ++--- tools/ply2raw.cpp | 17 +++--- 40 files changed, 205 insertions(+), 327 deletions(-) diff --git a/registration/include/pcl/registration/impl/ndt.hpp b/registration/include/pcl/registration/impl/ndt.hpp index e3192073d68..15ac5d68e4b 100644 --- a/registration/include/pcl/registration/impl/ndt.hpp +++ b/registration/include/pcl/registration/impl/ndt.hpp @@ -46,7 +46,7 @@ namespace pcl { template NormalDistributionsTransform:: NormalDistributionsTransform() -: target_cells_(), trans_likelihood_() +: target_cells_() { reg_name_ = "NormalDistributionsTransform"; diff --git a/segmentation/include/pcl/segmentation/approximate_progressive_morphological_filter.h b/segmentation/include/pcl/segmentation/approximate_progressive_morphological_filter.h index bc99e831d48..77bf58926f5 100644 --- a/segmentation/include/pcl/segmentation/approximate_progressive_morphological_filter.h +++ b/segmentation/include/pcl/segmentation/approximate_progressive_morphological_filter.h @@ -144,28 +144,28 @@ namespace pcl protected: /** \brief Maximum window size to be used in filtering ground returns. */ - int max_window_size_; + int max_window_size_{33}; /** \brief Slope value to be used in computing the height threshold. */ - float slope_; + float slope_{0.7f}; /** \brief Maximum height above the parameterized ground surface to be considered a ground return. */ - float max_distance_; + float max_distance_{10.0f}; /** \brief Initial height above the parameterized ground surface to be considered a ground return. */ - float initial_distance_; + float initial_distance_{0.15f}; /** \brief Cell size. */ - float cell_size_; + float cell_size_{1.0f}; /** \brief Base to be used in computing progressive window sizes. */ - float base_; + float base_{2.0f}; /** \brief Exponentially grow window sizes? */ - bool exponential_; + bool exponential_{true}; /** \brief Number of threads to be used. */ - unsigned int threads_; + unsigned int threads_{0}; }; } diff --git a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h index dd7157867f3..915c55b79b8 100644 --- a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h +++ b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h @@ -99,8 +99,7 @@ namespace pcl ConditionalEuclideanClustering (bool extract_removed_clusters = false) : searcher_ (), condition_function_ (), - cluster_tolerance_ (0.0f), - min_cluster_size_ (1), + max_cluster_size_ (std::numeric_limits::max ()), extract_removed_clusters_ (extract_removed_clusters), small_clusters_ (new pcl::IndicesClusters), @@ -243,10 +242,10 @@ namespace pcl std::function condition_function_; /** \brief The distance to scan for cluster candidates (default = 0.0) */ - float cluster_tolerance_; + float cluster_tolerance_{0.0f}; /** \brief The minimum cluster size (default = 1) */ - int min_cluster_size_; + int min_cluster_size_{1}; /** \brief The maximum cluster size (default = unlimited) */ int max_cluster_size_; diff --git a/segmentation/include/pcl/segmentation/cpc_segmentation.h b/segmentation/include/pcl/segmentation/cpc_segmentation.h index cb665b0b7f4..0775d64a921 100644 --- a/segmentation/include/pcl/segmentation/cpc_segmentation.h +++ b/segmentation/include/pcl/segmentation/cpc_segmentation.h @@ -138,25 +138,25 @@ namespace pcl /// *** Parameters *** /// /** \brief Maximum number of cuts */ - std::uint32_t max_cuts_; + std::uint32_t max_cuts_{20}; /** \brief Minimum segment size for cutting */ - std::uint32_t min_segment_size_for_cutting_; + std::uint32_t min_segment_size_for_cutting_{400}; /** \brief Cut_score threshold */ - float min_cut_score_; + float min_cut_score_{0.16}; /** \brief Use local constrains for cutting */ - bool use_local_constrains_; + bool use_local_constrains_{true}; /** \brief Use directed weights for the cutting */ - bool use_directed_weights_; + bool use_directed_weights_{true}; /** \brief Use clean cutting */ bool use_clean_cutting_; /** \brief Iterations for RANSAC */ - std::uint32_t ransac_itrs_; + std::uint32_t ransac_itrs_{10000}; /******************************************* Directional weighted RANSAC declarations ******************************************************************/ diff --git a/segmentation/include/pcl/segmentation/extract_clusters.h b/segmentation/include/pcl/segmentation/extract_clusters.h index b62b93cb8bf..535e8865f20 100644 --- a/segmentation/include/pcl/segmentation/extract_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_clusters.h @@ -338,8 +338,7 @@ namespace pcl ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief Empty constructor. */ EuclideanClusterExtraction () : tree_ (), - cluster_tolerance_ (0), - min_pts_per_cluster_ (1), + max_pts_per_cluster_ (std::numeric_limits::max ()) {}; @@ -426,10 +425,10 @@ namespace pcl KdTreePtr tree_; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ - double cluster_tolerance_; + double cluster_tolerance_{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_; + 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_; diff --git a/segmentation/include/pcl/segmentation/extract_labeled_clusters.h b/segmentation/include/pcl/segmentation/extract_labeled_clusters.h index d65beacad7d..feda32a4007 100644 --- a/segmentation/include/pcl/segmentation/extract_labeled_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_labeled_clusters.h @@ -117,9 +117,8 @@ class LabeledEuclideanClusterExtraction : public PCLBase { /** \brief Empty constructor. */ LabeledEuclideanClusterExtraction() : tree_() - , cluster_tolerance_(0) - , min_pts_per_cluster_(1) - , max_pts_per_cluster_(std::numeric_limits::max()) + , + max_pts_per_cluster_(std::numeric_limits::max()) , max_label_(std::numeric_limits::max()){}; /** \brief Provide a pointer to the search object. @@ -225,11 +224,11 @@ class LabeledEuclideanClusterExtraction : public PCLBase { KdTreePtr tree_; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ - double cluster_tolerance_; + double cluster_tolerance_{0}; /** \brief The minimum number of points that a cluster needs to contain in order to be * considered valid (default = 1). */ - int min_pts_per_cluster_; + int 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). */ diff --git a/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h b/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h index c35e28dbe94..3c6d3415804 100644 --- a/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h +++ b/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h @@ -115,10 +115,8 @@ namespace pcl using PointIndicesConstPtr = PointIndices::ConstPtr; /** \brief Empty constructor. */ - ExtractPolygonalPrismData () : planar_hull_ (), min_pts_hull_ (3), - height_limit_min_ (0), - height_limit_max_(std::numeric_limits::max()), - vpx_ (0), vpy_ (0), vpz_ (0) + ExtractPolygonalPrismData () : planar_hull_ (), + height_limit_max_(std::numeric_limits::max()) {}; /** \brief Provide a pointer to the input planar hull dataset. @@ -190,12 +188,12 @@ namespace pcl PointCloudConstPtr planar_hull_; /** \brief The minimum number of points needed on the convex hull. */ - int min_pts_hull_; + int min_pts_hull_{3}; /** \brief The minimum allowed height (distance to the model) a point * will be considered from. */ - double height_limit_min_; + double height_limit_min_{0}; /** \brief The maximum allowed height (distance to the model) a point * will be considered from. @@ -203,7 +201,7 @@ namespace pcl double height_limit_max_; /** \brief Values describing the data acquisition viewpoint. Default: 0,0,0. */ - float vpx_, vpy_, vpz_; + float vpx_{0}, vpy_{0}, vpz_{0}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/grabcut_segmentation.h b/segmentation/include/pcl/segmentation/grabcut_segmentation.h index 6734b46b12e..00512e6cc9b 100644 --- a/segmentation/include/pcl/segmentation/grabcut_segmentation.h +++ b/segmentation/include/pcl/segmentation/grabcut_segmentation.h @@ -157,7 +157,7 @@ namespace pcl /// nodes and their outgoing internal edges std::vector nodes_; /// current flow value (includes constant) - double flow_value_; + double flow_value_{0.0}; /// identifies which side of the cut a node falls std::vector cut_; @@ -259,8 +259,8 @@ namespace pcl GaussianFitter (float epsilon = 0.0001) : sum_ (Eigen::Vector3f::Zero ()) , accumulator_ (Eigen::Matrix3f::Zero ()) - , count_ (0) - , epsilon_ (epsilon) + , + epsilon_ (epsilon) { } /// Add a color sample @@ -285,7 +285,7 @@ namespace pcl /// matrix of products (i.e. r*r, r*g, r*b), some values are duplicated. Eigen::Matrix3f accumulator_; /// count of color samples added to the gaussian - std::uint32_t count_; + std::uint32_t count_{0}; /// small value to add to covariance matrix diagonal to avoid singular values float epsilon_; PCL_MAKE_ALIGNED_OPERATOR_NEW @@ -329,12 +329,8 @@ namespace pcl using PCLBase::fake_indices_; /// Constructor - GrabCut (std::uint32_t K = 5, float lambda = 50.f) - : K_ (K) - , lambda_ (lambda) - , nb_neighbours_ (9) - , initialized_ (false) - {} + GrabCut(std::uint32_t K = 5, float lambda = 50.f) : K_(K), lambda_(lambda) {} + /// Destructor ~GrabCut () override = default; // /// Set input cloud @@ -399,9 +395,9 @@ namespace pcl // Storage for N-link weights, each pixel stores links to nb_neighbours struct NLinks { - NLinks () : nb_links (0), indices (0), dists (0), weights (0) {} + NLinks () : indices (0), dists (0), weights (0) {} - int nb_links; + int nb_links{0}; Indices indices; std::vector dists; std::vector weights; @@ -460,9 +456,9 @@ namespace pcl /// Pointer to the spatial search object. KdTreePtr tree_; /// Number of neighbours - int nb_neighbours_; + int nb_neighbours_{9}; /// is segmentation initialized - bool initialized_; + bool initialized_{false}; /// Precomputed N-link weights std::vector n_links_; /// Converted input diff --git a/segmentation/include/pcl/segmentation/impl/approximate_progressive_morphological_filter.hpp b/segmentation/include/pcl/segmentation/impl/approximate_progressive_morphological_filter.hpp index 4a98b2e33bf..8a054c54c1d 100644 --- a/segmentation/include/pcl/segmentation/impl/approximate_progressive_morphological_filter.hpp +++ b/segmentation/include/pcl/segmentation/impl/approximate_progressive_morphological_filter.hpp @@ -49,17 +49,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::ApproximateProgressiveMorphologicalFilter::ApproximateProgressiveMorphologicalFilter () : - max_window_size_ (33), - slope_ (0.7f), - max_distance_ (10.0f), - initial_distance_ (0.15f), - cell_size_ (1.0f), - base_ (2.0f), - exponential_ (true), - threads_ (0) -{ -} +pcl::ApproximateProgressiveMorphologicalFilter::ApproximateProgressiveMorphologicalFilter () = default; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp index 05e8ff94214..f1aca882eca 100644 --- a/segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp @@ -42,15 +42,7 @@ #include template -pcl::CPCSegmentation::CPCSegmentation () : - max_cuts_ (20), - min_segment_size_for_cutting_ (400), - min_cut_score_ (0.16), - use_local_constrains_ (true), - use_directed_weights_ (true), - ransac_itrs_ (10000) -{ -} +pcl::CPCSegmentation::CPCSegmentation () = default; template pcl::CPCSegmentation::~CPCSegmentation () = default; diff --git a/segmentation/include/pcl/segmentation/impl/lccp_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/lccp_segmentation.hpp index 3bf0777282f..8f1f6033670 100644 --- a/segmentation/include/pcl/segmentation/impl/lccp_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/lccp_segmentation.hpp @@ -51,19 +51,7 @@ template -pcl::LCCPSegmentation::LCCPSegmentation () : - concavity_tolerance_threshold_ (10), - grouping_data_valid_ (false), - supervoxels_set_ (false), - use_smoothness_check_ (false), - smoothness_threshold_ (0.1), - use_sanity_check_ (false), - seed_resolution_ (0), - voxel_resolution_ (0), - k_factor_ (0), - min_segment_size_ (0) -{ -} +pcl::LCCPSegmentation::LCCPSegmentation () = default; template pcl::LCCPSegmentation::~LCCPSegmentation () = default; diff --git a/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp index 0288a260497..5ea8225dcfd 100644 --- a/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp @@ -48,23 +48,15 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template pcl::MinCutSegmentation::MinCutSegmentation () : - inverse_sigma_ (16.0), - binary_potentials_are_valid_ (false), - epsilon_ (0.0001), - radius_ (16.0), - unary_potentials_are_valid_ (false), - source_weight_ (0.8), + search_ (), - number_of_neighbours_ (14), - graph_is_valid_ (false), + foreground_points_ (0), background_points_ (0), clusters_ (0), vertices_ (0), - edge_marker_ (0), - source_ (),///////////////////////////////// - sink_ (),/////////////////////////////////// - max_flow_ (0.0) + edge_marker_ (0) + /////////////////////////////////// { } diff --git a/segmentation/include/pcl/segmentation/impl/progressive_morphological_filter.hpp b/segmentation/include/pcl/segmentation/impl/progressive_morphological_filter.hpp index 1c1ee2e0148..68a3d3cd240 100644 --- a/segmentation/include/pcl/segmentation/impl/progressive_morphological_filter.hpp +++ b/segmentation/include/pcl/segmentation/impl/progressive_morphological_filter.hpp @@ -48,16 +48,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::ProgressiveMorphologicalFilter::ProgressiveMorphologicalFilter () : - max_window_size_ (33), - slope_ (0.7f), - max_distance_ (10.0f), - initial_distance_ (0.15f), - cell_size_ (1.0f), - base_ (2.0f), - exponential_ (true) -{ -} +pcl::ProgressiveMorphologicalFilter::ProgressiveMorphologicalFilter () = default; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/impl/region_growing.hpp b/segmentation/include/pcl/segmentation/impl/region_growing.hpp index be75d0cf7ba..90bf89478b3 100644 --- a/segmentation/include/pcl/segmentation/impl/region_growing.hpp +++ b/segmentation/include/pcl/segmentation/impl/region_growing.hpp @@ -54,26 +54,16 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::RegionGrowing::RegionGrowing () : - min_pts_per_cluster_ (1), - max_pts_per_cluster_ (std::numeric_limits::max ()), - smooth_mode_flag_ (true), - curvature_flag_ (true), - residual_flag_ (false), - theta_threshold_ (30.0f / 180.0f * static_cast (M_PI)), - residual_threshold_ (0.05f), - curvature_threshold_ (0.05f), - neighbour_number_ (30), - search_ (), - normals_ (), - point_neighbours_ (0), - point_labels_ (0), - normal_flag_ (true), - num_pts_in_segment_ (0), - clusters_ (0), - number_of_segments_ (0) -{ -} +pcl::RegionGrowing::RegionGrowing() +: max_pts_per_cluster_(std::numeric_limits::max()) +, theta_threshold_(30.0f / 180.0f * static_cast(M_PI)) +, search_() +, normals_() +, point_neighbours_(0) +, point_labels_(0) +, num_pts_in_segment_(0) +, clusters_(0) +{} ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp b/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp index b53a704b09c..e71703cc675 100644 --- a/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp +++ b/segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp @@ -50,10 +50,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template pcl::RegionGrowingRGB::RegionGrowingRGB () : - color_p2p_threshold_ (1225.0f), - color_r2r_threshold_ (10.0f), - distance_threshold_ (0.05f), - region_neighbour_number_ (100), + point_distances_ (0), segment_neighbours_ (0), segment_distances_ (0), diff --git a/segmentation/include/pcl/segmentation/impl/supervoxel_clustering.hpp b/segmentation/include/pcl/segmentation/impl/supervoxel_clustering.hpp index 54aed117bbe..9d627c600ff 100644 --- a/segmentation/include/pcl/segmentation/impl/supervoxel_clustering.hpp +++ b/segmentation/include/pcl/segmentation/impl/supervoxel_clustering.hpp @@ -45,17 +45,14 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::SupervoxelClustering::SupervoxelClustering (float voxel_resolution, float seed_resolution) : - resolution_ (voxel_resolution), - seed_resolution_ (seed_resolution), - adjacency_octree_ (), - voxel_centroid_cloud_ (), - color_importance_ (0.1f), - spatial_importance_ (0.4f), - normal_importance_ (1.0f), - use_default_transform_behaviour_ (true) -{ - adjacency_octree_.reset (new OctreeAdjacencyT (resolution_)); +pcl::SupervoxelClustering::SupervoxelClustering(float voxel_resolution, + float seed_resolution) +: resolution_(voxel_resolution) +, seed_resolution_(seed_resolution) +, adjacency_octree_() +, voxel_centroid_cloud_() +{ + adjacency_octree_.reset(new OctreeAdjacencyT(resolution_)); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp index 38f2cd59cda..75db2062ee0 100644 --- a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp +++ b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp @@ -52,14 +52,9 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::UnaryClassifier::UnaryClassifier () : - input_cloud_ (new pcl::PointCloud), - label_field_ (false), - normal_radius_search_ (0.01f), - fpfh_radius_search_ (0.05f), - feature_threshold_ (5.0) -{ -} +pcl::UnaryClassifier::UnaryClassifier() +: input_cloud_(new pcl::PointCloud) +{} ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/lccp_segmentation.h b/segmentation/include/pcl/segmentation/lccp_segmentation.h index ed04968159c..8e9a82c8802 100644 --- a/segmentation/include/pcl/segmentation/lccp_segmentation.h +++ b/segmentation/include/pcl/segmentation/lccp_segmentation.h @@ -60,21 +60,18 @@ namespace pcl struct EdgeProperties { /** \brief Describes the difference of normals of the two supervoxels being connected*/ - float normal_difference; + float normal_difference{0.0f}; /** \brief Describes if a connection is convex or concave*/ - bool is_convex; + bool is_convex{false}; /** \brief Describes if a connection is valid for the segment growing. Usually convex connections are and concave connection are not. Due to k-concavity a convex connection can be invalidated*/ - bool is_valid; + bool is_valid{false}; /** \brief Additional member used for the CPC algorithm. If edge has already induced a cut, it should be ignored for further cutting.*/ - bool used_for_cutting; + bool used_for_cutting{false}; - EdgeProperties () : - normal_difference (0), is_convex (false), is_valid (false), used_for_cutting (false) - { - } + EdgeProperties () = default; }; public: @@ -297,34 +294,34 @@ namespace pcl /// *** Parameters *** /// /** \brief Normal Threshold in degrees [0,180] used for merging */ - float concavity_tolerance_threshold_; + float concavity_tolerance_threshold_{10}; /** \brief Marks if valid grouping data (\ref sv_adjacency_list_, \ref sv_label_to_seg_label_map_, \ref processed_) is available */ - bool grouping_data_valid_; + bool grouping_data_valid_{false}; /** \brief Marks if supervoxels have been set by calling \ref setInputSupervoxels */ - bool supervoxels_set_; + bool supervoxels_set_{false}; /** \brief Determines if the smoothness check is used during segmentation*/ - bool use_smoothness_check_; + bool use_smoothness_check_{false}; /** \brief Two supervoxels are unsmooth if their plane-to-plane distance DIST > (expected_distance + smoothness_threshold_*voxel_resolution_). For parallel supervoxels, the expected_distance is zero. */ - float smoothness_threshold_; + float smoothness_threshold_{0.1}; /** \brief Determines if we use the sanity check which tries to find and invalidate singular connected patches*/ - bool use_sanity_check_; + bool use_sanity_check_{false}; /** \brief Seed resolution of the supervoxels (used only for smoothness check) */ - float seed_resolution_; + float seed_resolution_{0}; /** \brief Voxel resolution used to build the supervoxels (used only for smoothness check)*/ - float voxel_resolution_; + float voxel_resolution_{0}; /** \brief Factor used for k-convexity */ - std::uint32_t k_factor_; + std::uint32_t k_factor_{0}; /** \brief Minimum segment size */ - std::uint32_t min_segment_size_; + std::uint32_t min_segment_size_{0}; /** \brief Stores which supervoxel labels were already visited during recursive grouping. * \note processed_[sv_Label] = false (default)/true (already processed) */ diff --git a/segmentation/include/pcl/segmentation/min_cut_segmentation.h b/segmentation/include/pcl/segmentation/min_cut_segmentation.h index 3059f9e517e..5d559bf6dfe 100644 --- a/segmentation/include/pcl/segmentation/min_cut_segmentation.h +++ b/segmentation/include/pcl/segmentation/min_cut_segmentation.h @@ -261,31 +261,31 @@ namespace pcl protected: /** \brief Stores the sigma coefficient. It is used for finding smooth costs. More information can be found in the article. */ - double inverse_sigma_; + double inverse_sigma_{16.0}; /** \brief Signalizes if the binary potentials are valid. */ - bool binary_potentials_are_valid_; + bool binary_potentials_are_valid_{false}; /** \brief Used for comparison of the floating point numbers. */ - double epsilon_; + double epsilon_{0.0001}; /** \brief Stores the distance to the background. */ - double radius_; + double radius_{16.0}; /** \brief Signalizes if the unary potentials are valid. */ - bool unary_potentials_are_valid_; + bool unary_potentials_are_valid_{false}; /** \brief Stores the weight for every edge that comes from source point. */ - double source_weight_; + 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_; /** \brief Stores the number of neighbors to find. */ - unsigned int number_of_neighbours_; + unsigned int number_of_neighbours_{14}; /** \brief Signalizes if the graph is valid. */ - bool graph_is_valid_; + bool graph_is_valid_{false}; /** \brief Stores the points that are known to be in the foreground. */ std::vector > foreground_points_; @@ -312,13 +312,13 @@ namespace pcl std::vector< std::set > edge_marker_; /** \brief Stores the vertex that serves as source. */ - VertexDescriptor source_; + VertexDescriptor source_{}; /** \brief Stores the vertex that serves as sink. */ - VertexDescriptor sink_; + VertexDescriptor sink_{}; /** \brief Stores the maximum flow value that was calculated during the segmentation. */ - double max_flow_; + double max_flow_{0.0}; public: PCL_MAKE_ALIGNED_OPERATOR_NEW diff --git a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h index 462e5e1fa95..a71efc233c4 100644 --- a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h +++ b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h @@ -91,11 +91,9 @@ namespace pcl /** \brief Constructor for OrganizedMultiPlaneSegmentation. */ OrganizedMultiPlaneSegmentation () : normals_ (), - min_inliers_ (1000), + angular_threshold_ (pcl::deg2rad (3.0)), - distance_threshold_ (0.02), - maximum_curvature_ (0.001), - project_points_ (false), + compare_ (new PlaneComparator ()), refinement_compare_ (new PlaneRefinementComparator ()) { } @@ -282,19 +280,19 @@ namespace pcl PointCloudNConstPtr normals_; /** \brief The minimum number of inliers required for each plane. */ - unsigned min_inliers_; + unsigned min_inliers_{1000}; /** \brief The tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */ double angular_threshold_; /** \brief The tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane. */ - double distance_threshold_; + double distance_threshold_{0.02}; /** \brief The tolerance for maximum curvature after fitting a plane. Used to remove smooth, but non-planar regions. */ - double maximum_curvature_; + double maximum_curvature_{0.001}; /** \brief Whether or not points should be projected to the plane, or left in the original 3D space. */ - bool project_points_; + bool project_points_{false}; /** \brief A comparator for comparing neighboring pixels' plane equations. */ PlaneComparatorPtr compare_; diff --git a/segmentation/include/pcl/segmentation/progressive_morphological_filter.h b/segmentation/include/pcl/segmentation/progressive_morphological_filter.h index f48f25a1282..894412fb03a 100644 --- a/segmentation/include/pcl/segmentation/progressive_morphological_filter.h +++ b/segmentation/include/pcl/segmentation/progressive_morphological_filter.h @@ -137,25 +137,25 @@ namespace pcl protected: /** \brief Maximum window size to be used in filtering ground returns. */ - int max_window_size_; + int max_window_size_{33}; /** \brief Slope value to be used in computing the height threshold. */ - float slope_; + float slope_{0.7f}; /** \brief Maximum height above the parameterized ground surface to be considered a ground return. */ - float max_distance_; + float max_distance_{10.0f}; /** \brief Initial height above the parameterized ground surface to be considered a ground return. */ - float initial_distance_; + float initial_distance_{0.15f}; /** \brief Cell size. */ - float cell_size_; + float cell_size_{1.0f}; /** \brief Base to be used in computing progressive window sizes. */ - float base_; + float base_{2.0f}; /** \brief Exponentially grow window sizes? */ - bool exponential_; + bool exponential_{true}; }; } diff --git a/segmentation/include/pcl/segmentation/region_growing.h b/segmentation/include/pcl/segmentation/region_growing.h index 30e6876637d..4a305505055 100644 --- a/segmentation/include/pcl/segmentation/region_growing.h +++ b/segmentation/include/pcl/segmentation/region_growing.h @@ -279,31 +279,31 @@ namespace pcl protected: /** \brief Stores the minimum number of points that a cluster needs to contain in order to be considered valid. */ - pcl::uindex_t min_pts_per_cluster_; + 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_; /** \brief Flag that signalizes if the smoothness constraint will be used. */ - bool smooth_mode_flag_; + bool smooth_mode_flag_{true}; /** \brief If set to true then curvature test will be done during segmentation. */ - bool curvature_flag_; + bool curvature_flag_{true}; /** \brief If set to true then residual test will be done during segmentation. */ - bool residual_flag_; + bool residual_flag_{false}; /** \brief Threshold used for testing the smoothness between points. */ float theta_threshold_; /** \brief Threshold used in residual test. */ - float residual_threshold_; + float residual_threshold_{0.05f}; /** \brief Threshold used in curvature test. */ - float curvature_threshold_; + float curvature_threshold_{0.05f}; /** \brief Number of neighbours to find. */ - unsigned int neighbour_number_; + unsigned int neighbour_number_{30}; /** \brief Search method that will be used for KNN. */ KdTreePtr search_; @@ -320,7 +320,7 @@ namespace pcl /** \brief If set to true then normal/smoothness test will be done during segmentation. * It is always set to true for the usual region growing algorithm. It is used for turning on/off the test * for smoothness in the child class RegionGrowingRGB.*/ - bool normal_flag_; + bool normal_flag_{true}; /** \brief Tells how much points each segment contains. Used for reserving memory. */ std::vector num_pts_in_segment_; @@ -329,7 +329,7 @@ namespace pcl std::vector clusters_; /** \brief Stores the number of segments. */ - int number_of_segments_; + int number_of_segments_{0}; public: PCL_MAKE_ALIGNED_OPERATOR_NEW diff --git a/segmentation/include/pcl/segmentation/region_growing_rgb.h b/segmentation/include/pcl/segmentation/region_growing_rgb.h index e409d80d69a..68670d379a8 100644 --- a/segmentation/include/pcl/segmentation/region_growing_rgb.h +++ b/segmentation/include/pcl/segmentation/region_growing_rgb.h @@ -252,16 +252,16 @@ namespace pcl protected: /** \brief Thershold used in color test for points. */ - float color_p2p_threshold_; + float color_p2p_threshold_{1225.0f}; /** \brief Thershold used in color test for regions. */ - float color_r2r_threshold_; + float color_r2r_threshold_{10.0f}; /** \brief Threshold that tells which points we need to assume neighbouring. */ - float distance_threshold_; + float distance_threshold_{0.05f}; /** \brief Number of neighbouring segments to find. */ - unsigned int region_neighbour_number_; + unsigned int region_neighbour_number_{100}; /** \brief Stores distances for the point neighbours from point_neighbours_ */ std::vector< std::vector > point_distances_; diff --git a/segmentation/include/pcl/segmentation/sac_segmentation.h b/segmentation/include/pcl/segmentation/sac_segmentation.h index aa3bdbf146d..0cbc6ec1eee 100644 --- a/segmentation/include/pcl/segmentation/sac_segmentation.h +++ b/segmentation/include/pcl/segmentation/sac_segmentation.h @@ -84,20 +84,15 @@ namespace pcl SACSegmentation (bool random = false) : model_ () , sac_ () - , model_type_ (-1) - , method_type_ (0) - , threshold_ (0) - , optimize_coefficients_ (true) - , radius_min_ (-std::numeric_limits::max ()) + , + radius_min_ (-std::numeric_limits::max ()) , radius_max_ (std::numeric_limits::max ()) - , samples_radius_ (0.0) - , samples_radius_search_ () - , eps_angle_ (0.0) - , axis_ (Eigen::Vector3f::Zero ()) - , max_iterations_ (50) - , threads_ (-1) - , probability_ (0.99) - , random_ (random) + , + samples_radius_search_ () + , + axis_ (Eigen::Vector3f::Zero ()) + , + random_ (random) { } @@ -270,40 +265,40 @@ namespace pcl SampleConsensusPtr sac_; /** \brief The type of model to use (user given parameter). */ - int model_type_; + int model_type_{-1}; /** \brief The type of sample consensus method to use (user given parameter). */ - int method_type_; + int method_type_{0}; /** \brief Distance to the model threshold (user given parameter). */ - double threshold_; + double threshold_{0}; /** \brief Set to true if a coefficient refinement is required. */ - bool optimize_coefficients_; + 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_; /** \brief The maximum distance of subsequent samples from the first (radius search) */ - double samples_radius_; + double samples_radius_{0.0}; /** \brief The search object for picking subsequent samples using radius search */ SearchPtr samples_radius_search_; /** \brief The maximum allowed difference between the model normal and the given axis. */ - double eps_angle_; + double eps_angle_{0.0}; /** \brief The axis along which we need to search for a model perpendicular to. */ Eigen::Vector3f axis_; /** \brief Maximum number of iterations before giving up (user given parameter). */ - int max_iterations_; + int max_iterations_{50}; /** \brief The number of threads the scheduler should use, or a negative number if no parallelization is wanted. */ - int threads_; + int threads_{-1}; /** \brief Desired probability of choosing at least one sample free from outliers (user given parameter). */ - double probability_; + double probability_{0.99}; /** \brief Set to true if we need a random seed. */ bool random_; @@ -350,10 +345,7 @@ namespace pcl SACSegmentationFromNormals (bool random = false) : SACSegmentation (random) , normals_ () - , distance_weight_ (0.1) - , distance_from_origin_ (0) - , min_angle_ (0.0) - , max_angle_ (M_PI_2) + {}; /** \brief Provide a pointer to the input dataset that contains the point normals of @@ -415,14 +407,14 @@ namespace pcl /** \brief The relative weight (between 0 and 1) to give to the angular * distance (0 to pi/2) between point normals and the plane normal. */ - double distance_weight_; + double distance_weight_{0.1}; /** \brief The distance from the template plane to the origin. */ - double distance_from_origin_; + double distance_from_origin_{0}; /** \brief The minimum and maximum allowed opening angle of valid cone model. */ - double min_angle_; - double max_angle_; + double min_angle_{0.0}; + double max_angle_{M_PI_2}; /** \brief Initialize the Sample Consensus model and set its parameters. * \param[in] model_type the type of SAC model that is to be used diff --git a/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h b/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h index 0a8826cea14..70dd50ec556 100644 --- a/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h +++ b/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h @@ -107,7 +107,7 @@ namespace pcl ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief Empty constructor. */ - SeededHueSegmentation () : cluster_tolerance_ (0), delta_hue_ (0.0) + SeededHueSegmentation () {}; /** \brief Provide a pointer to the search object. @@ -158,10 +158,10 @@ namespace pcl KdTreePtr tree_; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ - double cluster_tolerance_; + double cluster_tolerance_{0}; /** \brief The allowed difference on the hue*/ - float delta_hue_; + float delta_hue_{0.0}; /** \brief Class getName method. */ virtual std::string getClassName () const { return ("seededHueSegmentation"); } diff --git a/segmentation/include/pcl/segmentation/segment_differences.h b/segmentation/include/pcl/segmentation/segment_differences.h index 9b89cd2a033..0d68ad1fd95 100755 --- a/segmentation/include/pcl/segmentation/segment_differences.h +++ b/segmentation/include/pcl/segmentation/segment_differences.h @@ -86,7 +86,7 @@ namespace pcl /** \brief Empty constructor. */ SegmentDifferences () : - tree_ (), target_ (), distance_threshold_ (0) + tree_ (), target_ () {}; /** \brief Provide a pointer to the target dataset against which we @@ -147,7 +147,7 @@ namespace pcl /** \brief The distance tolerance (squared) as a measure in the L2 * Euclidean space between corresponding points. */ - double distance_threshold_; + double distance_threshold_{0}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/supervoxel_clustering.h b/segmentation/include/pcl/segmentation/supervoxel_clustering.h index e46239c50af..78cbf00ba9f 100644 --- a/segmentation/include/pcl/segmentation/supervoxel_clustering.h +++ b/segmentation/include/pcl/segmentation/supervoxel_clustering.h @@ -139,9 +139,7 @@ namespace pcl xyz_ (0.0f, 0.0f, 0.0f), rgb_ (0.0f, 0.0f, 0.0f), normal_ (0.0f, 0.0f, 0.0f, 0.0f), - curvature_ (0.0f), - distance_(0), - idx_(0), + owner_ (nullptr) {} @@ -160,9 +158,9 @@ namespace pcl Eigen::Vector3f xyz_; Eigen::Vector3f rgb_; Eigen::Vector4f normal_; - float curvature_; - float distance_; - int idx_; + float curvature_{0.0f}; + float distance_{0}; + int idx_{0}; SupervoxelHelper* owner_; public: @@ -373,11 +371,11 @@ namespace pcl typename NormalCloudT::ConstPtr input_normals_; /** \brief Importance of color in clustering */ - float color_importance_; + float color_importance_{0.1f}; /** \brief Importance of distance from seed center in clustering */ - float spatial_importance_; + float spatial_importance_{0.4f}; /** \brief Importance of similarity in normals for clustering */ - float normal_importance_; + float normal_importance_{1.0f}; /** \brief Whether or not to use the transform compressing depth in Z * This is only checked if it has been manually set by the user. @@ -385,7 +383,7 @@ namespace pcl */ bool use_single_camera_transform_; /** \brief Whether to use default transform behavior or not */ - bool use_default_transform_behaviour_; + bool use_default_transform_behaviour_{true}; /** \brief Internal storage class for supervoxels * \note Stores pointers to leaves of clustering internal octree, diff --git a/segmentation/include/pcl/segmentation/unary_classifier.h b/segmentation/include/pcl/segmentation/unary_classifier.h index 52ed89e90d5..db9cf32c82b 100644 --- a/segmentation/include/pcl/segmentation/unary_classifier.h +++ b/segmentation/include/pcl/segmentation/unary_classifier.h @@ -147,13 +147,13 @@ namespace pcl /** \brief Contains the input cloud */ typename pcl::PointCloud::Ptr input_cloud_; - bool label_field_; + bool label_field_{false}; unsigned int cluster_size_; - float normal_radius_search_; - float fpfh_radius_search_; - float feature_threshold_; + float normal_radius_search_{0.01f}; + float fpfh_radius_search_{0.05f}; + float feature_threshold_{5.0}; std::vector::Ptr> trained_features_; diff --git a/segmentation/src/grabcut_segmentation.cpp b/segmentation/src/grabcut_segmentation.cpp index e6d309f63ca..ea2b75c7704 100644 --- a/segmentation/src/grabcut_segmentation.cpp +++ b/segmentation/src/grabcut_segmentation.cpp @@ -47,7 +47,6 @@ const int pcl::segmentation::grabcut::BoykovKolmogorov::TERMINAL = -1; pcl::segmentation::grabcut::BoykovKolmogorov::BoykovKolmogorov (std::size_t max_nodes) - : flow_value_(0.0) { if (max_nodes > 0) { diff --git a/stereo/include/pcl/stereo/digital_elevation_map.h b/stereo/include/pcl/stereo/digital_elevation_map.h index 9a4cd8c0afa..53df19b34d4 100644 --- a/stereo/include/pcl/stereo/digital_elevation_map.h +++ b/stereo/include/pcl/stereo/digital_elevation_map.h @@ -129,11 +129,11 @@ class PCL_EXPORTS DigitalElevationMapBuilder : public DisparityMapConverter::ConstPtr image_; /** \brief Vector for the disparity map. */ std::vector disparity_map_; /** \brief X-size of the disparity map. */ - std::size_t disparity_map_width_; + std::size_t disparity_map_width_{640}; /** \brief Y-size of the disparity map. */ - std::size_t disparity_map_height_; + std::size_t disparity_map_height_{480}; /** \brief Thresholds of the disparity. */ - float disparity_threshold_min_; + float disparity_threshold_min_{0.0f}; float disparity_threshold_max_; }; diff --git a/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp b/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp index 773a2870411..9c76f3617cc 100644 --- a/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp +++ b/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp @@ -47,15 +47,8 @@ template pcl::DisparityMapConverter::DisparityMapConverter() -: center_x_(0.0f) -, center_y_(0.0f) -, focal_length_(0.0f) -, baseline_(0.0f) -, is_color_(false) -, disparity_map_width_(640) -, disparity_map_height_(480) -, disparity_threshold_min_(0.0f) -, disparity_threshold_max_(std::numeric_limits::max()) +: + disparity_threshold_max_(std::numeric_limits::max()) {} template diff --git a/stereo/src/digital_elevation_map.cpp b/stereo/src/digital_elevation_map.cpp index f5406942ccf..ef312c76e12 100644 --- a/stereo/src/digital_elevation_map.cpp +++ b/stereo/src/digital_elevation_map.cpp @@ -38,9 +38,7 @@ #include #include -pcl::DigitalElevationMapBuilder::DigitalElevationMapBuilder() -: resolution_column_(64), resolution_disparity_(32), min_points_in_cell_(1) -{} +pcl::DigitalElevationMapBuilder::DigitalElevationMapBuilder() = default; pcl::DigitalElevationMapBuilder::~DigitalElevationMapBuilder() = default; diff --git a/tools/obj_rec_ransac_accepted_hypotheses.cpp b/tools/obj_rec_ransac_accepted_hypotheses.cpp index ea5447ac2ea..f75bd66a750 100644 --- a/tools/obj_rec_ransac_accepted_hypotheses.cpp +++ b/tools/obj_rec_ransac_accepted_hypotheses.cpp @@ -85,9 +85,8 @@ class CallbackParameters viz_ (viz), points_ (points), normals_ (normals), - num_hypotheses_to_show_ (num_hypotheses_to_show), - show_models_ (true) - { } + num_hypotheses_to_show_ (num_hypotheses_to_show) + {} ObjRecRANSAC& objrec_; PCLVisualizer& viz_; @@ -95,7 +94,7 @@ class CallbackParameters PointCloud& normals_; int num_hypotheses_to_show_; std::list actors_, model_actors_; - bool show_models_; + bool show_models_{true}; }; //=============================================================================================================================== diff --git a/tools/octree_viewer.cpp b/tools/octree_viewer.cpp index 6381edbed0e..9962882c682 100644 --- a/tools/octree_viewer.cpp +++ b/tools/octree_viewer.cpp @@ -62,12 +62,7 @@ class OctreeViewer cloud (new pcl::PointCloud()), displayCloud (new pcl::PointCloud()), cloudVoxel (new pcl::PointCloud()), - octree (resolution), - wireframe (true), - show_cubes_ (true), - show_centroids_ (false), - show_original_points_ (false), - point_size_ (1.0) + octree (resolution) { //try to load the cloud @@ -126,9 +121,9 @@ class OctreeViewer //level int displayedDepth; //bool to decide what should be display - bool wireframe; - bool show_cubes_, show_centroids_, show_original_points_; - float point_size_; + bool wireframe{true}; + bool show_cubes_{true}, show_centroids_{false}, show_original_points_{false}; + float point_size_{1.0}; //======================================================== /* \brief Callback to interact with the keyboard diff --git a/tools/openni_image.cpp b/tools/openni_image.cpp index 84a1d7c3281..5560ef682e2 100644 --- a/tools/openni_image.cpp +++ b/tools/openni_image.cpp @@ -549,7 +549,6 @@ class Viewer /////////////////////////////////////////////////////////////////////////////////////// Viewer (Buffer &buf) : buf_ (buf) - , image_cld_init_ (false), depth_image_cld_init_ (false) { image_viewer_.reset (new visualization::ImageViewer ("PCL/OpenNI RGB image viewer")); depth_image_viewer_.reset (new visualization::ImageViewer ("PCL/OpenNI depth image viewer")); @@ -620,7 +619,7 @@ class Viewer Buffer &buf_; visualization::ImageViewer::Ptr image_viewer_; visualization::ImageViewer::Ptr depth_image_viewer_; - bool image_cld_init_, depth_image_cld_init_; + bool image_cld_init_{false}, depth_image_cld_init_{false}; }; void diff --git a/tools/openni_viewer.cpp b/tools/openni_viewer.cpp index 7098f4609ee..3b131c8a820 100644 --- a/tools/openni_viewer.cpp +++ b/tools/openni_viewer.cpp @@ -109,12 +109,10 @@ class OpenNIViewer using Cloud = pcl::PointCloud; using CloudConstPtr = typename Cloud::ConstPtr; - OpenNIViewer (pcl::Grabber& grabber) - : cloud_viewer_ (new pcl::visualization::PCLVisualizer ("PCL OpenNI cloud")) - , grabber_ (grabber) - , rgb_data_ (nullptr), rgb_data_size_ (0) - { - } + OpenNIViewer(pcl::Grabber& grabber) + : cloud_viewer_(new pcl::visualization::PCLVisualizer("PCL OpenNI cloud")) + , grabber_(grabber) + {} void cloud_callback (const CloudConstPtr& cloud) @@ -263,8 +261,8 @@ class OpenNIViewer CloudConstPtr cloud_; openni_wrapper::Image::Ptr image_; - unsigned char* rgb_data_; - unsigned rgb_data_size_; + unsigned char* rgb_data_{nullptr}; + unsigned rgb_data_size_{0}; }; // Create the PCLVisualizer object diff --git a/tools/ply2obj.cpp b/tools/ply2obj.cpp index f85b3db4280..5db70395c57 100644 --- a/tools/ply2obj.cpp +++ b/tools/ply2obj.cpp @@ -122,18 +122,14 @@ class ply_to_obj_converter void face_end (); - flags_type flags_; - std::ostream* ostream_; - double vertex_x_, vertex_y_, vertex_z_; - std::size_t face_vertex_indices_element_index_, face_vertex_indices_first_element_, face_vertex_indices_previous_element_; + flags_type flags_{0}; + std::ostream* ostream_{}; + double vertex_x_{0}, vertex_y_{0}, vertex_z_{0}; + std::size_t face_vertex_indices_element_index_{0}, face_vertex_indices_first_element_{0}, face_vertex_indices_previous_element_{0}; }; ply_to_obj_converter::ply_to_obj_converter (flags_type flags) - : flags_ (flags), ostream_ (), - vertex_x_ (0), vertex_y_ (0), vertex_z_ (0), - face_vertex_indices_element_index_ (), - face_vertex_indices_first_element_ (), - face_vertex_indices_previous_element_ () + : flags_ (flags) { } diff --git a/tools/ply2ply.cpp b/tools/ply2ply.cpp index b82c742d7ac..40a8488cd22 100644 --- a/tools/ply2ply.cpp +++ b/tools/ply2ply.cpp @@ -65,10 +65,8 @@ class ply_to_ply_converter binary_big_endian_format, binary_little_endian_format }; - - ply_to_ply_converter(format_type format) : - format_(format), input_format_(), output_format_(), - bol_ (), ostream_ () {} + + ply_to_ply_converter(format_type format) : format_(format) {} bool convert (const std::string &filename, std::istream& istream, std::ostream& ostream); @@ -128,9 +126,9 @@ class ply_to_ply_converter end_header_callback(); format_type format_; - pcl::io::ply::format_type input_format_, output_format_; - bool bol_; - std::ostream* ostream_; + pcl::io::ply::format_type input_format_{}, output_format_{}; + bool bol_{}; + std::ostream* ostream_{}; }; void diff --git a/tools/ply2raw.cpp b/tools/ply2raw.cpp index 9e1b70829c5..e2ab3411c9d 100644 --- a/tools/ply2raw.cpp +++ b/tools/ply2raw.cpp @@ -61,14 +61,9 @@ class ply_to_raw_converter { public: - ply_to_raw_converter () : - ostream_ (), vertex_x_ (0), vertex_y_ (0), vertex_z_ (0), - face_vertex_indices_element_index_ (), - face_vertex_indices_first_element_ (), - face_vertex_indices_previous_element_ () - {} + ply_to_raw_converter() {} - ply_to_raw_converter (const ply_to_raw_converter &f) : + ply_to_raw_converter (const ply_to_raw_converter &f) : ostream_ (), vertex_x_ (0), vertex_y_ (0), vertex_z_ (0), face_vertex_indices_element_index_ (), face_vertex_indices_first_element_ (), @@ -144,10 +139,10 @@ class ply_to_raw_converter void face_end (); - std::ostream* ostream_; - pcl::io::ply::float32 vertex_x_, vertex_y_, vertex_z_; - pcl::io::ply::int32 face_vertex_indices_element_index_, face_vertex_indices_first_element_, face_vertex_indices_previous_element_; - std::vector > vertices_; + std::ostream* ostream_{}; + pcl::io::ply::float32 vertex_x_{0}, vertex_y_{0}, vertex_z_{0}; + pcl::io::ply::int32 face_vertex_indices_element_index_{0}, face_vertex_indices_first_element_{0}, face_vertex_indices_previous_element_{0}; + std::vector > vertices_{}; }; void From 3dca669edbb4700d2f4d83f0c4ebb59aac819fff Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Fri, 27 Oct 2023 14:09:50 -0700 Subject: [PATCH 2/9] Fixed clang-tidy, clang-format CI issues --- .../include/pcl/segmentation/seeded_hue_segmentation.h | 3 +-- stereo/include/pcl/stereo/impl/disparity_map_converter.hpp | 3 +-- tools/ply2raw.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h b/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h index 70dd50ec556..c6d0d68ef79 100644 --- a/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h +++ b/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h @@ -107,8 +107,7 @@ namespace pcl ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief Empty constructor. */ - SeededHueSegmentation () - {}; + SeededHueSegmentation () = default; /** \brief Provide a pointer to the search object. * \param[in] tree a pointer to the spatial search object. diff --git a/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp b/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp index 9c76f3617cc..ce7db93ef84 100644 --- a/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp +++ b/stereo/include/pcl/stereo/impl/disparity_map_converter.hpp @@ -47,8 +47,7 @@ template pcl::DisparityMapConverter::DisparityMapConverter() -: - disparity_threshold_max_(std::numeric_limits::max()) +: disparity_threshold_max_(std::numeric_limits::max()) {} template diff --git a/tools/ply2raw.cpp b/tools/ply2raw.cpp index e2ab3411c9d..bb359d1f450 100644 --- a/tools/ply2raw.cpp +++ b/tools/ply2raw.cpp @@ -61,7 +61,7 @@ class ply_to_raw_converter { public: - ply_to_raw_converter() {} + ply_to_raw_converter() = default; ply_to_raw_converter (const ply_to_raw_converter &f) : ostream_ (), vertex_x_ (0), vertex_y_ (0), vertex_z_ (0), From ff6e9fe0f7c91921541b4b52c0a01a1dfafd5413 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Fri, 27 Oct 2023 17:49:58 -0700 Subject: [PATCH 3/9] Made changes per inspection --- .../conditional_euclidean_clustering.h | 10 +++--- .../pcl/segmentation/cpc_segmentation.h | 2 +- .../pcl/segmentation/extract_clusters.h | 4 +-- .../extract_polygonal_prism_data.h | 6 ++-- .../pcl/segmentation/grabcut_segmentation.h | 11 +++--- .../impl/min_cut_segmentation.hpp | 2 -- .../segmentation/impl/region_growing_rgb.hpp | 1 - .../pcl/segmentation/min_cut_segmentation.h | 18 +++++----- .../include/pcl/segmentation/region_growing.h | 8 ++--- .../pcl/segmentation/sac_segmentation.h | 35 ++++++++----------- 10 files changed, 44 insertions(+), 53 deletions(-) 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 From 8ea136a0f9383b64396bb2daa459e9c7911b9991 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Tue, 31 Oct 2023 18:33:46 -0700 Subject: [PATCH 4/9] Made changes per review --- .../segmentation/conditional_euclidean_clustering.h | 6 ++---- .../include/pcl/segmentation/extract_clusters.h | 9 +++------ .../pcl/segmentation/extract_labeled_clusters.h | 12 ++++-------- .../pcl/segmentation/extract_polygonal_prism_data.h | 6 ++---- .../include/pcl/segmentation/region_growing.h | 4 ++-- .../include/pcl/segmentation/sac_segmentation.h | 10 +++------- 6 files changed, 16 insertions(+), 31 deletions(-) diff --git a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h index 790ea37067d..a922e1b74c6 100644 --- a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h +++ b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h @@ -99,8 +99,6 @@ namespace pcl ConditionalEuclideanClustering (bool extract_removed_clusters = false) : searcher_ (), condition_function_ (), - - max_cluster_size_ (std::numeric_limits::max ()), extract_removed_clusters_ (extract_removed_clusters), small_clusters_ (new pcl::IndicesClusters), large_clusters_ (new pcl::IndicesClusters) @@ -248,10 +246,10 @@ namespace pcl int min_cluster_size_{1}; /** \brief The maximum cluster size (default = unlimited) */ - int max_cluster_size_{0}; + int max_cluster_size_{std::numeric_limits::max ()}; /** \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_{false}; + bool extract_removed_clusters_; /** \brief The resultant clusters that contain less than min_cluster_size points */ pcl::IndicesClustersPtr small_clusters_{nullptr}; diff --git a/segmentation/include/pcl/segmentation/extract_clusters.h b/segmentation/include/pcl/segmentation/extract_clusters.h index d7e9bb3c8e8..fd40f18accc 100644 --- a/segmentation/include/pcl/segmentation/extract_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_clusters.h @@ -337,10 +337,7 @@ namespace pcl ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief Empty constructor. */ - EuclideanClusterExtraction () : tree_ (), - - max_pts_per_cluster_ (std::numeric_limits::max ()) - {}; + EuclideanClusterExtraction () : tree_ () {}; /** \brief Provide a pointer to the search object. * \param[in] tree a pointer to the spatial search object. @@ -422,7 +419,7 @@ namespace pcl using BasePCLBase::deinitCompute; /** \brief A pointer to the spatial search object. */ - KdTreePtr tree_; + KdTreePtr tree_{nullptr}; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ double cluster_tolerance_{0.0}; @@ -431,7 +428,7 @@ namespace pcl 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_{0}; + pcl::uindex_t max_pts_per_cluster_{std::numeric_limits::max()}; /** \brief Class getName method. */ virtual std::string getClassName () const { return ("EuclideanClusterExtraction"); } diff --git a/segmentation/include/pcl/segmentation/extract_labeled_clusters.h b/segmentation/include/pcl/segmentation/extract_labeled_clusters.h index feda32a4007..da0a5207806 100644 --- a/segmentation/include/pcl/segmentation/extract_labeled_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_labeled_clusters.h @@ -115,11 +115,7 @@ class LabeledEuclideanClusterExtraction : public PCLBase { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief Empty constructor. */ - LabeledEuclideanClusterExtraction() - : tree_() - , - max_pts_per_cluster_(std::numeric_limits::max()) - , max_label_(std::numeric_limits::max()){}; + LabeledEuclideanClusterExtraction() = default; /** \brief Provide a pointer to the search object. * \param[in] tree a pointer to the spatial search object. @@ -221,7 +217,7 @@ class LabeledEuclideanClusterExtraction : public PCLBase { using BasePCLBase::input_; /** \brief A pointer to the spatial search object. */ - KdTreePtr tree_; + KdTreePtr tree_{nullptr}; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ double cluster_tolerance_{0}; @@ -232,11 +228,11 @@ class LabeledEuclideanClusterExtraction : public PCLBase { /** \brief The maximum number of points that a cluster needs to contain in order to be * considered valid (default = MAXINT). */ - int max_pts_per_cluster_; + int max_pts_per_cluster_{std::numeric_limits::max()}; /** \brief The maximum number of labels we can find in this pointcloud (default = * MAXINT)*/ - unsigned int max_label_; + unsigned int max_label_{0}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h b/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h index a6ec6cb7c4f..e322599ca93 100644 --- a/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h +++ b/segmentation/include/pcl/segmentation/extract_polygonal_prism_data.h @@ -115,9 +115,7 @@ namespace pcl using PointIndicesConstPtr = PointIndices::ConstPtr; /** \brief Empty constructor. */ - ExtractPolygonalPrismData () : planar_hull_ (), - height_limit_max_(std::numeric_limits::max()) - {}; + ExtractPolygonalPrismData () = default; /** \brief Provide a pointer to the input planar hull dataset. * \note Please see the example in the class description for how to obtain this. @@ -198,7 +196,7 @@ namespace pcl /** \brief The maximum allowed height (distance to the model) a point * will be considered from. */ - double height_limit_max_{0.0}; + double height_limit_max_{std::numeric_limits::max()}; /** \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/region_growing.h b/segmentation/include/pcl/segmentation/region_growing.h index 729c3a4db93..0ce15e23dbc 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_{0}; + pcl::uindex_t max_pts_per_cluster_{std::numeric_limits::max()}; /** \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_{0.0f}; + float theta_threshold_{30.0f / 180.0f * static_cast(M_PI)}; /** \brief Threshold used in residual test. */ float residual_threshold_{0.05f}; diff --git a/segmentation/include/pcl/segmentation/sac_segmentation.h b/segmentation/include/pcl/segmentation/sac_segmentation.h index aed3a10154f..03e7f700598 100644 --- a/segmentation/include/pcl/segmentation/sac_segmentation.h +++ b/segmentation/include/pcl/segmentation/sac_segmentation.h @@ -84,10 +84,6 @@ namespace pcl 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) {} @@ -272,7 +268,7 @@ 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_{0.0}, radius_max_{0.0}; + double radius_min_{-std::numeric_limits::max()}, radius_max_{std::numeric_limits::max()}; /** \brief The maximum distance of subsequent samples from the first (radius search) */ double samples_radius_{0.0}; @@ -284,7 +280,7 @@ namespace pcl 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_{Eigen::Vector3f::Zero()}; /** \brief Maximum number of iterations before giving up (user given parameter). */ int max_iterations_{50}; @@ -296,7 +292,7 @@ namespace pcl double probability_{0.99}; /** \brief Set to true if we need a random seed. */ - bool random_{false}; + bool random_; /** \brief Class get name method. */ virtual std::string From bca4d31fa29881c7b7dbec22df63d034fb0acbe7 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Fri, 3 Nov 2023 15:32:56 -0700 Subject: [PATCH 5/9] Made more changes per review --- .../pcl/segmentation/extract_labeled_clusters.h | 2 +- .../include/pcl/segmentation/impl/region_growing.hpp | 11 +---------- .../include/pcl/segmentation/region_growing.h | 8 ++++---- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/segmentation/include/pcl/segmentation/extract_labeled_clusters.h b/segmentation/include/pcl/segmentation/extract_labeled_clusters.h index da0a5207806..d7c9a4298c7 100644 --- a/segmentation/include/pcl/segmentation/extract_labeled_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_labeled_clusters.h @@ -232,7 +232,7 @@ class LabeledEuclideanClusterExtraction : public PCLBase { /** \brief The maximum number of labels we can find in this pointcloud (default = * MAXINT)*/ - unsigned int max_label_{0}; + unsigned int max_label_{std::numeric_limits::max()}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/impl/region_growing.hpp b/segmentation/include/pcl/segmentation/impl/region_growing.hpp index 90bf89478b3..0677cfbe17e 100644 --- a/segmentation/include/pcl/segmentation/impl/region_growing.hpp +++ b/segmentation/include/pcl/segmentation/impl/region_growing.hpp @@ -54,16 +54,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::RegionGrowing::RegionGrowing() -: max_pts_per_cluster_(std::numeric_limits::max()) -, theta_threshold_(30.0f / 180.0f * static_cast(M_PI)) -, search_() -, normals_() -, point_neighbours_(0) -, point_labels_(0) -, num_pts_in_segment_(0) -, clusters_(0) -{} +pcl::RegionGrowing::RegionGrowing() = default; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/region_growing.h b/segmentation/include/pcl/segmentation/region_growing.h index 0ce15e23dbc..6db56268b20 100644 --- a/segmentation/include/pcl/segmentation/region_growing.h +++ b/segmentation/include/pcl/segmentation/region_growing.h @@ -312,10 +312,10 @@ namespace pcl NormalPtr normals_{nullptr}; /** \brief Contains neighbours of each point. */ - std::vector point_neighbours_; + std::vector point_neighbours_{}; /** \brief Point labels that tells to which segment each point belongs. */ - std::vector point_labels_; + std::vector point_labels_{}; /** \brief If set to true then normal/smoothness test will be done during segmentation. * It is always set to true for the usual region growing algorithm. It is used for turning on/off the test @@ -323,10 +323,10 @@ namespace pcl bool normal_flag_{true}; /** \brief Tells how much points each segment contains. Used for reserving memory. */ - std::vector num_pts_in_segment_; + std::vector num_pts_in_segment_{}; /** \brief After the segmentation it will contain the segments. */ - std::vector clusters_; + std::vector clusters_{}; /** \brief Stores the number of segments. */ int number_of_segments_{0}; From 3adea2814d340b9a51dc0e2e64023e882546e0d4 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Tue, 28 Nov 2023 16:02:26 -0800 Subject: [PATCH 6/9] Addressed review comments --- .../pcl/segmentation/extract_clusters.h | 2 +- .../pcl/segmentation/grabcut_segmentation.h | 20 +++++++++---------- .../impl/min_cut_segmentation.hpp | 11 +--------- .../organized_multi_plane_segmentation.h | 17 +++++----------- .../pcl/segmentation/sac_segmentation.h | 8 ++------ .../segmentation/seeded_hue_segmentation.h | 2 +- .../pcl/segmentation/segment_differences.h | 10 ++++------ .../pcl/segmentation/unary_classifier.h | 6 +++--- tools/ply2ply.cpp | 2 +- tools/ply2raw.cpp | 6 +----- 10 files changed, 28 insertions(+), 56 deletions(-) diff --git a/segmentation/include/pcl/segmentation/extract_clusters.h b/segmentation/include/pcl/segmentation/extract_clusters.h index fd40f18accc..cbda2cdf952 100644 --- a/segmentation/include/pcl/segmentation/extract_clusters.h +++ b/segmentation/include/pcl/segmentation/extract_clusters.h @@ -337,7 +337,7 @@ namespace pcl ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief Empty constructor. */ - EuclideanClusterExtraction () : tree_ () {}; + EuclideanClusterExtraction () = default; /** \brief Provide a pointer to the search object. * \param[in] tree a pointer to the spatial search object. diff --git a/segmentation/include/pcl/segmentation/grabcut_segmentation.h b/segmentation/include/pcl/segmentation/grabcut_segmentation.h index d17cbd5d8b6..175ac4a2877 100644 --- a/segmentation/include/pcl/segmentation/grabcut_segmentation.h +++ b/segmentation/include/pcl/segmentation/grabcut_segmentation.h @@ -256,10 +256,8 @@ namespace pcl class GaussianFitter { public: - GaussianFitter (float epsilon = 0.0001) - : sum_ (Eigen::Vector3f::Zero ()) - , accumulator_ (Eigen::Matrix3f::Zero ()) - , epsilon_ (epsilon) + GaussianFitter (float epsilon = 0.0001f) + : epsilon_ (epsilon) {} /// Add a color sample @@ -280,13 +278,13 @@ namespace pcl private: /// sum of r,g, and b - Eigen::Vector3f sum_{}; + Eigen::Vector3f sum_{Eigen::Vector3f::Zero ()}; /// matrix of products (i.e. r*r, r*g, r*b), some values are duplicated. - Eigen::Matrix3f accumulator_{}; + Eigen::Matrix3f accumulator_{Eigen::Matrix3f::Zero ()}; /// 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_{0.0f}; + float epsilon_{0.001f}; PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -394,12 +392,12 @@ namespace pcl // Storage for N-link weights, each pixel stores links to nb_neighbours struct NLinks { - NLinks () : indices (0), dists (0), weights (0) {} + NLinks () = default; int nb_links{0}; - Indices indices; - std::vector dists; - std::vector weights; + Indices indices{}; + std::vector dists{}; + std::vector weights{}; }; bool initCompute (); diff --git a/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp index af52c822846..0ec614a8e53 100644 --- a/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/min_cut_segmentation.hpp @@ -47,16 +47,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::MinCutSegmentation::MinCutSegmentation () : - search_ (), - foreground_points_ (0), - background_points_ (0), - clusters_ (0), - vertices_ (0), - edge_marker_ (0) - /////////////////////////////////// -{ -} +pcl::MinCutSegmentation::MinCutSegmentation () = default; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h index a71efc233c4..f8b54f1cb9d 100644 --- a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h +++ b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h @@ -89,14 +89,7 @@ namespace pcl using PlaneRefinementComparatorConstPtr = typename PlaneRefinementComparator::ConstPtr; /** \brief Constructor for OrganizedMultiPlaneSegmentation. */ - OrganizedMultiPlaneSegmentation () : - normals_ (), - - angular_threshold_ (pcl::deg2rad (3.0)), - - compare_ (new PlaneComparator ()), refinement_compare_ (new PlaneRefinementComparator ()) - { - } + OrganizedMultiPlaneSegmentation () = default; /** \brief Destructor for OrganizedMultiPlaneSegmentation. */ @@ -277,13 +270,13 @@ namespace pcl protected: /** \brief A pointer to the input normals */ - PointCloudNConstPtr normals_; + PointCloudNConstPtr normals_{nullptr}; /** \brief The minimum number of inliers required for each plane. */ unsigned min_inliers_{1000}; /** \brief The tolerance in radians for difference in normal direction between neighboring points, to be considered part of the same plane. */ - double angular_threshold_; + double angular_threshold_{pcl::deg2rad (3.0)}; /** \brief The tolerance in meters for difference in perpendicular distance (d component of plane equation) to the plane between neighboring points, to be considered part of the same plane. */ double distance_threshold_{0.02}; @@ -295,10 +288,10 @@ namespace pcl bool project_points_{false}; /** \brief A comparator for comparing neighboring pixels' plane equations. */ - PlaneComparatorPtr compare_; + PlaneComparatorPtr compare_{new PlaneComparator}; /** \brief A comparator for use on the refinement step. Compares points to regions segmented in the first pass. */ - PlaneRefinementComparatorPtr refinement_compare_; + PlaneRefinementComparatorPtr refinement_compare_{new PlaneRefinementComparatorPtr}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/sac_segmentation.h b/segmentation/include/pcl/segmentation/sac_segmentation.h index 03e7f700598..3f8047905b5 100644 --- a/segmentation/include/pcl/segmentation/sac_segmentation.h +++ b/segmentation/include/pcl/segmentation/sac_segmentation.h @@ -82,9 +82,7 @@ namespace pcl * \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_() - , random_(random) + : random_(random) {} /** \brief Empty destructor. */ @@ -335,8 +333,6 @@ namespace pcl */ SACSegmentationFromNormals (bool random = false) : SACSegmentation (random) - , normals_ () - {}; /** \brief Provide a pointer to the input dataset that contains the point normals of @@ -393,7 +389,7 @@ namespace pcl protected: /** \brief A pointer to the input dataset that contains the point normals of the XYZ dataset. */ - PointCloudNConstPtr normals_; + PointCloudNConstPtr normals_{nullptr}; /** \brief The relative weight (between 0 and 1) to give to the angular * distance (0 to pi/2) between point normals and the plane normal. diff --git a/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h b/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h index c6d0d68ef79..a89ee2d3754 100644 --- a/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h +++ b/segmentation/include/pcl/segmentation/seeded_hue_segmentation.h @@ -154,7 +154,7 @@ namespace pcl using BasePCLBase::deinitCompute; /** \brief A pointer to the spatial search object. */ - KdTreePtr tree_; + KdTreePtr tree_{nullptr}; /** \brief The spatial cluster tolerance as a measure in the L2 Euclidean space. */ double cluster_tolerance_{0}; diff --git a/segmentation/include/pcl/segmentation/segment_differences.h b/segmentation/include/pcl/segmentation/segment_differences.h index 0d68ad1fd95..6cc2d90a547 100755 --- a/segmentation/include/pcl/segmentation/segment_differences.h +++ b/segmentation/include/pcl/segmentation/segment_differences.h @@ -85,9 +85,7 @@ namespace pcl using PointIndicesConstPtr = PointIndices::ConstPtr; /** \brief Empty constructor. */ - SegmentDifferences () : - tree_ (), target_ () - {}; + SegmentDifferences () = default; /** \brief Provide a pointer to the target dataset against which we * compare the input cloud given in setInputCloud @@ -139,15 +137,15 @@ namespace pcl using BasePCLBase::deinitCompute; /** \brief A pointer to the spatial search object. */ - KdTreePtr tree_; + KdTreePtr tree_{nullptr}; /** \brief The input target point cloud dataset. */ - PointCloudConstPtr target_; + PointCloudConstPtr target_{nullptr}; /** \brief The distance tolerance (squared) as a measure in the L2 * Euclidean space between corresponding points. */ - double distance_threshold_{0}; + double distance_threshold_{0.0}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/unary_classifier.h b/segmentation/include/pcl/segmentation/unary_classifier.h index db9cf32c82b..f234de0616a 100644 --- a/segmentation/include/pcl/segmentation/unary_classifier.h +++ b/segmentation/include/pcl/segmentation/unary_classifier.h @@ -145,18 +145,18 @@ namespace pcl /** \brief Contains the input cloud */ - typename pcl::PointCloud::Ptr input_cloud_; + typename pcl::PointCloud::Ptr input_cloud_{nullptr}; bool label_field_{false}; - unsigned int cluster_size_; + unsigned int cluster_size_{0}; float normal_radius_search_{0.01f}; float fpfh_radius_search_{0.05f}; float feature_threshold_{5.0}; - std::vector::Ptr> trained_features_; + std::vector::Ptr> trained_features_{}; /** \brief Contains normals of the points that will be segmented. */ //typename pcl::PointCloud::Ptr normals_; diff --git a/tools/ply2ply.cpp b/tools/ply2ply.cpp index 40a8488cd22..e749f4b2c69 100644 --- a/tools/ply2ply.cpp +++ b/tools/ply2ply.cpp @@ -127,7 +127,7 @@ class ply_to_ply_converter format_type format_; pcl::io::ply::format_type input_format_{}, output_format_{}; - bool bol_{}; + bool bol_{false}; std::ostream* ostream_{}; }; diff --git a/tools/ply2raw.cpp b/tools/ply2raw.cpp index bb359d1f450..86ab736ea45 100644 --- a/tools/ply2raw.cpp +++ b/tools/ply2raw.cpp @@ -63,11 +63,7 @@ class ply_to_raw_converter public: ply_to_raw_converter() = default; - ply_to_raw_converter (const ply_to_raw_converter &f) : - ostream_ (), vertex_x_ (0), vertex_y_ (0), vertex_z_ (0), - face_vertex_indices_element_index_ (), - face_vertex_indices_first_element_ (), - face_vertex_indices_previous_element_ () + ply_to_raw_converter (const ply_to_raw_converter &f) { *this = f; } From 40aea91cfa821b9b7d2147b57525199c2a7ff768 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Wed, 29 Nov 2023 22:06:46 -0800 Subject: [PATCH 7/9] Addressed CI errors, omitted review comments --- .../include/pcl/segmentation/impl/unary_classifier.hpp | 4 +--- .../pcl/segmentation/organized_multi_plane_segmentation.h | 4 ++-- segmentation/include/pcl/segmentation/unary_classifier.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp index 75db2062ee0..dc4ef677a38 100644 --- a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp +++ b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp @@ -52,9 +52,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::UnaryClassifier::UnaryClassifier() -: input_cloud_(new pcl::PointCloud) -{} +pcl::UnaryClassifier::UnaryClassifier() = default; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template diff --git a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h index f8b54f1cb9d..ee6a1be1aaf 100644 --- a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h +++ b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h @@ -288,10 +288,10 @@ namespace pcl bool project_points_{false}; /** \brief A comparator for comparing neighboring pixels' plane equations. */ - PlaneComparatorPtr compare_{new PlaneComparator}; + PlaneComparatorPtr compare_{new PlaneComparator()}; /** \brief A comparator for use on the refinement step. Compares points to regions segmented in the first pass. */ - PlaneRefinementComparatorPtr refinement_compare_{new PlaneRefinementComparatorPtr}; + PlaneRefinementComparatorPtr refinement_compare_{new PlaneRefinementComparatorPtr()}; /** \brief Class getName method. */ virtual std::string diff --git a/segmentation/include/pcl/segmentation/unary_classifier.h b/segmentation/include/pcl/segmentation/unary_classifier.h index f234de0616a..f6025c6a171 100644 --- a/segmentation/include/pcl/segmentation/unary_classifier.h +++ b/segmentation/include/pcl/segmentation/unary_classifier.h @@ -145,7 +145,7 @@ namespace pcl /** \brief Contains the input cloud */ - typename pcl::PointCloud::Ptr input_cloud_{nullptr}; + typename pcl::PointCloud::Ptr input_cloud_{new pcl::PointCloud}; bool label_field_{false}; From 0a3a1583fa003017a15cbfe0748398de5d19360e Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Thu, 30 Nov 2023 16:27:11 -0800 Subject: [PATCH 8/9] Addressed more build errors --- .../pcl/segmentation/organized_multi_plane_segmentation.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h index ee6a1be1aaf..79a872a25f3 100644 --- a/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h +++ b/segmentation/include/pcl/segmentation/organized_multi_plane_segmentation.h @@ -89,7 +89,7 @@ namespace pcl using PlaneRefinementComparatorConstPtr = typename PlaneRefinementComparator::ConstPtr; /** \brief Constructor for OrganizedMultiPlaneSegmentation. */ - OrganizedMultiPlaneSegmentation () = default; + OrganizedMultiPlaneSegmentation() = default; /** \brief Destructor for OrganizedMultiPlaneSegmentation. */ @@ -288,10 +288,10 @@ namespace pcl bool project_points_{false}; /** \brief A comparator for comparing neighboring pixels' plane equations. */ - PlaneComparatorPtr compare_{new PlaneComparator()}; + PlaneComparatorPtr compare_{new PlaneComparator}; /** \brief A comparator for use on the refinement step. Compares points to regions segmented in the first pass. */ - PlaneRefinementComparatorPtr refinement_compare_{new PlaneRefinementComparatorPtr()}; + PlaneRefinementComparatorPtr refinement_compare_{new PlaneRefinementComparator}; /** \brief Class getName method. */ virtual std::string From 54aea2be3e04a255221543568a8f656f917bd800 Mon Sep 17 00:00:00 2001 From: Norm Evangelista Date: Fri, 1 Dec 2023 10:30:09 -0800 Subject: [PATCH 9/9] Addressed additional review comment --- segmentation/include/pcl/segmentation/grabcut_segmentation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmentation/include/pcl/segmentation/grabcut_segmentation.h b/segmentation/include/pcl/segmentation/grabcut_segmentation.h index 175ac4a2877..13d20d77a82 100644 --- a/segmentation/include/pcl/segmentation/grabcut_segmentation.h +++ b/segmentation/include/pcl/segmentation/grabcut_segmentation.h @@ -284,7 +284,7 @@ namespace pcl /// 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_{0.001f}; + float epsilon_; PCL_MAKE_ALIGNED_OPERATOR_NEW };