Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar > Class Template Reference

CorrespondenceEstimationOrganizedProjection computes correspondences by projecting the source point cloud onto the target point cloud using the camera intrinsic and extrinsic parameters. More...

#include <pcl/registration/correspondence_estimation_organized_projection.h>

+ Inheritance diagram for pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >:

Public Types

typedef pcl::PointCloud< PointSource > PointCloudSource
 
typedef PointCloudSource::Ptr PointCloudSourcePtr
 
typedef PointCloudSource::ConstPtr PointCloudSourceConstPtr
 
typedef pcl::PointCloud< PointTarget > PointCloudTarget
 
typedef PointCloudTarget::Ptr PointCloudTargetPtr
 
typedef PointCloudTarget::ConstPtr PointCloudTargetConstPtr
 
typedef boost::shared_ptr< CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar > > Ptr
 
typedef boost::shared_ptr< const CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar > > ConstPtr
 
- Public Types inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >
typedef boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > Ptr
 
typedef boost::shared_ptr< const CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > ConstPtr
 
typedef pcl::search::KdTree< PointTarget > KdTree
 
typedef KdTree::Ptr KdTreePtr
 
typedef pcl::search::KdTree< PointSource > KdTreeReciprocal
 
typedef KdTree::Ptr KdTreeReciprocalPtr
 
typedef pcl::PointCloud< PointSource > PointCloudSource
 
typedef PointCloudSource::Ptr PointCloudSourcePtr
 
typedef PointCloudSource::ConstPtr PointCloudSourceConstPtr
 
typedef pcl::PointCloud< PointTarget > PointCloudTarget
 
typedef PointCloudTarget::Ptr PointCloudTargetPtr
 
typedef PointCloudTarget::ConstPtr PointCloudTargetConstPtr
 
typedef KdTree::PointRepresentationConstPtr PointRepresentationConstPtr
 
- Public Types inherited from pcl::PCLBase< PointSource >
typedef pcl::PointCloud< PointSource > PointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr< PointIndicesPointIndicesPtr
 
typedef boost::shared_ptr< PointIndices const > PointIndicesConstPtr
 

Public Member Functions

 CorrespondenceEstimationOrganizedProjection ()
 Empty constructor that sets all the intrinsic calibration to the default Kinect values. More...
 
void setFocalLengths (const float fx, const float fy)
 Sets the focal length parameters of the target camera. More...
 
void getFocalLengths (float &fx, float &fy) const
 Reads back the focal length parameters of the target camera. More...
 
void setCameraCenters (const float cx, const float cy)
 Sets the camera center parameters of the target camera. More...
 
void getCameraCenters (float &cx, float &cy) const
 Reads back the camera center parameters of the target camera. More...
 
void setSourceTransformation (const Eigen::Matrix4f &src_to_tgt_transformation)
 Sets the transformation from the source point cloud to the target point cloud. More...
 
Eigen::Matrix4f getSourceTransformation () const
 Reads back the transformation from the source point cloud to the target point cloud. More...
 
void setDepthThreshold (const float depth_threshold)
 Sets the depth threshold; after projecting the source points in the image space of the target camera, this threshold is applied on the depths of corresponding dexels to eliminate the ones that are too far from each other. More...
 
float getDepthThreshold () const
 Reads back the depth threshold; after projecting the source points in the image space of the target camera, this threshold is applied on the depths of corresponding dexels to eliminate the ones that are too far from each other. More...
 
void determineCorrespondences (Correspondences &correspondences, double max_distance)
 Computes the correspondences, applying a maximum Euclidean distance threshold. More...
 
void determineReciprocalCorrespondences (Correspondences &correspondences, double max_distance)
 Computes the correspondences, applying a maximum Euclidean distance threshold. More...
 
virtual boost::shared_ptr< CorrespondenceEstimationBase< PointSource, PointTarget, Scalar > > clone () const
 Clone and cast to CorrespondenceEstimationBase. More...
 
- Public Member Functions inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >
 CorrespondenceEstimationBase ()
 Empty constructor. More...
 
virtual ~CorrespondenceEstimationBase ()
 Empty destructor. More...
 
void setInputSource (const PointCloudSourceConstPtr &cloud)
 Provide a pointer to the input source (e.g., the point cloud that we want to align to the target) More...
 
PointCloudSourceConstPtr const getInputSource ()
 Get a pointer to the input point cloud dataset target. More...
 
void setInputTarget (const PointCloudTargetConstPtr &cloud)
 Provide a pointer to the input target (e.g., the point cloud that we want to align the input source to) More...
 
PointCloudTargetConstPtr const getInputTarget ()
 Get a pointer to the input point cloud dataset target. More...
 
virtual bool requiresSourceNormals () const
 See if this rejector requires source normals. More...
 
virtual void setSourceNormals (pcl::PCLPointCloud2::ConstPtr)
 Abstract method for setting the source normals. More...
 
virtual bool requiresTargetNormals () const
 See if this rejector requires target normals. More...
 
virtual void setTargetNormals (pcl::PCLPointCloud2::ConstPtr)
 Abstract method for setting the target normals. More...
 
void setIndicesSource (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represent the input source point cloud. More...
 
IndicesPtr const getIndicesSource ()
 Get a pointer to the vector of indices used for the source dataset. More...
 
void setIndicesTarget (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represent the input target point cloud. More...
 
IndicesPtr const getIndicesTarget ()
 Get a pointer to the vector of indices used for the target dataset. More...
 
void setSearchMethodTarget (const KdTreePtr &tree, bool force_no_recompute=false)
 Provide a pointer to the search object used to find correspondences in the target cloud. More...
 
KdTreePtr getSearchMethodTarget () const
 Get a pointer to the search method used to find correspondences in the target cloud. More...
 
void setSearchMethodSource (const KdTreeReciprocalPtr &tree, bool force_no_recompute=false)
 Provide a pointer to the search object used to find correspondences in the source cloud (usually used by reciprocal correspondence finding). More...
 
KdTreeReciprocalPtr getSearchMethodSource () const
 Get a pointer to the search method used to find correspondences in the source cloud. More...
 
void setPointRepresentation (const PointRepresentationConstPtr &point_representation)
 Provide a boost shared pointer to the PointRepresentation to be used when searching for nearest neighbors. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointSource >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()
 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 (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr const 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 PointSource & operator[] (size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

bool initCompute ()
 
- Protected Member Functions inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >
const std::string & getClassName () const
 Abstract class get name method. More...
 
bool initCompute ()
 Internal computation initialization. More...
 
bool initComputeReciprocal ()
 Internal computation initialization for reciprocal correspondences. More...
 
- Protected Member Functions inherited from pcl::PCLBase< PointSource >
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...
 

Protected Attributes

float fx_
 
float fy_
 
float cx_
 
float cy_
 
Eigen::Matrix4f src_to_tgt_transformation_
 
float depth_threshold_
 
Eigen::Matrix3f projection_matrix_
 
- Protected Attributes inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >
std::string corr_name_
 The correspondence estimation method name. More...
 
KdTreePtr tree_
 A pointer to the spatial search object used for the target dataset. More...
 
KdTreeReciprocalPtr tree_reciprocal_
 A pointer to the spatial search object used for the source dataset. More...
 
PointCloudTargetConstPtr target_
 The input point cloud dataset target. More...
 
IndicesPtr target_indices_
 The target point cloud dataset indices. More...
 
PointRepresentationConstPtr point_representation_
 The point representation used (internal). More...
 
PointCloudTargetPtr input_transformed_
 The transformed input source point cloud dataset. More...
 
std::vector< pcl::PCLPointFieldinput_fields_
 The types of input point fields available. More...
 
bool target_cloud_updated_
 Variable that stores whether we have a new target cloud, meaning we need to pre-process it again. More...
 
bool source_cloud_updated_
 Variable that stores whether we have a new source cloud, meaning we need to pre-process it again. More...
 
bool force_no_recompute_
 A flag which, if set, means the tree operating on the target cloud will never be recomputed. More...
 
bool force_no_recompute_reciprocal_
 A flag which, if set, means the tree operating on the source cloud will never be recomputed. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointSource >
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 PointSource, typename PointTarget, typename Scalar = float>
class pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >

CorrespondenceEstimationOrganizedProjection computes correspondences by projecting the source point cloud onto the target point cloud using the camera intrinsic and extrinsic parameters.

The correspondences can be trimmed by a depth threshold and by a distance threshold. It is not as precise as a nearest neighbor search, but it is much faster, as it avoids the usage of any additional structures (i.e., kd-trees).

Note
The target point cloud must be organized (no restrictions on the source) and the target point cloud must be given in the camera coordinate frame. Any other transformation is specified by the src_to_tgt_transformation_ variable.
Author
Alex Ichim

Definition at line 59 of file correspondence_estimation_organized_projection.h.

Member Typedef Documentation

template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef boost::shared_ptr< const CorrespondenceEstimationOrganizedProjection<PointSource, PointTarget, Scalar> > pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::ConstPtr
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef pcl::PointCloud<PointSource> pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudSource
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef PointCloudSource::ConstPtr pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudSourceConstPtr
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef PointCloudSource::Ptr pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudSourcePtr
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef pcl::PointCloud<PointTarget> pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudTarget
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef PointCloudTarget::ConstPtr pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudTargetConstPtr
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef PointCloudTarget::Ptr pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudTargetPtr
template<typename PointSource , typename PointTarget , typename Scalar = float>
typedef boost::shared_ptr< CorrespondenceEstimationOrganizedProjection<PointSource, PointTarget, Scalar> > pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::Ptr

Constructor & Destructor Documentation

template<typename PointSource , typename PointTarget , typename Scalar = float>
pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::CorrespondenceEstimationOrganizedProjection ( )
inline

Empty constructor that sets all the intrinsic calibration to the default Kinect values.

Definition at line 85 of file correspondence_estimation_organized_projection.h.

Member Function Documentation

template<typename PointSource , typename PointTarget , typename Scalar = float>
virtual boost::shared_ptr< CorrespondenceEstimationBase<PointSource, PointTarget, Scalar> > pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::clone ( ) const
inlinevirtual
template<typename PointSource , typename PointTarget , typename Scalar >
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::determineCorrespondences ( pcl::Correspondences correspondences,
double  max_distance 
)
virtual

Computes the correspondences, applying a maximum Euclidean distance threshold.

Parameters
correspondences
[in]max_distanceEuclidean distance threshold above which correspondences will be rejected

Check if the point was behind the camera

Check if the depth difference is larger than the threshold

Implements pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >.

Definition at line 71 of file correspondence_estimation_organized_projection.hpp.

References pcl::isFinite().

Referenced by pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::getDepthThreshold().

template<typename PointSource , typename PointTarget , typename Scalar >
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::determineReciprocalCorrespondences ( pcl::Correspondences correspondences,
double  max_distance 
)
virtual

Computes the correspondences, applying a maximum Euclidean distance threshold.

Parameters
correspondences
[in]max_distanceEuclidean distance threshold above which correspondences will be rejected

Implements pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >.

Definition at line 118 of file correspondence_estimation_organized_projection.hpp.

Referenced by pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::getDepthThreshold().

template<typename PointSource , typename PointTarget , typename Scalar = float>
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::getCameraCenters ( float &  cx,
float &  cy 
) const
inline

Reads back the camera center parameters of the target camera.

Parameters
[out]cxthe x-coordinate of the camera center
[out]cythe y-coordinate of the camera center

Definition at line 126 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cx_, and pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cy_.

template<typename PointSource , typename PointTarget , typename Scalar = float>
float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::getDepthThreshold ( ) const
inline

Reads back the depth threshold; after projecting the source points in the image space of the target camera, this threshold is applied on the depths of corresponding dexels to eliminate the ones that are too far from each other.

Returns
the depth threshold

Definition at line 162 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::depth_threshold_, pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::determineCorrespondences(), and pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::determineReciprocalCorrespondences().

template<typename PointSource , typename PointTarget , typename Scalar = float>
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::getFocalLengths ( float &  fx,
float &  fy 
) const
inline

Reads back the focal length parameters of the target camera.

Parameters
[out]fxthe focal length in pixels along the x-axis of the image
[out]fythe focal length in pixels along the y-axis of the image

Definition at line 109 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fx_, and pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fy_.

template<typename PointSource , typename PointTarget , typename Scalar = float>
Eigen::Matrix4f pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::getSourceTransformation ( ) const
inline

Reads back the transformation from the source point cloud to the target point cloud.

Note
The target point cloud must be in its local camera coordinates, so use this transformation to correct for that.
Returns
the transformation

Definition at line 144 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::src_to_tgt_transformation_.

template<typename PointSource , typename PointTarget , typename Scalar >
bool pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::initCompute ( )
protected

Check if the target cloud is organized

Put the projection matrix together

Definition at line 46 of file correspondence_estimation_organized_projection.hpp.

Referenced by pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::clone().

template<typename PointSource , typename PointTarget , typename Scalar = float>
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::setCameraCenters ( const float  cx,
const float  cy 
)
inline

Sets the camera center parameters of the target camera.

Parameters
[in]cxthe x-coordinate of the camera center
[in]cythe y-coordinate of the camera center

Definition at line 118 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cx_, and pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cy_.

template<typename PointSource , typename PointTarget , typename Scalar = float>
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::setDepthThreshold ( const float  depth_threshold)
inline

Sets the depth threshold; after projecting the source points in the image space of the target camera, this threshold is applied on the depths of corresponding dexels to eliminate the ones that are too far from each other.

Parameters
[in]depth_thresholdthe depth threshold

Definition at line 153 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::depth_threshold_.

template<typename PointSource , typename PointTarget , typename Scalar = float>
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::setFocalLengths ( const float  fx,
const float  fy 
)
inline

Sets the focal length parameters of the target camera.

Parameters
[in]fxthe focal length in pixels along the x-axis of the image
[in]fythe focal length in pixels along the y-axis of the image

Definition at line 101 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fx_, and pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fy_.

template<typename PointSource , typename PointTarget , typename Scalar = float>
void pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::setSourceTransformation ( const Eigen::Matrix4f &  src_to_tgt_transformation)
inline

Sets the transformation from the source point cloud to the target point cloud.

Note
The target point cloud must be in its local camera coordinates, so use this transformation to correct for that.
Parameters
[in]src_to_tgt_transformationthe transformation

Definition at line 135 of file correspondence_estimation_organized_projection.h.

References pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::src_to_tgt_transformation_.

Member Data Documentation

template<typename PointSource , typename PointTarget , typename Scalar = float>
float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cx_
protected
template<typename PointSource , typename PointTarget , typename Scalar = float>
float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cy_
protected
template<typename PointSource , typename PointTarget , typename Scalar = float>
float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::depth_threshold_
protected
template<typename PointSource , typename PointTarget , typename Scalar = float>
float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fx_
protected
template<typename PointSource , typename PointTarget , typename Scalar = float>
float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fy_
protected
template<typename PointSource , typename PointTarget , typename Scalar = float>
Eigen::Matrix3f pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::projection_matrix_
protected
template<typename PointSource , typename PointTarget , typename Scalar = float>
Eigen::Matrix4f pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::src_to_tgt_transformation_
protected

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