41#ifndef PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_ORGANIZED_PROJECTION_IMPL_HPP_
42#define PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_ORGANIZED_PROJECTION_IMPL_HPP_
48template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar>
61 PCL_WARN(
"[pcl::registration::%s::initCompute] Target cloud is not organized.\n",
75template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar>
83 correspondences.resize(
indices_->size());
84 std::size_t c_index = 0;
86 for (
const auto& src_idx : (*
indices_)) {
89 (*
input_)[src_idx].getVector4fMap());
90 Eigen::Vector3f p_src3(p_src[0], p_src[1], p_src[2]);
97 int u =
static_cast<int>(uv[0] / uv[2]);
98 int v =
static_cast<int>(uv[1] / uv[2]);
100 if (u >= 0 && u <
static_cast<int>(
target_->width) && v >= 0 &&
101 v <
static_cast<int>(
target_->height)) {
102 const PointTarget& pt_tgt =
target_->at(u, v);
109 double dist = (p_src3 - pt_tgt.getVector3fMap()).norm();
110 if (dist < max_distance)
112 src_idx, v *
target_->width + u,
static_cast<float>(dist));
117 correspondences.resize(c_index);
120template <
typename Po
intSource,
typename Po
intTarget,
typename Scalar>
PointCloudConstPtr input_
PointCloudTargetConstPtr target_
bool initCompute()
Internal computation initialization.
const std::string & getClassName() const
bool target_cloud_updated_
void determineCorrespondences(Correspondences &correspondences, double max_distance)
Computes the correspondences, applying a maximum Euclidean distance threshold.
Eigen::Matrix4f src_to_tgt_transformation_
Eigen::Matrix3f projection_matrix_
void determineReciprocalCorrespondences(Correspondences &correspondences, double max_distance)
Computes the correspondences, applying a maximum Euclidean distance threshold.
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
Correspondence represents a match between two entities (e.g., points, descriptors,...