Point Cloud Library (PCL)  1.9.1
pyramidal_klt.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2014-, Open Perception.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 #ifndef PCL_TRACKING_PYRAMIDAL_KLT_H
39 #define PCL_TRACKING_PYRAMIDAL_KLT_H
40 
41 #include <pcl/point_types.h>
42 #include <pcl/tracking/tracker.h>
43 #include <pcl/common/intensity.h>
44 #include <pcl/common/transformation_from_correspondences.h>
45 
46 namespace pcl
47 {
48  namespace tracking
49  {
50  /** Pyramidal Kanade Lucas Tomasi tracker.
51  * This is an implementation of the Pyramidal Kanade Lucas Tomasi tracker that operates on
52  * organized 3D keypoints with color/intensity information (this is the default behaviour but you
53  * can alterate it by providing another operator as second template argument). It is an affine
54  * tracker that iteratively computes the optical flow to find the best guess for a point p at t
55  * given its location at t-1.
56  * User is advised to respect the Tomasi condition: the response computed is the maximum eigenvalue
57  * of the second moment matrix but no restrictin are applied to points to track so you can use a
58  * detector of your choice to indicate points to track.
59  *
60  * \author Nizar Sallem
61  */
62  template<typename PointInT, typename IntensityT = pcl::common::IntensityFieldAccessor<PointInT> >
63  class PyramidalKLTTracker : public Tracker<PointInT, Eigen::Affine3f>
64  {
65  public:
73 
75  using TrackerBase::input_;
77 
78  /// Constructor
79  PyramidalKLTTracker (int nb_levels = 5, int tracking_window_width = 7, int tracking_window_height = 7)
80  : ref_ ()
81  , nb_levels_ (nb_levels)
82  , track_width_ (tracking_window_width)
83  , track_height_ (tracking_window_height)
84  , threads_ (0)
85  , initialized_ (false)
86  {
87  tracker_name_ = "PyramidalKLTTracker";
88  accuracy_ = 0.1;
89  epsilon_ = 1e-3;
90  max_iterations_ = 10;
91  keypoints_nbr_ = 100;
93  kernel_ << 1.f/16 ,1.f/4 ,3.f/8 ,1.f/4 ,1.f/16;
94  kernel_size_2_ = kernel_.size () / 2;
95  kernel_last_ = kernel_.size () -1;
96  }
97 
98  /// Destructor
99  virtual ~PyramidalKLTTracker () {}
100 
101  /** \brief Set the number of pyramid levels
102  * \param levels desired number of pyramid levels
103  */
104  inline void
105  setNumberOfPyramidLevels (int levels) { nb_levels_ = levels; }
106 
107  /// \brief \return the number of pyramid levels
108  inline int
109  getNumberOfPyramidLevels () const { return (nb_levels_); }
110 
111  /** Set accuracy
112  * \param[in] accuracy desired accuracy.
113  */
114  inline void
115  setAccuracy (float accuracy) { accuracy_ = accuracy; }
116 
117  /// \return the accuracy
118  inline float
119  getAccuracy () const { return (accuracy_); }
120 
121  /** Set epsilon
122  * \param[in] epsilon desired epsilon.
123  */
124  inline void
125  setEpsilon (float epsilon) { epsilon_ = epsilon; }
126 
127  /// \return the epsilon
128  inline float
129  getEpsilon () const { return (epsilon_); }
130 
131  /** \brief Set the maximum number of points to track. Only the first keypoints_nbr_
132  * are used as points to track after sorting detected keypoints according to their
133  * response measure.
134  * \param[in] number the desired number of points to detect.
135  */
136  inline void
137  setNumberOfKeypoints (std::size_t number) { keypoints_nbr_ = number; }
138 
139  /// \return the maximum number of keypoints to keep
140  inline std::size_t
142 
143  /** \brief set the tracking window size
144  * \param[in] width the tracking window width
145  * \param[in] height the tracking window height
146  */
147  inline void
148  setTrackingWindowSize (int width, int height);
149 
150  /// \brief Set tracking window width
151  inline void
152  setTrackingWindowWidth (int width) {track_width_ = width; };
153 
154  /// \brief \return the tracking window size
155  inline int
157 
158  /// \brief Set tracking window height
159  inline void
160  setTrackingWindowHeight (int height) {track_height_ = height; };
161 
162  /// \brief \return the tracking window size
163  inline int
165 
166  /** \brief Initialize the scheduler and set the number of threads to use.
167  * \param nr_threads the number of hardware threads to use (0 sets the value back to
168  * automatic).
169  */
170  inline void
171  setNumberOfThreads (unsigned int nr_threads = 0) { threads_ = nr_threads; }
172 
173  /** \brief Get a pointer of the cloud at t-1. */
174  inline PointCloudInConstPtr
175  getReferenceCloud () const { return (ref_); }
176 
177  /** \brief Set the maximum number of iterations in the Lucas Kanade loop.
178  * \param[in] max the desired maximum number of iterations
179  */
180  inline void
181  setMaxIterationsNumber (unsigned int max) { max_iterations_ = max; }
182 
183  /// \brief \return the maximum iterations number
184  inline unsigned int
186 
187  /** \brief Provide a pointer to points to track.
188  * \param points the const boost shared pointer to a PointIndices message
189  */
190  inline void
192 
193  /** \brief Provide a pointer to points to track.
194  * \param points the const boost shared pointer to a PointIndices message
195  */
196  inline void
198 
199  /// \brief \return a pointer to the points successfully tracked.
201  getTrackedPoints () const { return (keypoints_); };
202 
203  /** \brief \return the status of points to track.
204  * Status == 0 --> points successfully tracked;
205  * Status < 0 --> point is lost;
206  * Status == -1 --> point is out of bond;
207  * Status == -2 --> optical flow can not be computed for this point.
208  */
211 
212  /** \brief Return the computed transformation from tracked points. */
213  Eigen::Affine3f
214  getResult () const { return (motion_); }
215 
216  /// \brief \return initialization state
217  bool
218  getInitialized () const { return (initialized_); }
219 
220  protected:
221  virtual bool
222  initCompute ();
223 
224  /** \brief compute Scharr derivatives of a source cloud.
225  * \param[in] src the image for which gradients are to be computed
226  * \param[out] grad_x image gradient along X direction
227  * \param[out] grad_y image gradient along Y direction
228  */
229  void
230  derivatives (const FloatImage& src, FloatImage& grad_x, FloatImage& grad_y) const;
231 
232  /** \brief downsample input
233  * \param[in] input the image to downsample
234  * \param[out] output the downsampled image
235  */
236  void
237  downsample (const FloatImageConstPtr& input, FloatImageConstPtr& output) const;
238 
239  /** \brief downsample input and compute output gradients.
240  * \param[in] input the image to downsample
241  * \param[out] output the downsampled image
242  * \param[out] output_grad_x downsampled image gradient along X direction
243  * \param[out] output_grad_y downsampled image gradient along Y direction
244  */
245  void
246  downsample (const FloatImageConstPtr& input, FloatImageConstPtr& output,
247  FloatImageConstPtr& output_grad_x, FloatImageConstPtr& output_grad_y) const;
248 
249  /** \brief Separately convolve image with decomposable convolution kernel.
250  * \param[in] input input the image to convolve
251  * \param[out] output output the convolved image
252  */
253  void
254  convolve (const FloatImageConstPtr& input, FloatImage& output) const;
255 
256  /** \brief Convolve image columns.
257  * \param[in] input input the image to convolve
258  * \param[out] output output the convolved image
259  */
260  void
261  convolveCols (const FloatImageConstPtr& input, FloatImage& output) const;
262 
263  /** \brief Convolve image rows.
264  * \param[in] input input the image to convolve
265  * \param[out] output output the convolved image
266  */
267  void
268  convolveRows (const FloatImageConstPtr& input, FloatImage& output) const;
269 
270  /** \brief extract the patch from the previous image, previous image gradients surrounding
271  * pixel alocation while interpolating image and gradients data and compute covariation
272  * matrix of derivatives.
273  * \param[in] img original image
274  * \param[in] grad_x original image gradient along X direction
275  * \param[in] grad_y original image gradient along Y direction
276  * \param[in] location pixel at the center of the patch
277  * \param[in] weights bilinear interpolation weights at this location computed from subpixel
278  * location
279  * \param[out] win patch with interpolated intensity values
280  * \param[out] grad_x_win patch with interpolated gradient along X values
281  * \param[out] grad_y_win patch with interpolated gradient along Y values
282  * \param[out] covariance covariance matrix coefficients
283  */
284  virtual void
285  spatialGradient (const FloatImage& img,
286  const FloatImage& grad_x,
287  const FloatImage& grad_y,
288  const Eigen::Array2i& location,
289  const Eigen::Array4f& weights,
290  Eigen::ArrayXXf& win,
291  Eigen::ArrayXXf& grad_x_win,
292  Eigen::ArrayXXf& grad_y_win,
293  Eigen::Array3f & covariance) const;
294  void
295  mismatchVector (const Eigen::ArrayXXf& prev,
296  const Eigen::ArrayXXf& prev_grad_x,
297  const Eigen::ArrayXXf& prev_grad_y,
298  const FloatImage& next,
299  const Eigen::Array2i& location,
300  const Eigen::Array4f& weights,
301  Eigen::Array2f &b) const;
302 
303  /** \brief Compute the pyramidal representation of an image.
304  * \param[in] input the input cloud
305  * \param[out] pyramid computed pyramid levels along with their respective gradients
306  * \param[in] border_type
307  */
308  virtual void
310  std::vector<FloatImageConstPtr>& pyramid,
311  pcl::InterpolationType border_type) const;
312 
313  virtual void
314  track (const PointCloudInConstPtr& previous_input,
315  const PointCloudInConstPtr& current_input,
316  const std::vector<FloatImageConstPtr>& previous_pyramid,
317  const std::vector<FloatImageConstPtr>& current_pyramid,
318  const pcl::PointCloud<pcl::PointUV>::ConstPtr& previous_keypoints,
319  pcl::PointCloud<pcl::PointUV>::Ptr& current_keypoints,
320  std::vector<int>& status,
321  Eigen::Affine3f& motion) const;
322 
323  virtual void
324  computeTracking ();
325 
326  /// \brief input pyranid at t-1
327  std::vector<FloatImageConstPtr> ref_pyramid_;
328  /// \brief point cloud at t-1
330  /// \brief number of pyramid levels
332  /// \brief detected keypoints 2D coordinates
334  /// \brief status of keypoints of t-1 at t
336  /// \brief number of points to detect
337  std::size_t keypoints_nbr_;
338  /// \brief tracking width
340  /// \brief half of tracking window width
342  /// \brief tracking height
344  /// \brief half of tracking window height
346  /// \brief maximum number of iterations
347  unsigned int max_iterations_;
348  /// \brief accuracy criterion to stop iterating
349  float accuracy_;
351  /// \brief epsilon for subpixel computation
352  float epsilon_;
354  /// \brief number of hardware threads
355  unsigned int threads_;
356  /// \brief intensity accessor
357  IntensityT intensity_;
358  /// \brief is the tracker initialized ?
360  /// \brief compute transformation from successfully tracked points
362  /// \brief computed transformation between tracked points
363  Eigen::Affine3f motion_;
364  /// \brief smoothing kernel
365  Eigen::Array<float, 5, 1> kernel_;
366  /// \brief smoothing kernel half size
368  /// \brief index of last element in kernel
370  public:
371  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
372  };
373  }
374 }
375 
376 #include <pcl/tracking/impl/pyramidal_klt.hpp>
377 #endif
pcl::tracking::PyramidalKLTTracker::mismatchVector
void mismatchVector(const Eigen::ArrayXXf &prev, const Eigen::ArrayXXf &prev_grad_x, const Eigen::ArrayXXf &prev_grad_y, const FloatImage &next, const Eigen::Array2i &location, const Eigen::Array4f &weights, Eigen::Array2f &b) const
Definition: pyramidal_klt.hpp:445
pcl
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
pcl::tracking::PyramidalKLTTracker::track_height_
int track_height_
tracking height
Definition: pyramidal_klt.h:343
point_types.h
pcl::tracking::PyramidalKLTTracker::ref_pyramid_
std::vector< FloatImageConstPtr > ref_pyramid_
input pyranid at t-1
Definition: pyramidal_klt.h:327
pcl::PointCloud< PointInT >::Ptr
boost::shared_ptr< PointCloud< PointInT > > Ptr
Definition: point_cloud.h:428
pcl::tracking::PyramidalKLTTracker::TrackerBase
pcl::tracking::Tracker< PointInT, Eigen::Affine3f > TrackerBase
Definition: pyramidal_klt.h:66
pcl::tracking::PyramidalKLTTracker::convolveCols
void convolveCols(const FloatImageConstPtr &input, FloatImage &output) const
Convolve image columns.
Definition: pyramidal_klt.hpp:304
pcl::tracking::PyramidalKLTTracker::FloatImage
pcl::PointCloud< float > FloatImage
Definition: pyramidal_klt.h:70
pcl::tracking::PyramidalKLTTracker::getInitialized
bool getInitialized() const
Definition: pyramidal_klt.h:218
pcl::PCLBase< PointInT >::input_
PointCloudConstPtr input_
The input point cloud dataset.
Definition: pcl_base.h:150
pcl::tracking::PyramidalKLTTracker::downsample
void downsample(const FloatImageConstPtr &input, FloatImageConstPtr &output) const
downsample input
Definition: pyramidal_klt.hpp:221
pcl::tracking::PyramidalKLTTracker::track_width_
int track_width_
tracking width
Definition: pyramidal_klt.h:339
pcl::tracking::PyramidalKLTTracker::ref_
PointCloudInConstPtr ref_
point cloud at t-1
Definition: pyramidal_klt.h:329
pcl::tracking::PyramidalKLTTracker::FloatImageConstPtr
FloatImage::ConstPtr FloatImageConstPtr
Definition: pyramidal_klt.h:72
pcl::tracking::PyramidalKLTTracker::track_width_2_
int track_width_2_
half of tracking window width
Definition: pyramidal_klt.h:341
pcl::tracking::PyramidalKLTTracker::derivatives
void derivatives(const FloatImage &src, FloatImage &grad_x, FloatImage &grad_y) const
compute Scharr derivatives of a source cloud.
Definition: pyramidal_klt.hpp:166
pcl::tracking::PyramidalKLTTracker::getPointsToTrackStatus
pcl::PointIndicesConstPtr getPointsToTrackStatus() const
Definition: pyramidal_klt.h:210
pcl::tracking::PyramidalKLTTracker::max_iterations_
unsigned int max_iterations_
maximum number of iterations
Definition: pyramidal_klt.h:347
pcl::tracking::PyramidalKLTTracker::keypoints_status_
pcl::PointIndicesPtr keypoints_status_
status of keypoints of t-1 at t
Definition: pyramidal_klt.h:335
pcl::tracking::PyramidalKLTTracker::setMaxIterationsNumber
void setMaxIterationsNumber(unsigned int max)
Set the maximum number of iterations in the Lucas Kanade loop.
Definition: pyramidal_klt.h:181
pcl::tracking::PyramidalKLTTracker::motion_
Eigen::Affine3f motion_
computed transformation between tracked points
Definition: pyramidal_klt.h:363
pcl::tracking::PyramidalKLTTracker::setTrackingWindowHeight
void setTrackingWindowHeight(int height)
Set tracking window height.
Definition: pyramidal_klt.h:160
pcl::tracking::PyramidalKLTTracker::setNumberOfKeypoints
void setNumberOfKeypoints(std::size_t number)
Set the maximum number of points to track.
Definition: pyramidal_klt.h:137
pcl::PointCloud< PointInT >
pcl::tracking::PyramidalKLTTracker::getResult
Eigen::Affine3f getResult() const
Return the computed transformation from tracked points.
Definition: pyramidal_klt.h:214
pcl::tracking::PyramidalKLTTracker::getMaxIterationsNumber
unsigned int getMaxIterationsNumber() const
Definition: pyramidal_klt.h:185
pcl::TransformationFromCorrespondences
Calculates a transformation based on corresponding 3D points.
Definition: transformation_from_correspondences.h:49
pcl::tracking::PyramidalKLTTracker::setNumberOfPyramidLevels
void setNumberOfPyramidLevels(int levels)
Set the number of pyramid levels.
Definition: pyramidal_klt.h:105
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::tracker_name_
std::string tracker_name_
The tracker name.
Definition: tracker.h:92
pcl::tracking::PyramidalKLTTracker::getTrackingWindowHeight
int getTrackingWindowHeight()
Definition: pyramidal_klt.h:164
pcl::tracking::PyramidalKLTTracker::PointCloudIn
TrackerBase::PointCloudIn PointCloudIn
Definition: pyramidal_klt.h:67
pcl::tracking::PyramidalKLTTracker::convolveRows
void convolveRows(const FloatImageConstPtr &input, FloatImage &output) const
Convolve image rows.
Definition: pyramidal_klt.hpp:273
pcl::tracking::PyramidalKLTTracker::initialized_
bool initialized_
is the tracker initialized ?
Definition: pyramidal_klt.h:359
pcl::tracking::PyramidalKLTTracker::computePyramids
virtual void computePyramids(const PointCloudInConstPtr &input, std::vector< FloatImageConstPtr > &pyramid, pcl::InterpolationType border_type) const
Compute the pyramidal representation of an image.
Definition: pyramidal_klt.hpp:336
pcl::tracking::PyramidalKLTTracker::accuracy_
float accuracy_
accuracy criterion to stop iterating
Definition: pyramidal_klt.h:349
pcl::tracking::PyramidalKLTTracker::setTrackingWindowSize
void setTrackingWindowSize(int width, int height)
set the tracking window size
Definition: pyramidal_klt.hpp:49
pcl::tracking::PyramidalKLTTracker::convolve
void convolve(const FloatImageConstPtr &input, FloatImage &output) const
Separately convolve image with decomposable convolution kernel.
Definition: pyramidal_klt.hpp:264
pcl::tracking::PyramidalKLTTracker::keypoints_
pcl::PointCloud< pcl::PointUV >::ConstPtr keypoints_
detected keypoints 2D coordinates
Definition: pyramidal_klt.h:333
pcl::tracking::PyramidalKLTTracker::getNumberOfKeypoints
std::size_t getNumberOfKeypoints()
Definition: pyramidal_klt.h:141
pcl::tracking::PyramidalKLTTracker::keypoints_nbr_
std::size_t keypoints_nbr_
number of points to detect
Definition: pyramidal_klt.h:337
pcl::tracking::PyramidalKLTTracker::getReferenceCloud
PointCloudInConstPtr getReferenceCloud() const
Get a pointer of the cloud at t-1.
Definition: pyramidal_klt.h:175
pcl::tracking::PyramidalKLTTracker::kernel_
Eigen::Array< float, 5, 1 > kernel_
smoothing kernel
Definition: pyramidal_klt.h:365
pcl::tracking::PyramidalKLTTracker::threads_
unsigned int threads_
number of hardware threads
Definition: pyramidal_klt.h:355
pcl::InterpolationType
InterpolationType
Definition: io.h:230
pcl::tracking::PyramidalKLTTracker::transformation_computer_
pcl::TransformationFromCorrespondences transformation_computer_
compute transformation from successfully tracked points
Definition: pyramidal_klt.h:361
pcl::tracking::PyramidalKLTTracker::setEpsilon
void setEpsilon(float epsilon)
Set epsilon.
Definition: pyramidal_klt.h:125
pcl::PointIndicesConstPtr
boost::shared_ptr< ::pcl::PointIndices const > PointIndicesConstPtr
Definition: PointIndices.h:27
pcl::tracking::PyramidalKLTTracker
Pyramidal Kanade Lucas Tomasi tracker.
Definition: pyramidal_klt.h:63
pcl::tracking::PyramidalKLTTracker::PointCloudInConstPtr
PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: pyramidal_klt.h:69
pcl::tracking::PyramidalKLTTracker::track_height_2_
int track_height_2_
half of tracking window height
Definition: pyramidal_klt.h:345
pcl::tracking::PyramidalKLTTracker::intensity_
IntensityT intensity_
intensity accessor
Definition: pyramidal_klt.h:357
pcl::tracking::PyramidalKLTTracker::track
virtual void track(const PointCloudInConstPtr &previous_input, const PointCloudInConstPtr &current_input, const std::vector< FloatImageConstPtr > &previous_pyramid, const std::vector< FloatImageConstPtr > &current_pyramid, const pcl::PointCloud< pcl::PointUV >::ConstPtr &previous_keypoints, pcl::PointCloud< pcl::PointUV >::Ptr &current_keypoints, std::vector< int > &status, Eigen::Affine3f &motion) const
Definition: pyramidal_klt.hpp:474
pcl::tracking::PyramidalKLTTracker::getNumberOfPyramidLevels
int getNumberOfPyramidLevels() const
Definition: pyramidal_klt.h:109
pcl::tracking::PyramidalKLTTracker::epsilon_
float epsilon_
epsilon for subpixel computation
Definition: pyramidal_klt.h:352
pcl::PCLBase< PointInT >::indices_
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition: pcl_base.h:153
pcl::tracking::PyramidalKLTTracker::computeTracking
virtual void computeTracking()
Abstract tracking method.
Definition: pyramidal_klt.hpp:625
pcl::PointCloud< PointInT >::ConstPtr
boost::shared_ptr< const PointCloud< PointInT > > ConstPtr
Definition: point_cloud.h:429
pcl::tracking::PyramidalKLTTracker::getTrackingWindowWidth
int getTrackingWindowWidth()
Definition: pyramidal_klt.h:156
pcl::PointIndicesPtr
boost::shared_ptr< ::pcl::PointIndices > PointIndicesPtr
Definition: PointIndices.h:26
pcl::tracking::PyramidalKLTTracker::setTrackingWindowWidth
void setTrackingWindowWidth(int width)
Set tracking window width.
Definition: pyramidal_klt.h:152
pcl::tracking::PyramidalKLTTracker::setAccuracy
void setAccuracy(float accuracy)
Set accuracy.
Definition: pyramidal_klt.h:115
pcl::tracking::PyramidalKLTTracker::setPointsToTrack
void setPointsToTrack(const pcl::PointIndicesConstPtr &points)
Provide a pointer to points to track.
Definition: pyramidal_klt.hpp:76
pcl::tracking::PyramidalKLTTracker::setNumberOfThreads
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition: pyramidal_klt.h:171
pcl::tracking::PyramidalKLTTracker::min_eigenvalue_threshold_
float min_eigenvalue_threshold_
Definition: pyramidal_klt.h:350
pcl::tracking::PyramidalKLTTracker::getAccuracy
float getAccuracy() const
Definition: pyramidal_klt.h:119
pcl::tracking::PyramidalKLTTracker::kernel_last_
int kernel_last_
index of last element in kernel
Definition: pyramidal_klt.h:369
pcl::tracking::PyramidalKLTTracker::FloatImagePtr
FloatImage::Ptr FloatImagePtr
Definition: pyramidal_klt.h:71
pcl::tracking::PyramidalKLTTracker::initCompute
virtual bool initCompute()
This method should get called before starting the actual computation.
Definition: pyramidal_klt.hpp:94
pcl::tracking::PyramidalKLTTracker::getTrackedPoints
pcl::PointCloud< pcl::PointUV >::ConstPtr getTrackedPoints() const
Definition: pyramidal_klt.h:201
pcl::tracking::PyramidalKLTTracker::~PyramidalKLTTracker
virtual ~PyramidalKLTTracker()
Destructor.
Definition: pyramidal_klt.h:99
pcl::tracking::PyramidalKLTTracker::max_residue_
float max_residue_
Definition: pyramidal_klt.h:353
pcl::tracking::PyramidalKLTTracker::kernel_size_2_
int kernel_size_2_
smoothing kernel half size
Definition: pyramidal_klt.h:367
pcl::tracking::Tracker
Tracker represents the base tracker class.
Definition: tracker.h:56
pcl::tracking::PyramidalKLTTracker::spatialGradient
virtual void spatialGradient(const FloatImage &img, const FloatImage &grad_x, const FloatImage &grad_y, const Eigen::Array2i &location, const Eigen::Array4f &weights, Eigen::ArrayXXf &win, Eigen::ArrayXXf &grad_x_win, Eigen::ArrayXXf &grad_y_win, Eigen::Array3f &covariance) const
extract the patch from the previous image, previous image gradients surrounding pixel alocation while...
Definition: pyramidal_klt.hpp:404
pcl::tracking::PyramidalKLTTracker::PyramidalKLTTracker
PyramidalKLTTracker(int nb_levels=5, int tracking_window_width=7, int tracking_window_height=7)
Constructor.
Definition: pyramidal_klt.h:79
pcl::tracking::PyramidalKLTTracker::nb_levels_
int nb_levels_
number of pyramid levels
Definition: pyramidal_klt.h:331
pcl::tracking::PyramidalKLTTracker::PointCloudInPtr
PointCloudIn::Ptr PointCloudInPtr
Definition: pyramidal_klt.h:68
pcl::tracking::PyramidalKLTTracker::getEpsilon
float getEpsilon() const
Definition: pyramidal_klt.h:129