Loading...
Searching...
No Matches
particle_filter_omp.h
#pragma once
#include <pcl/tracking/coherence.h>
#include <pcl/tracking/particle_filter.h>
#include <pcl/tracking/tracking.h>
namespace pcl {
namespace tracking {
/** \brief @b ParticleFilterOMPTracker tracks the PointCloud which is given by
* setReferenceCloud within the measured PointCloud using particle filter method in
* parallel, using the OpenMP standard. \author Ryohei Ueda \ingroup tracking
*/
template <typename PointInT, typename StateT>
class ParticleFilterOMPTracker : public ParticleFilterTracker<PointInT, StateT> {
public:
using Tracker<PointInT, StateT>::tracker_name_;
using Tracker<PointInT, StateT>::search_;
using Tracker<PointInT, StateT>::input_;
using Tracker<PointInT, StateT>::indices_;
using Tracker<PointInT, StateT>::getClassName;
using ParticleFilterTracker<PointInT, StateT>::particles_;
using ParticleFilterTracker<PointInT, StateT>::change_detector_;
using ParticleFilterTracker<PointInT, StateT>::change_counter_;
using ParticleFilterTracker<PointInT, StateT>::change_detector_interval_;
using ParticleFilterTracker<PointInT, StateT>::use_change_detector_;
using ParticleFilterTracker<PointInT, StateT>::alpha_;
using ParticleFilterTracker<PointInT, StateT>::changed_;
using ParticleFilterTracker<PointInT, StateT>::coherence_;
using ParticleFilterTracker<PointInT, StateT>::use_normal_;
using ParticleFilterTracker<PointInT, StateT>::particle_num_;
using ParticleFilterTracker<PointInT, StateT>::change_detector_filter_;
using ParticleFilterTracker<PointInT, StateT>::transed_reference_vector_;
// using ParticleFilterTracker<PointInT, StateT>::calcLikelihood;
using ParticleFilterTracker<PointInT, StateT>::normalizeWeight;
using ParticleFilterTracker<PointInT, StateT>::normalizeParticleWeight;
using ParticleFilterTracker<PointInT, StateT>::calcBoundingBox;
using BaseClass = Tracker<PointInT, StateT>;
using PointCloudIn = typename Tracker<PointInT, StateT>::PointCloudIn;
using PointCloudInPtr = typename PointCloudIn::Ptr;
using PointCloudInConstPtr = typename PointCloudIn::ConstPtr;
using PointCloudState = typename Tracker<PointInT, StateT>::PointCloudState;
using PointCloudStatePtr = typename PointCloudState::Ptr;
using PointCloudStateConstPtr = typename PointCloudState::ConstPtr;
using Coherence = PointCoherence<PointInT>;
using CoherencePtr = typename Coherence::Ptr;
using CoherenceConstPtr = typename Coherence::ConstPtr;
using CloudCoherence = PointCloudCoherence<PointInT>;
using CloudCoherencePtr = typename CloudCoherence::Ptr;
using CloudCoherenceConstPtr = typename CloudCoherence::ConstPtr;
/** \brief Initialize the scheduler and set the number of threads to use.
* \param nr_threads the number of hardware threads to use (0 sets the value
* back to automatic)
*/
ParticleFilterOMPTracker(unsigned int nr_threads = 0)
: ParticleFilterTracker<PointInT, StateT>()
{
tracker_name_ = "ParticleFilterOMPTracker";
setNumberOfThreads(nr_threads);
}
/** \brief Initialize the scheduler and set the number of threads to use.
* \param nr_threads the number of hardware threads to use (0 sets the value
* back to automatic)
*/
void
setNumberOfThreads(unsigned int nr_threads = 0);
protected:
/** \brief The number of threads the scheduler should use. */
unsigned int threads_;
/** \brief weighting phase of particle filter method. calculate the likelihood of all
* of the particles and set the weights.
*/
void
weight() override;
};
} // namespace tracking
} // namespace pcl
//#include <pcl/tracking/impl/particle_filter_omp.hpp>
#ifdef PCL_NO_PRECOMPILE
#include <pcl/tracking/impl/particle_filter_omp.hpp>
#endif
pcl::PCLBase< PointInT >::input_
PointCloudConstPtr input_
The input point cloud dataset.
Definition pcl_base.h:147
pcl::PCLBase< PointInT >::indices_
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition pcl_base.h:150
pcl::PointCloud< PointInT >
pcl::tracking::ParticleFilterOMPTracker
ParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within the measure...
Definition particle_filter_omp.h:14
pcl::tracking::ParticleFilterOMPTracker::PointCloudStatePtr
typename PointCloudState::Ptr PointCloudStatePtr
Definition particle_filter_omp.h:45
pcl::tracking::ParticleFilterOMPTracker::BaseClass
Tracker< PointInT, StateT > BaseClass
Definition particle_filter_omp.h:38
pcl::tracking::ParticleFilterOMPTracker::CloudCoherence
PointCloudCoherence< PointInT > CloudCoherence
Definition particle_filter_omp.h:52
pcl::tracking::ParticleFilterOMPTracker::CoherenceConstPtr
typename Coherence::ConstPtr CoherenceConstPtr
Definition particle_filter_omp.h:50
pcl::tracking::ParticleFilterOMPTracker::PointCloudInPtr
typename PointCloudIn::Ptr PointCloudInPtr
Definition particle_filter_omp.h:41
pcl::tracking::ParticleFilterOMPTracker::CoherencePtr
typename Coherence::Ptr CoherencePtr
Definition particle_filter_omp.h:49
pcl::tracking::ParticleFilterOMPTracker::weight
void weight() override
weighting phase of particle filter method.
Definition particle_filter_omp.hpp:26
pcl::tracking::ParticleFilterOMPTracker::ParticleFilterOMPTracker
ParticleFilterOMPTracker(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition particle_filter_omp.h:60
pcl::tracking::ParticleFilterOMPTracker::CloudCoherencePtr
typename CloudCoherence::Ptr CloudCoherencePtr
Definition particle_filter_omp.h:53
pcl::tracking::ParticleFilterOMPTracker::PointCloudState
typename Tracker< PointInT, StateT >::PointCloudState PointCloudState
Definition particle_filter_omp.h:44
pcl::tracking::ParticleFilterOMPTracker::Coherence
PointCoherence< PointInT > Coherence
Definition particle_filter_omp.h:48
pcl::tracking::ParticleFilterOMPTracker::PointCloudIn
typename Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
Definition particle_filter_omp.h:40
pcl::tracking::ParticleFilterOMPTracker::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition particle_filter_omp.h:42
pcl::tracking::ParticleFilterOMPTracker::PointCloudStateConstPtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
Definition particle_filter_omp.h:46
pcl::tracking::ParticleFilterOMPTracker::CloudCoherenceConstPtr
typename CloudCoherence::ConstPtr CloudCoherenceConstPtr
Definition particle_filter_omp.h:54
pcl::tracking::ParticleFilterOMPTracker::threads_
unsigned int threads_
The number of threads the scheduler should use.
Definition particle_filter_omp.h:77
pcl::tracking::ParticleFilterOMPTracker::setNumberOfThreads
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition particle_filter_omp.hpp:11
pcl::tracking::ParticleFilterTracker
ParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the measured P...
Definition particle_filter.h:19
pcl::tracking::ParticleFilterTracker::calcBoundingBox
void calcBoundingBox(double &x_min, double &x_max, double &y_min, double &y_max, double &z_min, double &z_max)
Compute the parameters for the bounding box of hypothesis pointclouds.
Definition particle_filter.hpp:187
pcl::tracking::ParticleFilterTracker::coherence_
CloudCoherencePtr coherence_
A pointer to PointCloudCoherence.
Definition particle_filter.h:556
pcl::tracking::ParticleFilterTracker::changed_
bool changed_
A flag to be true when change of pointclouds is detected.
Definition particle_filter.h:615
pcl::tracking::ParticleFilterTracker::change_detector_filter_
unsigned int change_detector_filter_
Minimum points in a leaf when calling change detector.
Definition particle_filter.h:622
pcl::tracking::ParticleFilterTracker::change_detector_
pcl::octree::OctreePointCloudChangeDetector< PointInT >::Ptr change_detector_
Change detector used as a trigger to track.
Definition particle_filter.h:611
pcl::tracking::ParticleFilterTracker::transed_reference_vector_
std::vector< PointCloudInPtr > transed_reference_vector_
A list of the pointers to pointclouds.
Definition particle_filter.h:608
pcl::tracking::ParticleFilterTracker::change_counter_
unsigned int change_counter_
A counter to skip change detection.
Definition particle_filter.h:618
pcl::tracking::ParticleFilterTracker::alpha_
double alpha_
The weight to be used in normalization of the weights of the particles.
Definition particle_filter.h:579
pcl::tracking::ParticleFilterTracker::use_normal_
bool use_normal_
A flag to use normal or not.
Definition particle_filter.h:589
pcl::tracking::ParticleFilterTracker::particles_
PointCloudStatePtr particles_
A pointer to the particles
Definition particle_filter.h:553
pcl::tracking::ParticleFilterTracker::change_detector_interval_
unsigned int change_detector_interval_
The number of interval frame to run change detection.
Definition particle_filter.h:626
pcl::tracking::ParticleFilterTracker::normalizeParticleWeight
double normalizeParticleWeight(double w, double w_min, double w_max)
Normalize the weight of a particle using .
Definition particle_filter.h:246
pcl::tracking::ParticleFilterTracker::particle_num_
int particle_num_
The number of the particles.
Definition particle_filter.h:541
pcl::tracking::ParticleFilterTracker::use_change_detector_
bool use_change_detector_
The flag which will be true if using change detection.
Definition particle_filter.h:632
pcl::tracking::ParticleFilterTracker::normalizeWeight
virtual void normalizeWeight()
Normalize the weights of all the particels.
Definition particle_filter.hpp:117
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition coherence.h:59
pcl::tracking::PointCoherence
PointCoherence is a base class to compute coherence between the two points.
Definition coherence.h:15
pcl::tracking::Tracker
Tracker represents the base tracker class.
Definition tracker.h:55
pcl::tracking::Tracker::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition tracker.h:97
pcl::tracking::Tracker::search_
SearchPtr search_
A pointer to the spatial search object.
Definition tracker.h:93
pcl::tracking::Tracker::tracker_name_
std::string tracker_name_
The tracker name.
Definition tracker.h:90
pcl::tracking::Tracker::PointCloudState
pcl::PointCloud< StateT > PointCloudState
Definition tracker.h:74
pcl
Definition convolution.h:46