45#include "pcl/gpu/people/label_blob2.h"
46#include "pcl/gpu/people/label_common.h"
55#include <pcl/point_cloud.h>
57#include <pcl/conversions.h>
58#include <pcl/common/eigen.h>
61#include <pcl/PointIndices.h>
71 namespace label_skeleton
302 votes[
static_cast<unsigned int>(label)]++;
307 unsigned int max = 0;
312 if(votes[
static_cast<unsigned int>(i)] > max)
314 max = votes[
static_cast<unsigned int>(i)];
333 std::vector< std::vector<
Blob2, Eigen::aligned_allocator<Blob2> > >&
sorted,
334 std::vector< std::vector<pcl::PointIndices> >& indices)
342 unsigned int lid = 0;
344 for(
unsigned int l = 0; l < indices[
lab].size(); l++)
382 std::cout <<
"(I) : giveSortedBlobsInfo(): Size of outer vector: " <<
sorted.
size() << std::endl;
383 for(
unsigned int i = 0; i <
sorted.
size(); i++)
385 std::cout <<
"(I) : giveSortedBlobsInfo(): Found " <<
sorted[i].
size() <<
" parts of type " << i << std::endl;
386 std::cout <<
"(I) : giveSortedBlobsInfo(): indices : ";
387 for(
unsigned int j = 0; j <
sorted[i].
size(); j++)
389 std::cout <<
" id:" <<
sorted[i][j].id <<
" lid:" <<
sorted[i][j].lid;
391 std::cout << std::endl;
Define methods for centroid estimation and covariance matrix calculus.
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
Define standard C methods and C++ classes that are common to all methods.
Defines all the PCL implemented PointT point type structures.
Define methods for measuring time spent in code blocks.
void getMinMax3D(const pcl::PointCloud< PointT > &cloud, PointT &min_pt, PointT &max_pt)
Get the minimum and maximum values on each of the 3 (x-y-z) dimensions in a given pointcloud.
unsigned int computeCovarianceMatrixNormalized(const pcl::PointCloud< PointT > &cloud, const Eigen::Matrix< Scalar, 4, 1 > ¢roid, Eigen::Matrix< Scalar, 3, 3 > &covariance_matrix)
Compute normalized the 3x3 covariance matrix of a given set of points.
void eigen33(const Matrix &mat, typename Matrix::Scalar &eigenvalue, Vector &eigenvector)
determines the eigenvector and eigenvalue of the smallest eigenvalue of the symmetric positive semi d...
unsigned int compute3DCentroid(ConstCloudIterator< PointT > &cloud_iterator, Eigen::Matrix< Scalar, 4, 1 > ¢roid)
Compute the 3D (X-Y-Z) centroid of a set of points and return it as a 3D vector.
int giveSortedBlobsInfo(std::vector< std::vector< Blob2, Eigen::aligned_allocator< Blob2 > > > &sorted)
This function is a stupid helper function to debug easilier, it print out how the matrix was sorted.
void smoothLabelImage(cv::Mat &lmap_in, cv::Mat &dmap, cv::Mat &lmap_out)
this function smooths the label image based on label and depth
void sortIndicesToBlob2(const pcl::PointCloud< pcl::PointXYZ > &cloud_in, unsigned int sizeThres, std::vector< std::vector< Blob2, Eigen::aligned_allocator< Blob2 > > > &sorted, std::vector< std::vector< pcl::PointIndices > > &indices)
This function takes a number of indices with label and sorts them in the blob matrix.
part_t
Our code is forseen to use maximal use 32 labels.
This structure contains all parameters to describe blobs and their parent/child relations.
Eigen::Matrix3f eigenvect
pcl::PointIndices indices