view include/Feature.hpp @ 132:45c64e68053c

added drawing function for features
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 17 Aug 2011 19:03:25 -0400
parents 4742b2b6d851
children 63dd4355b6d1
line wrap: on
line source

#ifndef FEATURE_HPP
#define FEATURE_HPP

#include "src/Trajectory.h"

#include <boost/shared_ptr.hpp>

/** Class for feature data
    positions, velocities and other statistics to evaluate their quality
    before saving. */
class FeatureTrajectory {
public:
  FeatureTrajectory(const int& frameNum, const cv::Point2f& p);

  void addPoint(const int& frameNum, const cv::Point2f& p);

#ifdef USE_OPENCV
  void draw(cv::Mat& img, const cv::Scalar& color) const;
#endif

protected:
  Trajectory<cv::Point2f> positions;
  Trajectory<cv::Point2f> velocities;
  
  std::vector<float> displacementDistances;

  void computeMotionData(const int& frameNum);

};

typedef boost::shared_ptr<FeatureTrajectory> FeatureTrajectoryPtr;

#endif