Point Cloud Library (PCL)
1.7.0
Main Page
Modules
Namespaces
Classes
tracking
include
pcl
tracking
particle_filter_omp.h
1
#ifndef PCL_TRACKING_PARTICLE_FILTER_OMP_H_
2
#define PCL_TRACKING_PARTICLE_FILTER_OMP_H_
3
4
#include <pcl/tracking/tracking.h>
5
#include <pcl/tracking/particle_filter.h>
6
#include <pcl/tracking/coherence.h>
7
8
namespace
pcl
9
{
10
namespace
tracking
11
{
12
/** \brief @b ParticleFilterOMPTracker tracks the PointCloud which is given by
13
setReferenceCloud within the measured PointCloud using particle filter method
14
in parallel, using the OpenMP standard.
15
* \author Ryohei Ueda
16
* \ingroup tracking
17
*/
18
template
<
typename
Po
int
InT,
typename
StateT>
19
class
ParticleFilterOMPTracker
:
public
ParticleFilterTracker
<PointInT, StateT>
20
{
21
public
:
22
using
Tracker<PointInT, StateT>::tracker_name_
;
23
using
Tracker<PointInT, StateT>::search_
;
24
using
Tracker<PointInT, StateT>::input_
;
25
using
Tracker<PointInT, StateT>::indices_
;
26
using
Tracker<PointInT, StateT>::getClassName
;
27
using
ParticleFilterTracker<PointInT, StateT>::particles_
;
28
using
ParticleFilterTracker<PointInT, StateT>::change_detector_
;
29
using
ParticleFilterTracker<PointInT, StateT>::change_counter_
;
30
using
ParticleFilterTracker<PointInT, StateT>::change_detector_interval_
;
31
using
ParticleFilterTracker<PointInT, StateT>::use_change_detector_
;
32
using
ParticleFilterTracker<PointInT, StateT>::alpha_
;
33
using
ParticleFilterTracker<PointInT, StateT>::changed_
;
34
using
ParticleFilterTracker<PointInT, StateT>::coherence_
;
35
using
ParticleFilterTracker<PointInT, StateT>::use_normal_
;
36
using
ParticleFilterTracker<PointInT, StateT>::particle_num_
;
37
using
ParticleFilterTracker<PointInT, StateT>::change_detector_filter_
;
38
using
ParticleFilterTracker<PointInT, StateT>::transed_reference_vector_
;
39
//using ParticleFilterTracker<PointInT, StateT>::calcLikelihood;
40
using
ParticleFilterTracker<PointInT, StateT>::normalizeWeight
;
41
using
ParticleFilterTracker<PointInT, StateT>::normalizeParticleWeight
;
42
using
ParticleFilterTracker<PointInT, StateT>::calcBoundingBox
;
43
44
typedef
Tracker<PointInT, StateT>
BaseClass
;
45
46
typedef
typename
Tracker<PointInT, StateT>::PointCloudIn
PointCloudIn
;
47
typedef
typename
PointCloudIn::Ptr
PointCloudInPtr
;
48
typedef
typename
PointCloudIn::ConstPtr
PointCloudInConstPtr
;
49
50
typedef
typename
Tracker<PointInT, StateT>::PointCloudState
PointCloudState
;
51
typedef
typename
PointCloudState::Ptr
PointCloudStatePtr
;
52
typedef
typename
PointCloudState::ConstPtr
PointCloudStateConstPtr
;
53
54
typedef
PointCoherence<PointInT>
Coherence
;
55
typedef
boost::shared_ptr< Coherence >
CoherencePtr
;
56
typedef
boost::shared_ptr< const Coherence >
CoherenceConstPtr
;
57
58
typedef
PointCloudCoherence<PointInT>
CloudCoherence
;
59
typedef
boost::shared_ptr< CloudCoherence >
CloudCoherencePtr
;
60
typedef
boost::shared_ptr< const CloudCoherence >
CloudCoherenceConstPtr
;
61
62
/** \brief Initialize the scheduler and set the number of threads to use.
63
* \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
64
*/
65
ParticleFilterOMPTracker
(
unsigned
int
nr_threads = 0)
66
:
ParticleFilterTracker
<PointInT, StateT> ()
67
,
threads_
(nr_threads)
68
{
69
tracker_name_
=
"ParticleFilterOMPTracker"
;
70
}
71
72
/** \brief Initialize the scheduler and set the number of threads to use.
73
* \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
74
*/
75
inline
void
76
setNumberOfThreads
(
unsigned
int
nr_threads = 0) {
threads_
= nr_threads; }
77
78
protected
:
79
/** \brief The number of threads the scheduler should use. */
80
unsigned
int
threads_
;
81
82
/** \brief weighting phase of particle filter method.
83
calculate the likelihood of all of the particles and set the weights.
84
*/
85
virtual
void
weight
();
86
87
};
88
}
89
}
90
91
//#include <pcl/tracking/impl/particle_filter_omp.hpp>
92
#ifdef PCL_NO_PRECOMPILE
93
#include <pcl/tracking/impl/particle_filter_omp.hpp>
94
#endif
95
96
#endif