namespace videostab
{
-float calcBlurriness(const Mat &frame);
+CV_EXPORTS float calcBlurriness(const Mat &frame);
-class IDeblurer
+class CV_EXPORTS IDeblurer
{
public:
IDeblurer() : radius_(0), frames_(0), motions_(0) {}
const std::vector<float> *blurrinessRates_;
};
-class NullDeblurer : public IDeblurer
+class CV_EXPORTS NullDeblurer : public IDeblurer
{
public:
virtual void deblur(int idx, Mat &frame) {}
};
-class WeightingDeblurer : public IDeblurer
+class CV_EXPORTS WeightingDeblurer : public IDeblurer
{
public:
WeightingDeblurer();
{
// See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf
-class FastMarchingMethod
+class CV_EXPORTS FastMarchingMethod
{
public:
FastMarchingMethod() : inf_(1e6f) {}
namespace videostab
{
-class IFrameSource
+class CV_EXPORTS IFrameSource
{
public:
virtual ~IFrameSource() {}
virtual Mat nextFrame() = 0;
};
-class NullFrameSource : public IFrameSource
+class CV_EXPORTS NullFrameSource : public IFrameSource
{
public:
virtual void reset() {}
virtual Mat nextFrame() { return Mat(); }
};
-class VideoFileSource : public IFrameSource
+class CV_EXPORTS VideoFileSource : public IFrameSource
{
public:
VideoFileSource(const std::string &path, bool volatileFrame = false);
AFFINE = 2
};
-Mat estimateGlobalMotionLeastSquares(
+CV_EXPORTS Mat estimateGlobalMotionLeastSquares(
const std::vector<Point2f> &points0, const std::vector<Point2f> &points1,
int model = AFFINE, float *rmse = 0);
-struct RansacParams
+CV_EXPORTS struct RansacParams
{
int size; // subset size
float thresh; // max error to classify as inlier
static RansacParams translationMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }
};
-Mat estimateGlobalMotionRobust(
+CV_EXPORTS Mat estimateGlobalMotionRobust(
const std::vector<Point2f> &points0, const std::vector<Point2f> &points1,
int model = AFFINE, const RansacParams ¶ms = RansacParams::affine2dMotionStd(),
float *rmse = 0, int *ninliers = 0);
-class IGlobalMotionEstimator
+class CV_EXPORTS IGlobalMotionEstimator
{
public:
virtual ~IGlobalMotionEstimator() {}
virtual Mat estimate(const Mat &frame0, const Mat &frame1) = 0;
};
-class PyrLkRobustMotionEstimator : public IGlobalMotionEstimator
+class CV_EXPORTS PyrLkRobustMotionEstimator : public IGlobalMotionEstimator
{
public:
PyrLkRobustMotionEstimator();
float minInlierRatio_;
};
-Mat getMotion(int from, int to, const std::vector<Mat> &motions);
+CV_EXPORTS Mat getMotion(int from, int to, const std::vector<Mat> &motions);
-Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio);
+CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio);
-float estimateOptimalTrimRatio(const Mat &M, Size size);
+CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size);
// frame1 is non-transformed frame
-float alignementError(const Mat &M, const Mat &frame0, const Mat &mask0, const Mat &frame1);
+CV_EXPORTS float alignementError(const Mat &M, const Mat &frame0, const Mat &mask0, const Mat &frame1);
} // namespace videostab
} // namespace cv
namespace videostab
{
-class IInpainter
+class CV_EXPORTS IInpainter
{
public:
IInpainter()
const std::vector<Mat> *stabilizationMotions_;
};
-class NullInpainter : public IInpainter
+class CV_EXPORTS NullInpainter : public IInpainter
{
public:
virtual void inpaint(int idx, Mat &frame, Mat &mask) {}
};
-class InpaintingPipeline : public IInpainter
+class CV_EXPORTS InpaintingPipeline : public IInpainter
{
public:
void pushBack(Ptr<IInpainter> inpainter) { inpainters_.push_back(inpainter); }
std::vector<Ptr<IInpainter> > inpainters_;
};
-class ConsistentMosaicInpainter : public IInpainter
+class CV_EXPORTS ConsistentMosaicInpainter : public IInpainter
{
public:
ConsistentMosaicInpainter();
float stdevThresh_;
};
-class MotionInpainter : public IInpainter
+class CV_EXPORTS MotionInpainter : public IInpainter
{
public:
MotionInpainter();
Mat_<uchar> flowMask_;
};
-class ColorAverageInpainter : public IInpainter
+class CV_EXPORTS ColorAverageInpainter : public IInpainter
{
public:
virtual void inpaint(int idx, Mat &frame, Mat &mask);
FastMarchingMethod fmm_;
};
-void calcFlowMask(
+CV_EXPORTS void calcFlowMask(
const Mat &flowX, const Mat &flowY, const Mat &errors, float maxError,
const Mat &mask0, const Mat &mask1, Mat &flowMask);
-void completeFrameAccordingToFlow(
+CV_EXPORTS void completeFrameAccordingToFlow(
const Mat &flowMask, const Mat &flowX, const Mat &flowY, const Mat &frame1, const Mat &mask1,
Mat& frame0, Mat &mask0);
#ifndef __OPENCV_VIDEOSTAB_LOG_HPP__
#define __OPENCV_VIDEOSTAB_LOG_HPP__
+#include "opencv2/core/core.hpp"
+
namespace cv
{
namespace videostab
{
-class ILog
+class CV_EXPORTS ILog
{
public:
virtual ~ILog() {}
virtual void print(const char *format, ...) = 0;
};
-class NullLog : public ILog
+class CV_EXPORTS NullLog : public ILog
{
public:
virtual void print(const char *format, ...) {}
};
-class LogToStdout : public ILog
+class CV_EXPORTS LogToStdout : public ILog
{
public:
virtual void print(const char *format, ...);
namespace videostab
{
-class IMotionFilter
+class CV_EXPORTS IMotionFilter
{
public:
virtual ~IMotionFilter() {}
virtual Mat apply(int index, std::vector<Mat> &Ms) const = 0;
};
-class GaussianMotionFilter : public IMotionFilter
+class CV_EXPORTS GaussianMotionFilter : public IMotionFilter
{
public:
GaussianMotionFilter(int radius, float stdev);
namespace videostab
{
-class ISparseOptFlowEstimator
+class CV_EXPORTS ISparseOptFlowEstimator
{
public:
virtual ~ISparseOptFlowEstimator() {}
OutputArray status, OutputArray errors) = 0;
};
-class IDenseOptFlowEstimator
+class CV_EXPORTS IDenseOptFlowEstimator
{
public:
virtual ~IDenseOptFlowEstimator() {}
OutputArray errors) = 0;
};
-class PyrLkOptFlowEstimatorBase
+class CV_EXPORTS PyrLkOptFlowEstimatorBase
{
public:
PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); }
int maxLevel_;
};
-class SparsePyrLkOptFlowEstimator
+class CV_EXPORTS SparsePyrLkOptFlowEstimator
: public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator
{
public:
};
#if HAVE_OPENCV_GPU
-class DensePyrLkOptFlowEstimatorGpu
+class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu
: public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator
{
public:
namespace videostab
{
-class Stabilizer : public IFrameSource
+class CV_EXPORTS Stabilizer : public IFrameSource
{
public:
Stabilizer();