particle_filter_omp.h
#ifndef PCL_TRACKING_PARTICLE_FILTER_OMP_H_
#define PCL_TRACKING_PARTICLE_FILTER_OMP_H_
#include <pcl/tracking/tracking.h>
#include <pcl/tracking/particle_filter.h>
#include <pcl/tracking/coherence.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;
typedef Tracker<PointInT, StateT> BaseClass;
typedef typename Tracker<PointInT, StateT>::PointCloudIn PointCloudIn;
typedef typename PointCloudIn::Ptr PointCloudInPtr;
typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr;
typedef typename Tracker<PointInT, StateT>::PointCloudState PointCloudState;
typedef typename PointCloudState::Ptr PointCloudStatePtr;
typedef typename PointCloudState::ConstPtr PointCloudStateConstPtr;
typedef PointCoherence<PointInT> Coherence;
typedef boost::shared_ptr< Coherence > CoherencePtr;
typedef boost::shared_ptr< const Coherence > CoherenceConstPtr;
typedef PointCloudCoherence<PointInT> CloudCoherence;
typedef boost::shared_ptr< CloudCoherence > CloudCoherencePtr;
typedef boost::shared_ptr< const CloudCoherence > CloudCoherenceConstPtr;
/** \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> ()
, threads_ (nr_threads)
{
tracker_name_ = "ParticleFilterOMPTracker";
}
/** \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)
*/
inline void
setNumberOfThreads (unsigned int nr_threads = 0) { threads_ = nr_threads; }
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.
*/
virtual void weight ();
};
}
}
//#include <pcl/tracking/impl/particle_filter_omp.hpp>
#ifdef PCL_NO_PRECOMPILE
#include <pcl/tracking/impl/particle_filter_omp.hpp>
#endif
#endif
pcl::tracking::ParticleFilterOMPTracker::Coherence
PointCoherence< PointInT > Coherence
Definition: particle_filter_omp.h:54
pcl::tracking::ParticleFilterOMPTracker::PointCloudInConstPtr
PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: particle_filter_omp.h:48
pcl::tracking::ParticleFilterOMPTracker::PointCloudStatePtr
PointCloudState::Ptr PointCloudStatePtr
Definition: particle_filter_omp.h:51
pcl
Definition: convolution.h:45
pcl::tracking::ParticleFilterOMPTracker::weight
virtual void weight()
weighting phase of particle filter method.
Definition: particle_filter_omp.hpp:7
pcl::tracking::ParticleFilterOMPTracker::PointCloudStateConstPtr
PointCloudState::ConstPtr PointCloudStateConstPtr
Definition: particle_filter_omp.h:52
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.h:76
pcl::tracking::ParticleFilterOMPTracker::CoherencePtr
boost::shared_ptr< Coherence > CoherencePtr
Definition: particle_filter_omp.h:55
pcl::tracking::ParticleFilterTracker
ParticleFilterTracker tracks the PointCloud which is given by setReferenceCloud within the measured P...
Definition: particle_filter.h:22
pcl::tracking::ParticleFilterOMPTracker::CloudCoherenceConstPtr
boost::shared_ptr< const CloudCoherence > CloudCoherenceConstPtr
Definition: particle_filter_omp.h:60
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:65
pcl::tracking::ParticleFilterOMPTracker::CloudCoherence
PointCloudCoherence< PointInT > CloudCoherence
Definition: particle_filter_omp.h:58
pcl::PointCloud< PointInT >::Ptr
boost::shared_ptr< PointCloud< PointInT > > Ptr
Definition: point_cloud.h:428
pcl::tracking::ParticleFilterOMPTracker::PointCloudInPtr
PointCloudIn::Ptr PointCloudInPtr
Definition: particle_filter_omp.h:47
pcl::tracking::ParticleFilterOMPTracker::CloudCoherencePtr
boost::shared_ptr< CloudCoherence > CloudCoherencePtr
Definition: particle_filter_omp.h:59
pcl::tracking::ParticleFilterOMPTracker::BaseClass
Tracker< PointInT, StateT > BaseClass
Definition: particle_filter_omp.h:44
pcl::tracking::PointCoherence
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:17
pcl::tracking::ParticleFilterOMPTracker::CoherenceConstPtr
boost::shared_ptr< const Coherence > CoherenceConstPtr
Definition: particle_filter_omp.h:56
pcl::PointCloud< PointInT >::ConstPtr
boost::shared_ptr< const PointCloud< PointInT > > ConstPtr
Definition: point_cloud.h:429
pcl::tracking::ParticleFilterOMPTracker::PointCloudIn
Tracker< PointInT, StateT >::PointCloudIn PointCloudIn
Definition: particle_filter_omp.h:46
pcl::PointCloud< PointInT >
pcl::tracking::ParticleFilterOMPTracker::PointCloudState
Tracker< PointInT, StateT >::PointCloudState PointCloudState
Definition: particle_filter_omp.h:50
pcl::tracking::ParticleFilterOMPTracker
ParticleFilterOMPTracker tracks the PointCloud which is given by setReferenceCloud within the measure...
Definition: particle_filter_omp.h:19
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:60
pcl::tracking::Tracker
Tracker represents the base tracker class.
Definition: tracker.h:56
pcl::tracking::ParticleFilterOMPTracker::threads_
unsigned int threads_
The number of threads the scheduler should use.
Definition: particle_filter_omp.h:80
pcl::tracking::Tracker::tracker_name_
std::string tracker_name_
The tracker name.
Definition: tracker.h:92