1#ifndef PCL_TRACKING_IMPL_PARTICLE_OMP_FILTER_H_
2#define PCL_TRACKING_IMPL_PARTICLE_OMP_FILTER_H_
4#include <pcl/tracking/particle_filter_omp.h>
9template <
typename Po
intInT,
typename StateT>
15 threads_ = omp_get_num_procs();
20 threads_ = nr_threads;
24template <
typename Po
intInT,
typename StateT>
30#pragma omp parallel for \
34 for (
int i = 0; i < particle_num_; i++)
35 this->computeTransformedPointCloudWithoutNormal((*particles_)[i],
36 *transed_reference_vector_[i]);
39 this->cropInputPointCloud(input_, *coherence_input);
40 if (change_counter_ == 0) {
42 if (!use_change_detector_ || this->testChangeDetection(coherence_input)) {
44 change_counter_ = change_detector_interval_;
45 coherence_->setTargetCloud(coherence_input);
46 coherence_->initCompute();
48#pragma omp parallel for \
52 for (
int i = 0; i < particle_num_; i++) {
55 transed_reference_vector_[i], indices, (*particles_)[i].weight);
63 coherence_->setTargetCloud(coherence_input);
64 coherence_->initCompute();
66#pragma omp parallel for \
70 for (
int i = 0; i < particle_num_; i++) {
73 transed_reference_vector_[i], indices, (*particles_)[i].weight);
78 std::vector<IndicesPtr> indices_list(particle_num_);
79 for (
int i = 0; i < particle_num_; i++) {
83#pragma omp parallel for \
85 shared(indices_list) \
88 for (
int i = 0; i < particle_num_; i++) {
89 this->computeTransformedPointCloudWithNormal(
90 (*particles_)[i], *indices_list[i], *transed_reference_vector_[i]);
94 this->cropInputPointCloud(input_, *coherence_input);
96 coherence_->setTargetCloud(coherence_input);
97 coherence_->initCompute();
99#pragma omp parallel for \
101 shared(indices_list) \
102 num_threads(threads_)
104 for (
int i = 0; i < particle_num_; i++) {
106 transed_reference_vector_[i], indices_list[i], (*particles_)[i].weight);
115#define PCL_INSTANTIATE_ParticleFilterOMPTracker(T, ST) \
116 template class PCL_EXPORTS pcl::tracking::ParticleFilterOMPTracker<T, ST>;
typename PointCloudIn::Ptr PointCloudInPtr
void weight() override
weighting phase of particle filter method.
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
IndicesAllocator<> Indices
Type used for indices in PCL.
shared_ptr< Indices > IndicesPtr