Point Cloud Library (PCL)  1.8.1-dev
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members | 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 Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW 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_
 Total number of bins in the Hough Space. More...
 
std::vector< double > hough_space_
 The Hough Space. More...
 
boost::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 55 of file hough_3d.h.

Constructor & Destructor Documentation

EIGEN_MAKE_ALIGNED_OPERATOR_NEW 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

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.
void pcl::recognition::HoughSpace3D::reset ( )

Reset all cast votes.

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.
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

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

Number of bins for each dimension.

Definition at line 114 of file hough_3d.h.

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

Size of each bin in the Hough Space.

Definition at line 111 of file hough_3d.h.

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

The Hough Space.

Definition at line 123 of file hough_3d.h.

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

Minimum coordinate in the Hough Space.

Definition at line 108 of file hough_3d.h.

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

Used to access hough_space_ as if it was a matrix.

Definition at line 117 of file hough_3d.h.

int pcl::recognition::HoughSpace3D::total_bins_count_
protected

Total number of bins in the Hough Space.

Definition at line 120 of file hough_3d.h.

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

List of voters for each bin.

Definition at line 127 of file hough_3d.h.


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