namespace cv::videostab

namespace videostab {

// enums

enum MotionModel;

// structs

struct RansacParams;

// classes

class ColorAverageInpainter;
class ColorInpainter;
class ConsistentMosaicInpainter;
class DeblurerBase;
class FastMarchingMethod;
class FromFileMotionReader;
class GaussianMotionFilter;
class IDenseOptFlowEstimator;
class IFrameSource;
class ILog;
class IMotionStabilizer;
class IOutlierRejector;
class ISparseOptFlowEstimator;
class ImageMotionEstimatorBase;
class InpainterBase;
class InpaintingPipeline;
class KeypointBasedMotionEstimator;
class LogToStdout;
class LpMotionStabilizer;
class MoreAccurateMotionWobbleSuppressor;
class MoreAccurateMotionWobbleSuppressorBase;
class MotionEstimatorBase;
class MotionEstimatorL1;
class MotionEstimatorRansacL2;
class MotionFilterBase;
class MotionInpainter;
class MotionStabilizationPipeline;
class NullDeblurer;
class NullFrameSource;
class NullInpainter;
class NullLog;
class NullOutlierRejector;
class NullWobbleSuppressor;
class OnePassStabilizer;
class PyrLkOptFlowEstimatorBase;
class SparsePyrLkOptFlowEstimator;
class StabilizerBase;
class ToFileMotionWriter;
class TranslationBasedLocalOutlierRejector;
class TwoPassStabilizer;
class VideoFileSource;
class WeightingDeblurer;
class WobbleSuppressorBase;

// global functions

template <typename T>
T&
at(
    int idx,
    std::vector<T>& items
    );

template <typename T>
const T&
at(
    int idx,
    const std::vector<T>& items
    );

float
calcBlurriness(const Mat& frame);

void
calcFlowMask(
    const Mat& flowX,
    const Mat& flowY,
    const Mat& errors,
    float maxError,
    const Mat& mask0,
    const Mat& mask1,
    Mat& flowMask
    );

void
completeFrameAccordingToFlow(
    const Mat& flowMask,
    const Mat& flowX,
    const Mat& flowY,
    const Mat& frame1,
    const Mat& mask1,
    float distThresh,
    Mat& frame0,
    Mat& mask0
    );

Mat
ensureInclusionConstraint(
    const Mat& M,
    Size size,
    float trimRatio
    );

Mat
estimateGlobalMotionLeastSquares(
    InputOutputArray points0,
    InputOutputArray points1,
    int model = MM_AFFINE,
    float* rmse = 0
    );

Mat
estimateGlobalMotionRansac(
    InputArray points0,
    InputArray points1,
    int model = MM_AFFINE,
    const RansacParams& params = RansacParams::default2dMotion(MM_AFFINE),
    float* rmse = 0,
    int* ninliers = 0
    );

float
estimateOptimalTrimRatio(
    const Mat& M,
    Size size
    );

Mat
getMotion(
    int from,
    int to,
    const std::vector<Mat>& motions
    );

} // namespace videostab