@@ -108,8 +108,8 @@ FeatureExtractor::extract(const std::vector<Point> &scan, size_t scan_idx) const
108108 compute_normal (idx, scan, valid_mask);
109109 if (normal.has_value ()) {
110110 result_planar_tbb.emplace_back (
111- static_cast <double >(point.x ()) , static_cast <double >(point.y () ),
112- static_cast <double >(point.z () ), static_cast <double >(normal.value ().x ()),
111+ static_cast <double >(point.x ) , static_cast <double >(point.y ),
112+ static_cast <double >(point.z ), static_cast <double >(normal.value ().x ()),
113113 static_cast <double >(normal.value ().y ()),
114114 static_cast <double >(normal.value ().z ()), static_cast <size_t >(scan_idx));
115115 }
@@ -124,8 +124,8 @@ FeatureExtractor::extract(const std::vector<Point> &scan, size_t scan_idx) const
124124 for (const size_t &idx : point_indices) {
125125 const Point &point = scan[idx];
126126 result_point.emplace_back (
127- static_cast <double >(point.x ()) , static_cast <double >(point.y () ),
128- static_cast <double >(point.z () ), static_cast <size_t >(scan_idx));
127+ static_cast <double >(point.x ) , static_cast <double >(point.y ),
128+ static_cast <double >(point.z ), static_cast <size_t >(scan_idx));
129129 }
130130
131131 return std::make_tuple (result_planar, result_point);
@@ -244,14 +244,14 @@ FeatureExtractor::compute_curvature(const std::vector<Point> &scan,
244244 // If valid compute the curvature
245245 else {
246246 // Initialize with the difference term
247- double dx = -(2.0 * params.neighbor_points ) * scan[idx].x () ;
248- double dy = -(2.0 * params.neighbor_points ) * scan[idx].y () ;
249- double dz = -(2.0 * params.neighbor_points ) * scan[idx].z () ;
247+ double dx = -(2.0 * params.neighbor_points ) * scan[idx].x ;
248+ double dy = -(2.0 * params.neighbor_points ) * scan[idx].y ;
249+ double dz = -(2.0 * params.neighbor_points ) * scan[idx].z ;
250250 // Iterate over neighbors and accumulate
251251 for (size_t n = 1 ; n <= params.neighbor_points ; n++) {
252- dx = dx + scan[idx - n].x () + scan[idx + n].x () ;
253- dy = dy + scan[idx - n].y () + scan[idx + n].y () ;
254- dz = dz + scan[idx - n].z () + scan[idx + n].z () ;
252+ dx = dx + scan[idx - n].x + scan[idx + n].x ;
253+ dy = dy + scan[idx - n].y + scan[idx + n].y ;
254+ dz = dz + scan[idx - n].z + scan[idx + n].z ;
255255 }
256256 curvature.emplace_back (idx, dx * dx + dy * dy + dz * dz);
257257 }
@@ -313,7 +313,7 @@ FeatureExtractor::compute_normal(
313313 // std::printf("---- Found %zu neighbors\n", neighbors.size());
314314 Eigen::Matrix<T, Eigen::Dynamic, 3 > A (neighbors.size (), 3 );
315315 for (size_t j = 0 ; j < neighbors.size (); ++j) {
316- A.row (j) = neighbors[j] - point;
316+ A.row (j) = neighbors[j]. vec3 () - point. vec3 () ;
317317 }
318318 A /= neighbors.size ();
319319 Eigen::Matrix<T, 3 , 3 > Cov = A.transpose () * A;
@@ -410,7 +410,7 @@ FeatureExtractor::find_closest(const Point &point, const size_t &start,
410410 if (!valid_mask[idx]) {
411411 continue ;
412412 }
413- const double dist2 = (scan[idx] - point).squaredNorm ();
413+ const double dist2 = (scan[idx]. vec4 () - point. vec4 () ).squaredNorm ();
414414 if (dist2 < min_dist2) {
415415 min_dist2 = dist2;
416416 closest_point = idx;
@@ -427,7 +427,7 @@ void FeatureExtractor::find_neighbors(const size_t &idx,
427427 const auto &point = scan[idx];
428428 for (size_t i = 1 ; i <= params.neighbor_points ; i++) {
429429 const auto &neighbor = scan[idx + i];
430- const double range2 = (neighbor - point).squaredNorm ();
430+ const double range2 = (neighbor. vec4 () - point. vec4 () ).squaredNorm ();
431431 if (range2 < params.radius * params.radius ) {
432432 out.push_back (neighbor);
433433 } else {
@@ -438,7 +438,7 @@ void FeatureExtractor::find_neighbors(const size_t &idx,
438438 // search in the negative direction
439439 for (size_t i = 1 ; i <= params.neighbor_points ; i++) {
440440 const auto &neighbor = scan[idx - i];
441- const double range2 = (neighbor - point).squaredNorm ();
441+ const double range2 = (neighbor. vec4 () - point. vec4 () ).squaredNorm ();
442442 if (range2 < params.radius * params.radius ) {
443443 out.push_back (neighbor);
444444 } else {
0 commit comments