Function:CuviMotionEstimator

From CUVI Wiki
Jump to: navigation, search

CuviMotionEstimator

A class to estimate translation motion between 2 frames.

  • CuviMotionEstimator() - Default constructor. Creates empty CuviMotionEstimator object.
  • CuviMotionEstimator(CuviMotionModel model = CUVI_MOTION_DEFAULT) - Creates a CuviMotionEstimator object to estimate the specified type of motion. Currently, only translation motion is supported.
  • ~CuviMotionEstimator() - Destructor.
  • CuviStatus estimate(const CuviImage& frame0, const CuviImage& frame1, Theta& motion) const; - Estimate the global motion vector between 2 frames.
Name Type Description
frame0 const CuviImage& First input frame
frame1 const CuviImage& Second input frame
motion Theta& Output global motion vector


Image Type Support

Input
8uC3


Example

//Create CuviMotionEstimator object
cuvi::videostab::CuviMotionEstimator estimator;
 
//Load images
CuviImage first = cuvi::io::loadImage(path, CUVI_LOAD_IMAGE_COLOR);
CuviImage second = cuvi::io::loadImage(path, CUVI_LOAD_IMAGE_COLOR);
 
 
cuvi::videostab::Theta theta;
 
estimator.estimate(first, second, theta);
 
std::cout<<"Dx = "<<theta.dx()<<"\nDy = "<<theta.dy()<<std::endl;