38 #ifndef PCL_REGISTRATION_IMPL_CORRESPONDENCE_ESTIMATION_NORMAL_SHOOTING_H_
39 #define PCL_REGISTRATION_IMPL_CORRESPONDENCE_ESTIMATION_NORMAL_SHOOTING_H_
44 template <
typename Po
intSource,
typename Po
intTarget,
typename NormalT>
void
53 PCL_WARN (
"[pcl::%s::compute] No input target dataset was given!\n", getClassName ().c_str ());
56 correspondences.resize (indices_->size ());
58 float min_dist = std::numeric_limits<float>::max ();
61 tree_->setInputCloud (target_);
63 std::vector<int> nn_indices (k_);
64 std::vector<float> nn_dists (k_);
68 for (
size_t i = 0; i < source_normals_->points.size (); i++)
70 float *normal = source_normals_->points[i].normal;
72 tree_->nearestKSearch (input_->points[i], k_, nn_indices, nn_dists);
75 min_dist = std::numeric_limits<float>::max ();
76 for (
size_t j = 0; j < nn_indices.size (); j++)
78 int q = nn_indices[j];
82 pt.x = target_->points[q].x - input_->points[i].x;
83 pt.y = target_->points[q].y - input_->points[i].y;
84 pt.z = target_->points[q].z - input_->points[i].z;
85 Eigen::Vector3d N (normal[0], normal[1], normal[2]);
86 Eigen::Vector3d V (pt.x, pt.y, pt.z);
87 Eigen::Vector3d C = N.cross (V);
95 if (min_dist > max_distance)
100 correspondences[i] = corr;