Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Types | Public Member Functions | Protected Attributes
pcl::recognition::HoughSpace3D Class Reference

HoughSpace3D is a 3D voting space. More...

#include <pcl/recognition/cg/hough_3d.h>

Public Types

using Ptr = shared_ptr< HoughSpace3D >
 
using ConstPtr = shared_ptr< const HoughSpace3D >
 

Public Member Functions

 HoughSpace3D (const Eigen::Vector3d &min_coord, const Eigen::Vector3d &bin_size, const Eigen::Vector3d &max_coord)
 Constructor. More...
 
void reset ()
 Reset all cast votes. More...
 
int vote (const Eigen::Vector3d &single_vote_coord, double weight, int voter_id)
 Casting a vote for a given position in the Hough space. More...
 
int voteInt (const Eigen::Vector3d &single_vote_coord, double weight, int voter_id)
 Vote for a given position in the 3D space. More...
 
double findMaxima (double min_threshold, std::vector< double > &maxima_values, std::vector< std::vector< int > > &maxima_voter_ids)
 Find the bins with most votes. More...
 

Protected Attributes

Eigen::Vector3d min_coord_
 Minimum coordinate in the Hough Space. More...
 
Eigen::Vector3d bin_size_
 Size of each bin in the Hough Space. More...
 
Eigen::Vector3i bin_count_
 Number of bins for each dimension. More...
 
int partial_bin_products_ [4] {}
 Used to access hough_space_ as if it was a matrix. More...
 
int total_bins_count_ {0}
 Total number of bins in the Hough Space. More...
 
std::vector< double > hough_space_
 The Hough Space. More...
 
std::unordered_map< int, std::vector< int > > voter_ids_
 List of voters for each bin. More...
 

Detailed Description

HoughSpace3D is a 3D voting space.

Cast votes can be interpolated in order to better deal with approximations introduced by bin quantization. A weight can also be associated with each vote.

Author
Federico Tombari (original), Tommaso Cavallari (PCL port)

Definition at line 57 of file hough_3d.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 64 of file hough_3d.h.

◆ Ptr

Definition at line 63 of file hough_3d.h.

Constructor & Destructor Documentation

◆ HoughSpace3D()

pcl::recognition::HoughSpace3D::HoughSpace3D ( const Eigen::Vector3d &  min_coord,
const Eigen::Vector3d &  bin_size,
const Eigen::Vector3d &  max_coord 
)

Constructor.

Parameters
[in]min_coordminimum (x,y,z) coordinates of the Hough space
[in]bin_sizesize of each bing of the Hough space.
[in]max_coordmaximum (x,y,z) coordinates of the Hough space.

Member Function Documentation

◆ findMaxima()

double pcl::recognition::HoughSpace3D::findMaxima ( double  min_threshold,
std::vector< double > &  maxima_values,
std::vector< std::vector< int > > &  maxima_voter_ids 
)

Find the bins with most votes.

Parameters
[in]min_thresholdthe minimum number of votes to be included in a bin in order to have its value returned. If set to a value between -1 and 0 the Hough space maximum_vote is found and the returned values are all the votes greater than -min_threshold * maximum_vote.
[out]maxima_valuesthe list of Hough Space bin values greater than min_threshold.
[out]maxima_voter_idsfor each value returned, a list of the voter ids who cast a vote in that position.
Returns
The min_threshold used, either set by the user or found by this method.

◆ reset()

void pcl::recognition::HoughSpace3D::reset ( )

Reset all cast votes.

◆ vote()

int pcl::recognition::HoughSpace3D::vote ( const Eigen::Vector3d &  single_vote_coord,
double  weight,
int  voter_id 
)

Casting a vote for a given position in the Hough space.

Parameters
[in]single_vote_coordcoordinates of the vote being cast (in absolute coordinates)
[in]weightweight associated with the vote.
[in]voter_idthe numeric id of the voter. Useful to trace back the voting correspondence, if the vote is returned by findMaxima as part of a maximum of the Hough Space.
Returns
the index of the bin in which the vote has been cast.

◆ voteInt()

int pcl::recognition::HoughSpace3D::voteInt ( const Eigen::Vector3d &  single_vote_coord,
double  weight,
int  voter_id 
)

Vote for a given position in the 3D space.

The weight is interpolated between the bin pointed by single_vote_coord and its neighbors.

Parameters
[in]single_vote_coordcoordinates of the vote being cast.
[in]weightweight associated with the vote.
[in]voter_idthe numeric id of the voter. Useful to trace back the voting correspondence, if the vote is returned by findMaxima as a part of a maximum of the Hough Space.
Returns
the index of the bin in which the vote has been cast.

Member Data Documentation

◆ bin_count_

Eigen::Vector3i pcl::recognition::HoughSpace3D::bin_count_
protected

Number of bins for each dimension.

Definition at line 118 of file hough_3d.h.

◆ bin_size_

Eigen::Vector3d pcl::recognition::HoughSpace3D::bin_size_
protected

Size of each bin in the Hough Space.

Definition at line 115 of file hough_3d.h.

◆ hough_space_

std::vector<double> pcl::recognition::HoughSpace3D::hough_space_
protected

The Hough Space.

Definition at line 127 of file hough_3d.h.

◆ min_coord_

Eigen::Vector3d pcl::recognition::HoughSpace3D::min_coord_
protected

Minimum coordinate in the Hough Space.

Definition at line 112 of file hough_3d.h.

◆ partial_bin_products_

int pcl::recognition::HoughSpace3D::partial_bin_products_[4] {}
protected

Used to access hough_space_ as if it was a matrix.

Definition at line 121 of file hough_3d.h.

◆ total_bins_count_

int pcl::recognition::HoughSpace3D::total_bins_count_ {0}
protected

Total number of bins in the Hough Space.

Definition at line 124 of file hough_3d.h.

◆ voter_ids_

std::unordered_map<int, std::vector<int> > pcl::recognition::HoughSpace3D::voter_ids_
protected

List of voters for each bin.

Definition at line 130 of file hough_3d.h.


The documentation for this class was generated from the following file: