Loading...
Searching...
No Matches
pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar > Class Template Reference
Module registration

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

using | PointCloudSource = pcl::PointCloud<PointSource>
using | PointCloudSourcePtr = typename PointCloudSource::Ptr
using | PointCloudSourceConstPtr = typename PointCloudSource::ConstPtr
using | PointCloudTarget = pcl::PointCloud<PointTarget>
using | PointCloudTargetPtr = typename PointCloudTarget::Ptr
using | PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr
using | Ptr
using | ConstPtr
Public Types inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >
using | Ptr
using | ConstPtr
using | KdTree
using | KdTreePtr
using | KdTreeConstPtr
using | KdTreeReciprocal
using | KdTreeReciprocalPtr
using | KdTreeReciprocalConstPtr
using | PointCloudSource
using | PointCloudSourcePtr
using | PointCloudSourceConstPtr
using | PointCloudTarget
using | PointCloudTargetPtr
using | PointCloudTargetConstPtr
using | PointRepresentationConstPtr
using | PointRepresentationReciprocalConstPtr
Public Types inherited from pcl::PCLBase< PointSource >
using | PointCloud
using | PointCloudPtr
using | PointCloudConstPtr
using | PointIndicesPtr
using | PointIndicesConstPtr

## Public Member Functions

| CorrespondenceEstimationOrganizedProjection ()
| Empty constructor that sets all the intrinsic calibration to the default Kinect values.
void | setFocalLengths (const float fx, const float fy)
| Sets the focal length parameters of the target camera.
void | getFocalLengths (float &fx, float &fy) const
| Reads back the focal length parameters of the target camera.
void | setCameraCenters (const float cx, const float cy)
| Sets the camera center parameters of the target camera.
void | getCameraCenters (float &cx, float &cy) const
| Reads back the camera center parameters of the target camera.
void | setSourceTransformation (const Eigen::Matrix4f &src_to_tgt_transformation)
| Sets the transformation from the source point cloud to the target point cloud.
Eigen::Matrix4f | getSourceTransformation () const
| Reads back the transformation from the source point cloud to the target point cloud.
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.
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.
void | determineCorrespondences (Correspondences &correspondences, double max_distance)
| Computes the correspondences, applying a maximum Euclidean distance threshold.
void | determineReciprocalCorrespondences (Correspondences &correspondences, double max_distance)
| Computes the correspondences, applying a maximum Euclidean distance threshold.
virtual CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >::Ptr | clone () const
| Clone and cast to CorrespondenceEstimationBase.
Public Member Functions inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >
| CorrespondenceEstimationBase ()
| Empty constructor.
| ~CorrespondenceEstimationBase () override=default
| Empty destructor.
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).
PointCloudSourceConstPtr const | getInputSource ()
| Get a pointer to the input point cloud dataset target.
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).
PointCloudTargetConstPtr const | getInputTarget ()
| Get a pointer to the input point cloud dataset target.
void | setNumberOfThreads (unsigned int nr_threads)
| Set the number of threads to use.
virtual bool | requiresSourceNormals () const
| See if this rejector requires source normals.
virtual void | setSourceNormals (pcl::PCLPointCloud2::ConstPtr)
| Abstract method for setting the source normals.
virtual bool | requiresTargetNormals () const
| See if this rejector requires target normals.
virtual void | setTargetNormals (pcl::PCLPointCloud2::ConstPtr)
| Abstract method for setting the target normals.
void | setIndicesSource (const IndicesPtr &indices)
| Provide a pointer to the vector of indices that represent the input source point cloud.
IndicesPtr const | getIndicesSource ()
| Get a pointer to the vector of indices used for the source dataset.
void | setIndicesTarget (const IndicesPtr &indices)
| Provide a pointer to the vector of indices that represent the input target point cloud.
IndicesPtr const | getIndicesTarget ()
| Get a pointer to the vector of indices used for the target dataset.
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.
KdTreePtr | getSearchMethodTarget () const
| Get a pointer to the search method used to find correspondences in the target cloud.
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).
KdTreeReciprocalPtr | getSearchMethodSource () const
| Get a pointer to the search method used to find correspondences in the source cloud.
void | setPointRepresentation (const PointRepresentationConstPtr &point_representation)
| Provide a boost shared pointer to the PointRepresentation for target cloud to be used when searching for nearest neighbors.
void | setPointRepresentationReciprocal (const PointRepresentationReciprocalConstPtr &point_representation_reciprocal)
| Provide a boost shared pointer to the PointRepresentation for source cloud to be used when searching for nearest neighbors.
Public Member Functions inherited from pcl::PCLBase< PointSource >
| PCLBase ()
| Empty constructor.
virtual | ~PCLBase ()=default
| Destructor.
virtual void | setInputCloud (const PointCloudConstPtr &cloud)
| Provide a pointer to the input dataset.
PointCloudConstPtr const | getInputCloud () const
| Get a pointer to the input point cloud dataset.
virtual void | setIndices (const IndicesPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
IndicesPtr | getIndices ()
| Get a pointer to the vector of indices used.
const PointSource & | operator[] (std::size_t pos) const
| Override PointCloud operator[] to shorten code.

## Protected Member Functions

bool | initCompute ()
Protected Member Functions inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >
const std::string & | getClassName () const
| Abstract class get name method.
bool | initCompute ()
| Internal computation initialization.
bool | initComputeReciprocal ()
| Internal computation initialization for reciprocal correspondences.
Protected Member Functions inherited from pcl::PCLBase< PointSource >
bool | initCompute ()
| This method should get called before starting the actual computation.
bool | deinitCompute ()
| This method should get called after finishing the actual computation.

## Protected Attributes

float | fx_ {525.f}
float | fy_ {525.f}
float | cx_ {319.5f}
float | cy_ {239.5f}
Eigen::Matrix4f | src_to_tgt_transformation_
float | depth_threshold_
Eigen::Matrix3f | projection_matrix_
Protected Attributes inherited from pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >
std::string | corr_name_
| The correspondence estimation method name.
KdTreePtr | tree_
| A pointer to the spatial search object used for the target dataset.
KdTreeReciprocalPtr | tree_reciprocal_
| A pointer to the spatial search object used for the source dataset.
PointCloudTargetConstPtr | target_
| The input point cloud dataset target.
IndicesPtr | target_indices_
| The target point cloud dataset indices.
PointRepresentationConstPtr | point_representation_
| The target point representation used (internal).
PointRepresentationReciprocalConstPtr | point_representation_reciprocal_
| The source point representation used (internal).
PointCloudTargetPtr | input_transformed_
| The transformed input source point cloud dataset.
std::vector< pcl::PCLPointField > | input_fields_
| The types of input point fields available.
bool | target_cloud_updated_
| Variable that stores whether we have a new target cloud, meaning we need to pre-process it again.
bool | source_cloud_updated_
| Variable that stores whether we have a new source cloud, meaning we need to pre-process it again.
bool | force_no_recompute_
| A flag which, if set, means the tree operating on the target cloud will never be recomputed.
bool | force_no_recompute_reciprocal_
| A flag which, if set, means the tree operating on the source cloud will never be recomputed.
unsigned int | num_threads_
Protected Attributes inherited from pcl::PCLBase< PointSource >
PointCloudConstPtr | input_
| The input point cloud dataset.
IndicesPtr | indices_
| A pointer to the vector of point indices to use.
bool | use_indices_
| Set to true if point indices are used.
bool | fake_indices_
| If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud.

## 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 60 of file correspondence_estimation_organized_projection.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::ConstPtr

Initial value:
shared_ptr<const CorrespondenceEstimationOrganizedProjection<PointSource,
PointTarget,
Scalar>>
pcl::registration::CorrespondenceEstimationOrganizedProjection::CorrespondenceEstimationOrganizedProjection
CorrespondenceEstimationOrganizedProjection()
Empty constructor that sets all the intrinsic calibration to the default Kinect values.
Definition correspondence_estimation_organized_projection.h:92

Definition at line 85 of file correspondence_estimation_organized_projection.h.

## PointCloudSource

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudSource = pcl::PointCloud<PointSource>

Definition at line 75 of file correspondence_estimation_organized_projection.h.

## PointCloudSourceConstPtr

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudSourceConstPtr = typename PointCloudSource::ConstPtr

Definition at line 77 of file correspondence_estimation_organized_projection.h.

## PointCloudSourcePtr

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudSourcePtr = typename PointCloudSource::Ptr

Definition at line 76 of file correspondence_estimation_organized_projection.h.

## PointCloudTarget

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudTarget = pcl::PointCloud<PointTarget>

Definition at line 79 of file correspondence_estimation_organized_projection.h.

## PointCloudTargetConstPtr

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudTargetConstPtr = typename PointCloudTarget::ConstPtr

Definition at line 81 of file correspondence_estimation_organized_projection.h.

## PointCloudTargetPtr

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::PointCloudTargetPtr = typename PointCloudTarget::Ptr

Definition at line 80 of file correspondence_estimation_organized_projection.h.

## Ptr

template<typename PointSource, typename PointTarget, typename Scalar = float>

using pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::Ptr

Initial value:
shared_ptr<
CorrespondenceEstimationOrganizedProjection<PointSource, PointTarget, Scalar>>

Definition at line 83 of file correspondence_estimation_organized_projection.h.

## Constructor & Destructor Documentation

## CorrespondenceEstimationOrganizedProjection()

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 92 of file correspondence_estimation_organized_projection.h.

References depth_threshold_, projection_matrix_, and src_to_tgt_transformation_.

Referenced by clone().

## Member Function Documentation

## clone()

template<typename PointSource, typename PointTarget, typename Scalar = float>

virtual CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >::Ptr pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::clone | ( |  | ) | const

inline virtual

Clone and cast to CorrespondenceEstimationBase.

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

Definition at line 208 of file correspondence_estimation_organized_projection.h.

References CorrespondenceEstimationOrganizedProjection().

## determineCorrespondences()

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

  [out] | correspondences | the found correspondences (index of query point, index of target point, distance)
  [in] | max_distance | Euclidean 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, float >.

Definition at line 77 of file correspondence_estimation_organized_projection.hpp.

References depth_threshold_, pcl::PCLBase< PointSource >::indices_, initCompute(), pcl::PCLBase< PointSource >::input_, pcl::isFinite(), projection_matrix_, src_to_tgt_transformation_, and pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >::target_.

Referenced by determineReciprocalCorrespondences().

## determineReciprocalCorrespondences()

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

  [out] | correspondences | the found correspondences (index of query and target point, distance)
  [in] | max_distance | Euclidean distance threshold above which correspondences will be rejected

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

Definition at line 122 of file correspondence_estimation_organized_projection.hpp.

References determineCorrespondences().

## getCameraCenters()

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] | cx | the x-coordinate of the camera center
  [out] | cy | the y-coordinate of the camera center

Definition at line 136 of file correspondence_estimation_organized_projection.h.

References cx_, and cy_.

## getDepthThreshold()

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 180 of file correspondence_estimation_organized_projection.h.

References depth_threshold_.

## getFocalLengths()

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] | fx | the focal length in pixels along the x-axis of the image
  [out] | fy | the focal length in pixels along the y-axis of the image

Definition at line 114 of file correspondence_estimation_organized_projection.h.

References fx_, and fy_.

## getSourceTransformation()

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 158 of file correspondence_estimation_organized_projection.h.

References src_to_tgt_transformation_.

## initCompute()

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 50 of file correspondence_estimation_organized_projection.hpp.

References cx_, cy_, fx_, fy_, pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >::getClassName(), pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, Scalar >::initCompute(), projection_matrix_, pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >::target_, and pcl::registration::CorrespondenceEstimationBase< PointSource, PointTarget, float >::target_cloud_updated_.

Referenced by determineCorrespondences().

## setCameraCenters()

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] | cx | the x-coordinate of the camera center
  [in] | cy | the y-coordinate of the camera center

Definition at line 125 of file correspondence_estimation_organized_projection.h.

References cx_, and cy_.

## setDepthThreshold()

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_threshold | the depth threshold

Definition at line 169 of file correspondence_estimation_organized_projection.h.

References depth_threshold_.

## setFocalLengths()

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] | fx | the focal length in pixels along the x-axis of the image
  [in] | fy | the focal length in pixels along the y-axis of the image

Definition at line 103 of file correspondence_estimation_organized_projection.h.

References fx_, and fy_.

## setSourceTransformation()

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_transformation | the transformation

Definition at line 148 of file correspondence_estimation_organized_projection.h.

References src_to_tgt_transformation_.

## Member Data Documentation

## cx_

template<typename PointSource, typename PointTarget, typename Scalar = float>

float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cx_ {319.5f}

protected

Definition at line 223 of file correspondence_estimation_organized_projection.h.

Referenced by getCameraCenters(), initCompute(), and setCameraCenters().

## cy_

template<typename PointSource, typename PointTarget, typename Scalar = float>

float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::cy_ {239.5f}

protected

Definition at line 223 of file correspondence_estimation_organized_projection.h.

Referenced by getCameraCenters(), initCompute(), and setCameraCenters().

## depth_threshold_

template<typename PointSource, typename PointTarget, typename Scalar = float>

float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::depth_threshold_

protected

Definition at line 225 of file correspondence_estimation_organized_projection.h.

Referenced by CorrespondenceEstimationOrganizedProjection(), determineCorrespondences(), getDepthThreshold(), and setDepthThreshold().

## fx_

template<typename PointSource, typename PointTarget, typename Scalar = float>

float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fx_ {525.f}

protected

Definition at line 222 of file correspondence_estimation_organized_projection.h.

Referenced by getFocalLengths(), initCompute(), and setFocalLengths().

## fy_

template<typename PointSource, typename PointTarget, typename Scalar = float>

float pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::fy_ {525.f}

protected

Definition at line 222 of file correspondence_estimation_organized_projection.h.

Referenced by getFocalLengths(), initCompute(), and setFocalLengths().

## projection_matrix_

template<typename PointSource, typename PointTarget, typename Scalar = float>

Eigen::Matrix3f pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::projection_matrix_

protected

Definition at line 227 of file correspondence_estimation_organized_projection.h.

Referenced by CorrespondenceEstimationOrganizedProjection(), determineCorrespondences(), and initCompute().

## src_to_tgt_transformation_

template<typename PointSource, typename PointTarget, typename Scalar = float>

Eigen::Matrix4f pcl::registration::CorrespondenceEstimationOrganizedProjection< PointSource, PointTarget, Scalar >::src_to_tgt_transformation_

protected

Definition at line 224 of file correspondence_estimation_organized_projection.h.

Referenced by CorrespondenceEstimationOrganizedProjection(), determineCorrespondences(), getSourceTransformation(), and setSourceTransformation().

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

- pcl/registration/correspondence_estimation_organized_projection.h
- pcl/registration/impl/correspondence_estimation_organized_projection.hpp