Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions
pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT > Class Template Reference

HarrisKeypoint3D uses the idea of 2D Harris keypoints, but instead of using image gradients, it uses surface normals. More...

#include <pcl/keypoints/harris_3d.h>

+ Inheritance diagram for pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >:
+ Collaboration diagram for pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >:

Public Types

enum  ResponseMethod {
  HARRIS = 1 , NOBLE , LOWE , TOMASI ,
  CURVATURE
}
 
using Ptr = shared_ptr< HarrisKeypoint3D< PointInT, PointOutT, NormalT > >
 
using ConstPtr = shared_ptr< const HarrisKeypoint3D< PointInT, PointOutT, NormalT > >
 
using PointCloudIn = typename Keypoint< PointInT, PointOutT >::PointCloudIn
 
using PointCloudOut = typename Keypoint< PointInT, PointOutT >::PointCloudOut
 
using KdTree = typename Keypoint< PointInT, PointOutT >::KdTree
 
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr
 
using PointCloudN = pcl::PointCloud< NormalT >
 
using PointCloudNPtr = typename PointCloudN::Ptr
 
using PointCloudNConstPtr = typename PointCloudN::ConstPtr
 
- Public Types inherited from pcl::Keypoint< PointInT, PointOutT >
using Ptr = shared_ptr< Keypoint< PointInT, PointOutT > >
 
using ConstPtr = shared_ptr< const Keypoint< PointInT, PointOutT > >
 
using BaseClass = PCLBase< PointInT >
 
using KdTree = pcl::search::Search< PointInT >
 
using KdTreePtr = typename KdTree::Ptr
 
using PointCloudIn = pcl::PointCloud< PointInT >
 
using PointCloudInPtr = typename PointCloudIn::Ptr
 
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr
 
using PointCloudOut = pcl::PointCloud< PointOutT >
 
using SearchMethod = std::function< int(pcl::index_t, double, pcl::Indices &, std::vector< float > &)>
 
using SearchMethodSurface = std::function< int(const PointCloudIn &cloud, pcl::index_t index, double, pcl::Indices &, std::vector< float > &)>
 
- Public Types inherited from pcl::PCLBase< PointInT >
using PointCloud = pcl::PointCloud< PointInT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointIndicesPtr = PointIndices::Ptr
 
using PointIndicesConstPtr = PointIndices::ConstPtr
 

Public Member Functions

 HarrisKeypoint3D (ResponseMethod method=HARRIS, float radius=0.01f, float threshold=0.0f)
 Constructor. More...
 
 ~HarrisKeypoint3D () override=default
 Empty destructor. More...
 
void setInputCloud (const PointCloudInConstPtr &cloud) override
 Provide a pointer to the input dataset. More...
 
void setMethod (ResponseMethod type)
 Set the method of the response to be calculated. More...
 
void setRadius (float radius)
 Set the radius for normal estimation and non maxima suppression. More...
 
void setThreshold (float threshold)
 Set the threshold value for detecting corners. More...
 
void setNonMaxSupression (bool=false)
 Whether non maxima suppression should be applied or the response for each point should be returned. More...
 
void setRefine (bool do_refine)
 Whether the detected key points should be refined or not. More...
 
void setNormals (const PointCloudNConstPtr &normals)
 Set normals if precalculated normals are available. More...
 
void setSearchSurface (const PointCloudInConstPtr &cloud) override
 Provide a pointer to a dataset to add additional information to estimate the features for every point in the input dataset. More...
 
void setNumberOfThreads (unsigned int nr_threads=0)
 Initialize the scheduler and set the number of threads to use. More...
 
- Public Member Functions inherited from pcl::Keypoint< PointInT, PointOutT >
 Keypoint ()=default
 
 Keypoint ()
 Empty constructor. More...
 
void harrisCorner (PointInT &output, PointInT &input, const float sigma_d, const float sigma_i, const float alpha, const float thresh)
 
void hessianBlob (PointInT &output, PointInT &input, const float sigma, bool SCALE)
 
void hessianBlob (PointInT &output, PointInT &input, const float start_scale, const float scaling_factor, const int num_scales)
 
void imageElementMultiply (PointInT &output, PointInT &input1, PointInT &input2)
 
 ~Keypoint () override=default
 Empty destructor. More...
 
virtual void setSearchSurface (const PointCloudInConstPtr &cloud)
 Provide a pointer to the input dataset that we need to estimate features at every point for. More...
 
PointCloudInConstPtr getSearchSurface ()
 Get a pointer to the surface point cloud dataset. More...
 
void setSearchMethod (const KdTreePtr &tree)
 Provide a pointer to the search object. More...
 
KdTreePtr getSearchMethod ()
 Get a pointer to the search method used. More...
 
double getSearchParameter ()
 Get the internal search parameter. More...
 
void setKSearch (int k)
 Set the number of k nearest neighbors to use for the feature estimation. More...
 
int getKSearch ()
 get the number of k nearest neighbors used for the feature estimation. More...
 
void setRadiusSearch (double radius)
 Set the sphere radius that is to be used for determining the nearest neighbors used for the key point detection. More...
 
double getRadiusSearch ()
 Get the sphere radius used for determining the neighbors. More...
 
pcl::PointIndicesConstPtr getKeypointsIndices ()
 
void compute (PointCloudOut &output)
 Base method for key point detection for all points given in <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in setSearchMethod () More...
 
int searchForNeighbors (pcl::index_t index, double parameter, pcl::Indices &indices, std::vector< float > &distances) const
 Search for k-nearest neighbors using the spatial locator from setSearchmethod, and the given surface from setSearchSurface. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointInT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()=default
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr getIndices ()
 Get a pointer to the vector of indices used. More...
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointInT & operator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

bool initCompute () override
 
void detectKeypoints (PointCloudOut &output) override
 
void responseHarris (PointCloudOut &output) const
 gets the corner response for valid input points More...
 
void responseNoble (PointCloudOut &output) const
 
void responseLowe (PointCloudOut &output) const
 
void responseTomasi (PointCloudOut &output) const
 
void responseCurvature (PointCloudOut &output) const
 
void refineCorners (PointCloudOut &corners) const
 
void calculateNormalCovar (const pcl::Indices &neighbors, float *coefficients) const
 calculates the upper triangular part of unnormalized covariance matrix over the normals given by the indices. More...
 
- Protected Member Functions inherited from pcl::Keypoint< PointInT, PointOutT >
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
virtual void detectKeypoints (PointCloudOut &output)=0
 Abstract key point detection method. More...
 
- Protected Member Functions inherited from pcl::PCLBase< PointInT >
bool initCompute ()
 This method should get called before starting the actual computation. More...
 
bool deinitCompute ()
 This method should get called after finishing the actual computation. More...
 

Additional Inherited Members

- Protected Attributes inherited from pcl::Keypoint< PointInT, PointOutT >
std::string name_
 The key point detection method's name. More...
 
SearchMethod search_method_
 The search method template for indices. More...
 
SearchMethodSurface search_method_surface_
 The search method template for points. More...
 
PointCloudInConstPtr surface_
 An input point cloud describing the surface that is to be used for nearest neighbors estimation. More...
 
KdTreePtr tree_
 A pointer to the spatial search object. More...
 
double search_parameter_
 The actual search parameter (casted from either search_radius_ or k_). More...
 
double search_radius_
 The nearest neighbors search radius for each point. More...
 
int k_
 The number of K nearest neighbors to use for each point. More...
 
pcl::PointIndicesPtr keypoints_indices_
 Indices of the keypoints in the input cloud. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointInT >
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
bool use_indices_
 Set to true if point indices are used. More...
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...
 

Detailed Description

template<typename PointInT, typename PointOutT, typename NormalT = pcl::Normal>
class pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >

HarrisKeypoint3D uses the idea of 2D Harris keypoints, but instead of using image gradients, it uses surface normals.

Author
Suat Gedikli

Definition at line 51 of file harris_3d.h.

Member Typedef Documentation

◆ ConstPtr

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::ConstPtr = shared_ptr<const HarrisKeypoint3D<PointInT, PointOutT, NormalT> >

Definition at line 55 of file harris_3d.h.

◆ KdTree

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::KdTree = typename Keypoint<PointInT, PointOutT>::KdTree

Definition at line 59 of file harris_3d.h.

◆ PointCloudIn

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::PointCloudIn = typename Keypoint<PointInT, PointOutT>::PointCloudIn

Definition at line 57 of file harris_3d.h.

◆ PointCloudInConstPtr

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::PointCloudInConstPtr = typename PointCloudIn::ConstPtr

Definition at line 60 of file harris_3d.h.

◆ PointCloudN

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::PointCloudN = pcl::PointCloud<NormalT>

Definition at line 62 of file harris_3d.h.

◆ PointCloudNConstPtr

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::PointCloudNConstPtr = typename PointCloudN::ConstPtr

Definition at line 64 of file harris_3d.h.

◆ PointCloudNPtr

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::PointCloudNPtr = typename PointCloudN::Ptr

Definition at line 63 of file harris_3d.h.

◆ PointCloudOut

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::PointCloudOut = typename Keypoint<PointInT, PointOutT>::PointCloudOut

Definition at line 58 of file harris_3d.h.

◆ Ptr

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
using pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::Ptr = shared_ptr<HarrisKeypoint3D<PointInT, PointOutT, NormalT> >

Definition at line 54 of file harris_3d.h.

Member Enumeration Documentation

◆ ResponseMethod

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
enum pcl::HarrisKeypoint3D::ResponseMethod
Enumerator
HARRIS 
NOBLE 
LOWE 
TOMASI 
CURVATURE 

Definition at line 78 of file harris_3d.h.

Constructor & Destructor Documentation

◆ HarrisKeypoint3D()

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::HarrisKeypoint3D ( ResponseMethod  method = HARRIS,
float  radius = 0.01f,
float  threshold = 0.0f 
)
inline

Constructor.

Parameters
[in]methodthe method to be used to determine the corner responses
[in]radiusthe radius for normal estimation as well as for non maxima suppression
[in]thresholdthe threshold to filter out weak corners

Definition at line 85 of file harris_3d.h.

References pcl::Keypoint< PointInT, PointOutT >::name_, and pcl::Keypoint< PointInT, PointOutT >::search_radius_.

◆ ~HarrisKeypoint3D()

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::~HarrisKeypoint3D ( )
overridedefault

Empty destructor.

Member Function Documentation

◆ calculateNormalCovar()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::calculateNormalCovar ( const pcl::Indices neighbors,
float *  coefficients 
) const
protected

calculates the upper triangular part of unnormalized covariance matrix over the normals given by the indices.

Definition at line 103 of file harris_3d.hpp.

◆ detectKeypoints()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::detectKeypoints ( PointCloudOut output)
overrideprotected

◆ initCompute()

template<typename PointInT , typename PointOutT , typename NormalT >
bool pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::initCompute
overrideprotectedvirtual

◆ refineCorners()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::refineCorners ( PointCloudOut corners) const
protected

Definition at line 502 of file harris_3d.hpp.

◆ responseCurvature()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::responseCurvature ( PointCloudOut output) const
protected

Definition at line 439 of file harris_3d.hpp.

◆ responseHarris()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::responseHarris ( PointCloudOut output) const
protected

gets the corner response for valid input points

Definition at line 318 of file harris_3d.hpp.

References pcl::isFinite().

◆ responseLowe()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::responseLowe ( PointCloudOut output) const
protected

Definition at line 399 of file harris_3d.hpp.

References pcl::isFinite().

◆ responseNoble()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::responseNoble ( PointCloudOut output) const
protected

Definition at line 359 of file harris_3d.hpp.

References pcl::isFinite().

◆ responseTomasi()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::responseTomasi ( PointCloudOut output) const
protected

Definition at line 457 of file harris_3d.hpp.

References pcl::eigen33(), and pcl::isFinite().

◆ setInputCloud()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setInputCloud ( const PointCloudInConstPtr cloud)
override

Provide a pointer to the input dataset.

Parameters
[in]cloudthe const boost shared pointer to a PointCloud message

Definition at line 52 of file harris_3d.hpp.

◆ setMethod()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setMethod ( ResponseMethod  type)

Set the method of the response to be calculated.

Parameters
[in]type

Definition at line 61 of file harris_3d.hpp.

◆ setNonMaxSupression()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setNonMaxSupression ( bool  nonmax = false)

Whether non maxima suppression should be applied or the response for each point should be returned.

Note
this value needs to be turned on in order to apply thresholding and refinement
Parameters
[in]nonmaxdefault is false

Definition at line 89 of file harris_3d.hpp.

◆ setNormals()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setNormals ( const PointCloudNConstPtr normals)

Set normals if precalculated normals are available.

Parameters
normals

Definition at line 96 of file harris_3d.hpp.

◆ setNumberOfThreads()

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setNumberOfThreads ( unsigned int  nr_threads = 0)
inline

Initialize the scheduler and set the number of threads to use.

Parameters
nr_threadsthe number of hardware threads to use (0 sets the value back to automatic)

Definition at line 155 of file harris_3d.h.

◆ setRadius()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setRadius ( float  radius)

Set the radius for normal estimation and non maxima suppression.

Parameters
[in]radius

Definition at line 75 of file harris_3d.hpp.

◆ setRefine()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setRefine ( bool  do_refine)

Whether the detected key points should be refined or not.

If turned of, the key points are a subset of the original point cloud. Otherwise the key points may be arbitrary.

note non maxima suppression needs to be on in order to use this feature.

Parameters
[in]do_refine

Definition at line 82 of file harris_3d.hpp.

◆ setSearchSurface()

template<typename PointInT , typename PointOutT , typename NormalT = pcl::Normal>
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setSearchSurface ( const PointCloudInConstPtr cloud)
inlineoverride

Provide a pointer to a dataset to add additional information to estimate the features for every point in the input dataset.

This is optional, if this is not set, it will only use the data in the input cloud to estimate the features. This is useful when you only need to compute the features for a downsampled cloud.

Parameters
[in]clouda pointer to a PointCloud message

Definition at line 149 of file harris_3d.h.

References pcl::Keypoint< PointInT, PointOutT >::surface_.

◆ setThreshold()

template<typename PointInT , typename PointOutT , typename NormalT >
void pcl::HarrisKeypoint3D< PointInT, PointOutT, NormalT >::setThreshold ( float  threshold)

Set the threshold value for detecting corners.

This is only evaluated if non maxima suppression is turned on.

note non maxima suppression needs to be activated in order to use this feature.

Parameters
[in]threshold

Definition at line 68 of file harris_3d.hpp.


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