OpenCV  3.4.1
Open Source Computer Vision
Classes | Enumerations | Functions
Global Motion Estimation

Classes

class  cv::videostab::FromFileMotionReader
 
class  cv::videostab::GaussianMotionFilter
 
class  cv::videostab::ImageMotionEstimatorBase
 Base class for global 2D motion estimation methods which take frames as input. More...
 
class  cv::videostab::IMotionStabilizer
 
class  cv::videostab::KeypointBasedMotionEstimator
 Describes a global 2D motion estimation method which uses keypoints detection and optical flow for matching. More...
 
class  cv::videostab::LpMotionStabilizer
 
class  cv::videostab::MotionEstimatorBase
 Base class for all global motion estimation methods. More...
 
class  cv::videostab::MotionEstimatorL1
 Describes a global 2D motion estimation method which minimizes L1 error. More...
 
class  cv::videostab::MotionEstimatorRansacL2
 Describes a robust RANSAC-based global 2D motion estimation method which minimizes L2 error. More...
 
class  cv::videostab::MotionFilterBase
 
class  cv::videostab::MotionStabilizationPipeline
 
struct  cv::videostab::RansacParams
 Describes RANSAC method parameters. More...
 
class  cv::videostab::ToFileMotionWriter
 

Enumerations

enum  cv::videostab::MotionModel {
  cv::videostab::MM_TRANSLATION = 0,
  cv::videostab::MM_TRANSLATION_AND_SCALE = 1,
  cv::videostab::MM_ROTATION = 2,
  cv::videostab::MM_RIGID = 3,
  cv::videostab::MM_SIMILARITY = 4,
  cv::videostab::MM_AFFINE = 5,
  cv::videostab::MM_HOMOGRAPHY = 6,
  cv::videostab::MM_UNKNOWN = 7
}
 Describes motion model between two point clouds. More...
 

Functions

 cv::videostab::GaussianMotionFilter::GaussianMotionFilter (int radius=15, float stdev=-1.f)
 
 cv::videostab::RansacParams::RansacParams (int size, float thresh, float eps, float prob)
 Constructor. More...
 
Mat cv::videostab::ensureInclusionConstraint (const Mat &M, Size size, float trimRatio)
 
Mat cv::videostab::estimateGlobalMotionLeastSquares (InputOutputArray points0, InputOutputArray points1, int model=MM_AFFINE, float *rmse=0)
 Estimates best global motion between two 2D point clouds in the least-squares sense. More...
 
Mat cv::videostab::estimateGlobalMotionRansac (InputArray points0, InputArray points1, int model=MM_AFFINE, const RansacParams &params=RansacParams::default2dMotion(MM_AFFINE), float *rmse=0, int *ninliers=0)
 Estimates best global motion between two 2D point clouds robustly (using RANSAC method). More...
 
float cv::videostab::estimateOptimalTrimRatio (const Mat &M, Size size)
 
Mat cv::videostab::getMotion (int from, int to, const std::vector< Mat > &motions)
 Computes motion between two frames assuming that all the intermediate motions are known. More...
 

Detailed Description

The video stabilization module contains a set of functions and classes for global motion estimation between point clouds or between images. In the last case features are extracted and matched internally. For the sake of convenience the motion estimation functions are wrapped into classes. Both the functions and the classes are available.

Enumeration Type Documentation

§ MotionModel

Describes motion model between two point clouds.

Enumerator
MM_TRANSLATION 
Python: cv.videostab.MM_TRANSLATION
MM_TRANSLATION_AND_SCALE 
Python: cv.videostab.MM_TRANSLATION_AND_SCALE
MM_ROTATION 
Python: cv.videostab.MM_ROTATION
MM_RIGID 
Python: cv.videostab.MM_RIGID
MM_SIMILARITY 
Python: cv.videostab.MM_SIMILARITY
MM_AFFINE 
Python: cv.videostab.MM_AFFINE
MM_HOMOGRAPHY 
Python: cv.videostab.MM_HOMOGRAPHY
MM_UNKNOWN 
Python: cv.videostab.MM_UNKNOWN

Function Documentation

§ GaussianMotionFilter()

cv::videostab::GaussianMotionFilter::GaussianMotionFilter ( int  radius = 15,
float  stdev = -1.f 
)
inline

§ RansacParams()

cv::videostab::RansacParams::RansacParams ( int  size,
float  thresh,
float  eps,
float  prob 
)
inline

Constructor.

Parameters
sizeSubset size.
threshMaximum re-projection error value to classify as inlier.
epsMaximum ratio of incorrect correspondences.
probRequired success probability.

§ ensureInclusionConstraint()

Mat cv::videostab::ensureInclusionConstraint ( const Mat M,
Size  size,
float  trimRatio 
)

§ estimateGlobalMotionLeastSquares()

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

Estimates best global motion between two 2D point clouds in the least-squares sense.

Note
Works in-place and changes input point arrays.
Parameters
points0Source set of 2D points (32F).
points1Destination set of 2D points (32F).
modelMotion model (up to MM_AFFINE).
rmseFinal root-mean-square error.
Returns
3x3 2D transformation matrix (32F).

§ estimateGlobalMotionRansac()

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

Estimates best global motion between two 2D point clouds robustly (using RANSAC method).

Parameters
points0Source set of 2D points (32F).
points1Destination set of 2D points (32F).
modelMotion model. See cv::videostab::MotionModel.
paramsRANSAC method parameters. See videostab::RansacParams.
rmseFinal root-mean-square error.
ninliersFinal number of inliers.

§ estimateOptimalTrimRatio()

float cv::videostab::estimateOptimalTrimRatio ( const Mat M,
Size  size 
)

§ getMotion()

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

Computes motion between two frames assuming that all the intermediate motions are known.

Parameters
fromSource frame index.
toDestination frame index.
motionsPair-wise motions. motions[i] denotes motion from the frame i to the frame i+1
Returns
Motion from the Source frame to the Destination frame.