1 #ifndef PCL_TRACKING_IMPL_KLD_ADAPTIVE_PARTICLE_OMP_FILTER_H_
2 #define PCL_TRACKING_IMPL_KLD_ADAPTIVE_PARTICLE_OMP_FILTER_H_
4 #include <pcl/tracking/kld_adaptive_particle_filter_omp.h>
9 template <
typename Po
intInT,
typename StateT>
12 unsigned int nr_threads)
16 threads_ = omp_get_num_procs();
21 threads_ = nr_threads;
25 template <
typename Po
intInT,
typename StateT>
31 #pragma omp parallel for \
35 for (
int i = 0; i < particle_num_; i++)
36 this->computeTransformedPointCloudWithoutNormal((*particles_)[i],
37 *transed_reference_vector_[i]);
40 this->cropInputPointCloud(input_, *coherence_input);
41 if (change_counter_ == 0) {
43 if (!use_change_detector_ || this->testChangeDetection(coherence_input)) {
45 change_counter_ = change_detector_interval_;
46 coherence_->setTargetCloud(coherence_input);
47 coherence_->initCompute();
49 #pragma omp parallel for \
53 for (
int i = 0; i < particle_num_; i++) {
56 transed_reference_vector_[i], indices, (*particles_)[i].weight);
64 coherence_->setTargetCloud(coherence_input);
65 coherence_->initCompute();
67 #pragma omp parallel for \
71 for (
int i = 0; i < particle_num_; i++) {
74 transed_reference_vector_[i], indices, (*particles_)[i].weight);
79 std::vector<IndicesPtr> indices_list(particle_num_);
80 for (
int i = 0; i < particle_num_; i++) {
84 #pragma omp parallel for \
86 shared(indices_list) \
89 for (
int i = 0; i < particle_num_; i++) {
90 this->computeTransformedPointCloudWithNormal(
91 (*particles_)[i], *indices_list[i], *transed_reference_vector_[i]);
95 this->cropInputPointCloud(input_, *coherence_input);
97 coherence_->setTargetCloud(coherence_input);
98 coherence_->initCompute();
100 #pragma omp parallel for \
102 shared(indices_list) \
103 num_threads(threads_)
105 for (
int i = 0; i < particle_num_; i++) {
107 transed_reference_vector_[i], indices_list[i], (*particles_)[i].weight);
116 #define PCL_INSTANTIATE_KLDAdaptiveParticleFilterOMPTracker(T, ST) \
117 template class PCL_EXPORTS pcl::tracking::KLDAdaptiveParticleFilterOMPTracker<T, ST>;
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
void weight() override
weighting phase of particle filter method.
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
typename PointCloudIn::Ptr PointCloudInPtr
IndicesAllocator<> Indices
Type used for indices in PCL.
shared_ptr< Indices > IndicesPtr