Point Cloud Library (PCL)
1.11.1
|
40 #include <pcl/common/intensity.h>
41 #include <pcl/common/transformation_from_correspondences.h>
42 #include <pcl/tracking/tracker.h>
62 template <
typename PointInT,
73 using Ptr = shared_ptr<PyramidalKLTTracker<PointInT, IntensityT>>;
74 using ConstPtr = shared_ptr<const PyramidalKLTTracker<PointInT, IntensityT>>;
82 int tracking_window_width = 7,
83 int tracking_window_height = 7)
97 kernel_ << 1.f / 16, 1.f / 4, 3.f / 8, 1.f / 4, 1.f / 16;
353 const Eigen::Array2i& location,
354 const Eigen::Array4f& weights,
355 Eigen::ArrayXXf& win,
356 Eigen::ArrayXXf& grad_x_win,
357 Eigen::ArrayXXf& grad_y_win,
358 Eigen::Array3f& covariance)
const;
361 const Eigen::ArrayXXf& prev_grad_x,
362 const Eigen::ArrayXXf& prev_grad_y,
364 const Eigen::Array2i& location,
365 const Eigen::Array4f& weights,
366 Eigen::Array2f& b)
const;
376 std::vector<FloatImageConstPtr>& pyramid,
382 const std::vector<FloatImageConstPtr>& previous_pyramid,
383 const std::vector<FloatImageConstPtr>& current_pyramid,
386 std::vector<int>& status,
387 Eigen::Affine3f& motion)
const;
443 #include <pcl/tracking/impl/pyramidal_klt.hpp>
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
Defines all the PCL and non-PCL macros used.
int track_height_
tracking height
Defines all the PCL implemented PointT point type structures.
std::vector< FloatImageConstPtr > ref_pyramid_
input pyranid at t-1
PointIndices::Ptr PointIndicesPtr
~PyramidalKLTTracker()
Destructor.
void convolveCols(const FloatImageConstPtr &input, FloatImage &output) const
Convolve image columns.
bool getInitialized() const
PointCloudConstPtr input_
The input point cloud dataset.
void downsample(const FloatImageConstPtr &input, FloatImageConstPtr &output) const
downsample input
int track_width_
tracking width
PointCloudInConstPtr ref_
point cloud at t-1
int track_width_2_
half of tracking window width
void derivatives(const FloatImage &src, FloatImage &grad_x, FloatImage &grad_y) const
compute Scharr derivatives of a source cloud.
pcl::PointIndicesConstPtr getPointsToTrackStatus() const
unsigned int max_iterations_
maximum number of iterations
pcl::PointIndicesPtr keypoints_status_
status of keypoints of t-1 at t
void setMaxIterationsNumber(unsigned int max)
Set the maximum number of iterations in the Lucas Kanade loop.
Eigen::Affine3f motion_
computed transformation between tracked points
bool initCompute() override
This method should get called before starting the actual computation.
void setTrackingWindowHeight(int height)
Set tracking window height.
void setNumberOfKeypoints(std::size_t number)
Set the maximum number of points to track after sorting detected keypoints according to their respons...
unsigned int getMaxIterationsNumber() const
void setNumberOfPyramidLevels(int levels)
Set the number of pyramid levels.
std::string tracker_name_
The tracker name.
FloatImage::ConstPtr FloatImageConstPtr
int getTrackingWindowHeight()
void computeTracking() override
Abstract tracking method.
PointIndices::ConstPtr PointIndicesConstPtr
void convolveRows(const FloatImageConstPtr &input, FloatImage &output) const
Convolve image rows.
bool initialized_
is the tracker initialized ?
shared_ptr< PyramidalKLTTracker< PointInT, IntensityT > > Ptr
virtual void computePyramids(const PointCloudInConstPtr &input, std::vector< FloatImageConstPtr > &pyramid, pcl::InterpolationType border_type) const
Compute the pyramidal representation of an image.
float accuracy_
accuracy criterion to stop iterating
void setTrackingWindowSize(int width, int height)
set the tracking window size
void convolve(const FloatImageConstPtr &input, FloatImage &output) const
Separately convolve image with decomposable convolution kernel.
pcl::PointCloud< pcl::PointUV >::ConstPtr keypoints_
detected keypoints 2D coordinates
std::size_t getNumberOfKeypoints()
std::size_t keypoints_nbr_
number of points to detect
shared_ptr< const PyramidalKLTTracker< PointInT, IntensityT > > ConstPtr
PointCloudInConstPtr getReferenceCloud() const
Get a pointer of the cloud at t-1.
Eigen::Array< float, 5, 1 > kernel_
smoothing kernel
pcl::PointCloud< PointInT > PointCloudIn
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
unsigned int threads_
number of hardware threads
typename PointCloudIn::ConstPtr PointCloudInConstPtr
FloatImage::Ptr FloatImagePtr
pcl::TransformationFromCorrespondences transformation_computer_
compute transformation from successfully tracked points
void setEpsilon(float epsilon)
Set epsilon.
typename PointCloudIn::Ptr PointCloudInPtr
Pyramidal Kanade Lucas Tomasi tracker.
int track_height_2_
half of tracking window height
IntensityT intensity_
intensity accessor
virtual void track(const PointCloudInConstPtr &previous_input, const PointCloudInConstPtr ¤t_input, const std::vector< FloatImageConstPtr > &previous_pyramid, const std::vector< FloatImageConstPtr > ¤t_pyramid, const pcl::PointCloud< pcl::PointUV >::ConstPtr &previous_keypoints, pcl::PointCloud< pcl::PointUV >::Ptr ¤t_keypoints, std::vector< int > &status, Eigen::Affine3f &motion) const
int getNumberOfPyramidLevels() const
float epsilon_
epsilon for subpixel computation
shared_ptr< PointCloud< float > > Ptr
IndicesPtr indices_
A pointer to the vector of point indices to use.
typename TrackerBase::PointCloudIn PointCloudIn
int getTrackingWindowWidth()
pcl::PointCloud< float > FloatImage
void setTrackingWindowWidth(int width)
Set tracking window width.
void setAccuracy(float accuracy)
Set accuracy.
void setPointsToTrack(const pcl::PointIndicesConstPtr &points)
Provide a pointer to points to track.
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
shared_ptr< const PointCloud< float > > ConstPtr
float min_eigenvalue_threshold_
float getAccuracy() const
int kernel_last_
index of last element in kernel
Eigen::Affine3f getResult() const override
Return the computed transformation from tracked points.
pcl::PointCloud< pcl::PointUV >::ConstPtr getTrackedPoints() const
int kernel_size_2_
smoothing kernel half size
Tracker represents the base tracker class.
Defines functions, macros and traits for allocating and using memory.
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...
PyramidalKLTTracker(int nb_levels=5, int tracking_window_width=7, int tracking_window_height=7)
Constructor.
int nb_levels_
number of pyramid levels