You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
991 B
C
46 lines
991 B
C
|
4 years ago
|
#ifndef OnlinePathSmoother_h__
|
||
|
|
#define OnlinePathSmoother_h__
|
||
|
|
|
||
|
|
#include <vector>
|
||
|
|
#include <opencv2/opencv.hpp>
|
||
|
|
#include "CVUtils.h"
|
||
|
|
|
||
|
|
using std::vector;
|
||
|
|
|
||
|
|
namespace pagic
|
||
|
|
{
|
||
|
|
enum PagicSmoothType{
|
||
|
|
PAGIC_SMOOTH_AVERAGE,
|
||
|
|
PAGIC_SMOOTH_GAUSS
|
||
|
|
};
|
||
|
|
|
||
|
|
class OnlinePathSmoother
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
OnlinePathSmoother();
|
||
|
|
Point2d smooth(const Point2d& pos);
|
||
|
|
void clear();
|
||
|
|
|
||
|
|
vector<Point2d> getSrcPosVec() const { return m_srcPosVec; }
|
||
|
|
void setSrcPosVec(vector<Point2d> val) { m_srcPosVec = val; }
|
||
|
|
vector<Point2d> getSmoothPosVec() const { return m_smoothPosVec; }
|
||
|
|
void setSmoothPosVec(vector<Point2d> val) { m_smoothPosVec = val; }
|
||
|
|
int getSmoothRadius() const { return m_smoothRadius; }
|
||
|
|
void setSmoothRadius(int val) { m_smoothRadius = val; }
|
||
|
|
|
||
|
|
protected:
|
||
|
|
vector<Point2d> m_srcPosVec;
|
||
|
|
vector<Point2d> m_smoothPosVec;
|
||
|
|
|
||
|
|
int m_smoothRadius;
|
||
|
|
PagicSmoothType m_type;
|
||
|
|
|
||
|
|
void smoothLastPosByAverage();
|
||
|
|
void smoothLastPosByGauss();
|
||
|
|
|
||
|
|
private:
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif // OnlinePathSmoother_h__
|