Ask Your Question
1

KeypointBasedMotionEstimator - C++

asked 2017-03-27 06:01:57 -0600

matt27110 gravatar image

Hello everyone !

I'm having problems with the KeypointBasedMotionEstimator class.

I don't understand how to instanciate that class. The constructor is :

KeypointBasedMotionEstimator(Ptr<MotionEstimatorBase> estimator)

And this is my main :

int main(int argc, char **argv)
{
  MotionModel mm = MM_AFFINE;
  Ptr<MotionEstimatorBase> estimator;
  estimator->setMotionModel(mm);
  KeypointBasedMotionEstimator kbme = KeypointBasedMotionEstimator(estimator);

  return 0; 
}

I get "segmentation fault (core dumped)"

I think the error comes from Ptr<MotionEstimatorBase> estimator , my initialization is probably bad and I'm not familiar with abstract class.

Any ideas is welcome.

Thank you in advance !!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2017-03-27 06:12:57 -0600

LBerger gravatar image

updated 2017-03-27 06:17:12 -0600

I think you can do something like this :

videostab::MotionModel mm = videostab::MM_AFFINE;
Ptr<videostab::MotionEstimatorL1> estimator= new videostab::MotionEstimatorL1(mm);
estimator->setMotionModel(mm);
videostab::KeypointBasedMotionEstimator kbme = videostab::KeypointBasedMotionEstimator(estimator);

I think MotionEstimatorBase is a virtual class you cannot use it. You must use MotionEstimatorRansacL2 or MotionEstimatorL1

There is an example videostab

edit flag offensive delete link more

Comments

1

Thank you it works !!!

matt27110 gravatar imagematt27110 ( 2017-03-27 06:15:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-03-27 06:01:57 -0600

Seen: 410 times

Last updated: Mar 27 '17