41 #ifndef PCL_FEATURES_IMPL_NORMAL_3D_OMP_H_
42 #define PCL_FEATURES_IMPL_NORMAL_3D_OMP_H_
44 #include <pcl/features/normal_3d_omp.h>
47 template <
typename Po
intInT,
typename Po
intOutT>
void
52 threads_ = omp_get_num_procs();
57 threads_ = nr_threads;
61 template <
typename Po
intInT,
typename Po
intOutT>
void
67 std::vector<float> nn_dists (k_);
69 output.is_dense =
true;
73 #pragma omp parallel for \
76 firstprivate(nn_indices, nn_dists) \
79 for (std::ptrdiff_t idx = 0; idx < static_cast<std::ptrdiff_t> (indices_->size ()); ++idx)
82 if (this->searchForNeighbors ((*indices_)[idx], search_parameter_, nn_indices, nn_dists) == 0 ||
85 output[idx].normal[0] = output[idx].normal[1] = output[idx].normal[2] = output[idx].curvature = std::numeric_limits<float>::quiet_NaN ();
87 output.is_dense =
false;
91 output[idx].normal_x = n[0];
92 output[idx].normal_y = n[1];
93 output[idx].normal_z = n[2];
96 output[idx].normal[0], output[idx].normal[1], output[idx].normal[2]);
102 #pragma omp parallel for \
105 firstprivate(nn_indices, nn_dists) \
106 num_threads(threads_)
108 for (std::ptrdiff_t idx = 0; idx < static_cast<std::ptrdiff_t> (indices_->size ()); ++idx)
111 if (!isFinite ((*input_)[(*indices_)[idx]]) ||
112 this->searchForNeighbors ((*indices_)[idx], search_parameter_, nn_indices, nn_dists) == 0 ||
115 output[idx].normal[0] = output[idx].normal[1] = output[idx].normal[2] = output[idx].curvature = std::numeric_limits<float>::quiet_NaN ();
117 output.is_dense =
false;
121 output[idx].normal_x = n[0];
122 output[idx].normal_y = n[1];
123 output[idx].normal_z = n[2];
126 output[idx].normal[0], output[idx].normal[1], output[idx].normal[2]);
132 #define PCL_INSTANTIATE_NormalEstimationOMP(T,NT) template class PCL_EXPORTS pcl::NormalEstimationOMP<T,NT>;
134 #endif // PCL_FEATURES_IMPL_NORMAL_3D_OMP_H_