Skip to content

Commit

Permalink
Made changes per inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawme committed Oct 28, 2023
1 parent 3dca669 commit ff6e9fe
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool (const PointT&, const PointT&, float)> condition_function_;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion segmentation/include/pcl/segmentation/cpc_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions segmentation/include/pcl/segmentation/extract_clusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,20 @@ 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};

/** \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};
Expand Down
11 changes: 5 additions & 6 deletions segmentation/include/pcl/segmentation/grabcut_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT>
pcl::MinCutSegmentation<PointT>::MinCutSegmentation () :

search_ (),

foreground_points_ (0),
background_points_ (0),
clusters_ (0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT, typename NormalT>
pcl::RegionGrowingRGB<PointT, NormalT>::RegionGrowingRGB () :

point_distances_ (0),
segment_neighbours_ (0),
segment_distances_ (0),
Expand Down
18 changes: 9 additions & 9 deletions segmentation/include/pcl/segmentation/min_cut_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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<PointT, Eigen::aligned_allocator<PointT> > foreground_points_;
std::vector<PointT, Eigen::aligned_allocator<PointT> > foreground_points_{};

/** \brief Stores the points that are known to be in the background. */
std::vector<PointT, Eigen::aligned_allocator<PointT> > background_points_;
std::vector<PointT, Eigen::aligned_allocator<PointT> > background_points_{};

/** \brief After the segmentation it will contain the segments. */
std::vector <pcl::PointIndices> clusters_;
std::vector <pcl::PointIndices> 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<CapacityMap> capacity_;
std::shared_ptr<CapacityMap> capacity_{nullptr};

/** \brief Stores reverse edges for every edge in the graph. */
std::shared_ptr<ReverseEdgeMap> reverse_edges_;
std::shared_ptr<ReverseEdgeMap> 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<int> > edge_marker_;
std::vector< std::set<int> > edge_marker_{};

/** \brief Stores the vertex that serves as source. */
VertexDescriptor source_{};
Expand Down
8 changes: 4 additions & 4 deletions segmentation/include/pcl/segmentation/region_growing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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};
Expand All @@ -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<pcl::Indices> point_neighbours_;
Expand Down
35 changes: 15 additions & 20 deletions segmentation/include/pcl/segmentation/sac_segmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>::max ())
, radius_max_ (std::numeric_limits<double>::max ())
,
samples_radius_search_ ()
,
axis_ (Eigen::Vector3f::Zero ())
,
random_ (random)
{
}
SACSegmentation(bool random = false)
: model_()
, sac_()
, radius_min_(-std::numeric_limits<double>::max())
, radius_max_(std::numeric_limits<double>::max())
, samples_radius_search_()
, axis_(Eigen::Vector3f::Zero())
, random_(random)
{}

/** \brief Empty destructor. */
~SACSegmentation () override = default;
Expand Down Expand Up @@ -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};
Expand All @@ -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};
Expand All @@ -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
Expand Down

0 comments on commit ff6e9fe

Please sign in to comment.