mexopencv  0.1
mex interface for opencv library
mexopencv_videostab.cpp
Go to the documentation of this file.
1 
8 #include <typeinfo>
9 #include <cstdio>
10 #include <cstdarg>
11 using std::vector;
12 using std::string;
13 using std::const_mem_fun_ref_t;
14 using namespace cv;
15 using namespace cv::videostab;
16 
17 
18 // ==================== XXX ====================
19 
22  ("NS", cv::INPAINT_NS)
23  ("Telea", cv::INPAINT_TELEA);
24 
25 // NOTE: mexPrintf doesn't correctly handle "%s" formatted messages when
26 // directly passing variadic to it. So we use vsnprintf first with a buffer,
27 // then pass the buffer to mexPrintf.
28 void LogToMATLAB::print(const char *format, ...)
29 {
30  // buffer
31  const int BUFSIZE = 255;
32  char buffer[BUFSIZE+1];
33 
34  // print formatted message to buffer
35  va_list args;
36  va_start(args, format);
37  vsnprintf(buffer, BUFSIZE, format, args);
38  va_end(args);
39 
40  // print buffered message in MATLAB
41  buffer[BUFSIZE] = '\0';
42  mexPrintf(buffer);
43 
44  //TODO: flush
45 }
46 
47 RansacParams toRansacParams(const MxArray &arr)
48 {
49  return RansacParams(
50  arr.at("Size").toInt(),
51  arr.at("Thresh").toFloat(),
52  arr.at("Eps").toFloat(),
53  arr.at("Prob").toFloat());
54 }
55 
56 MxArray toStruct(const RansacParams &params)
57 {
59  s.set("Size", params.size);
60  s.set("Thresh", params.thresh);
61  s.set("Eps", params.eps);
62  s.set("Prob", params.prob);
63  return s;
64 }
65 
66 
67 // ==================== XXX ====================
68 
69 MxArray toStruct(Ptr<ILog> p)
70 {
72  if (!p.empty())
73  s.set("TypeId", string(typeid(*p).name()));
74  return s;
75 }
76 
77 MxArray toStruct(Ptr<IFrameSource> p)
78 {
80  if (!p.empty()) {
81  s.set("TypeId", string(typeid(*p).name()));
82  Ptr<VideoFileSource> pp = p.dynamicCast<VideoFileSource>();
83  if (!pp.empty()) {
84  s.set("Width", pp->width());
85  s.set("Height", pp->height());
86  s.set("FPS", pp->fps());
87  s.set("Count", pp->count());
88  }
89  }
90  return s;
91 }
92 
93 MxArray toStruct(Ptr<DeblurerBase> p)
94 {
96  if (!p.empty()) {
97  s.set("TypeId", string(typeid(*p).name()));
98  s.set("Radius", p->radius());
99  // Frames, Motions, BlurrinessRates: data from stabilizer
100  Ptr<WeightingDeblurer> pp = p.dynamicCast<WeightingDeblurer>();
101  if (!pp.empty()) {
102  s.set("Sensitivity", pp->sensitivity());
103  }
104  }
105  return s;
106 }
107 
108 MxArray toStruct(Ptr<MotionEstimatorBase> p)
109 {
111  if (!p.empty()) {
112  s.set("TypeId", string(typeid(*p).name()));
113  s.set("MotionModel", MotionModelInvMap[p->motionModel()]);
114  {
115  Ptr<MotionEstimatorRansacL2> pp = p.dynamicCast<MotionEstimatorRansacL2>();
116  if (!pp.empty()) {
117  s.set("RansacParams", toStruct(pp->ransacParams()));
118  s.set("MinInlierRatio", pp->minInlierRatio());
119  }
120  }
121  }
122  return s;
123 }
124 
125 MxArray toStruct(Ptr<FeatureDetector> p)
126 {
128  if (!p.empty()) {
129  s.set("TypeId", string(typeid(*p).name()));
130  //TODO: check each derived FeatureDetector, and return its props
131  }
132  return s;
133 }
134 
135 MxArray toStruct(Ptr<ISparseOptFlowEstimator> p)
136 {
138  if (!p.empty()) {
139  s.set("TypeId", string(typeid(*p).name()));
140  Ptr<SparsePyrLkOptFlowEstimator> pp = p.dynamicCast<SparsePyrLkOptFlowEstimator>();
141  if (!pp.empty()) {
142  s.set("WinSize", pp->winSize());
143  s.set("MaxLevel", pp->maxLevel());
144  }
145  }
146  return s;
147 }
148 
149 MxArray toStruct(Ptr<IDenseOptFlowEstimator> p)
150 {
152  if (!p.empty()) {
153  s.set("TypeId", string(typeid(*p).name()));
154  //TODO: no CPU version, only CUDA
155  /*
156  Ptr<DensePyrLkOptFlowEstimatorGpu> pp = p.dynamicCast<DensePyrLkOptFlowEstimatorGpu>();
157  if (!pp.empty()) {
158  s.set("WinSize", pp->winSize());
159  s.set("MaxLevel", pp->maxLevel());
160  }
161  */
162  }
163  return s;
164 }
165 
166 MxArray toStruct(Ptr<IOutlierRejector> p)
167 {
169  if (!p.empty()) {
170  s.set("TypeId", string(typeid(*p).name()));
171  Ptr<TranslationBasedLocalOutlierRejector> pp = p.dynamicCast<TranslationBasedLocalOutlierRejector>();
172  if (!pp.empty()) {
173  s.set("CellSize", pp->cellSize());
174  s.set("RansacParams", toStruct(pp->ransacParams()));
175  }
176  }
177  return s;
178 }
179 
180 MxArray toStruct(Ptr<ImageMotionEstimatorBase> p)
181 {
183  if (!p.empty()) {
184  s.set("TypeId", string(typeid(*p).name()));
185  s.set("MotionModel", MotionModelInvMap[p->motionModel()]);
186  Ptr<KeypointBasedMotionEstimator> pp = p.dynamicCast<KeypointBasedMotionEstimator>();
187  if (!pp.empty()) {
188  s.set("Detector", toStruct(pp->detector())); // Ptr<FeatureDetector>
189  s.set("OpticalFlowEstimator", toStruct(pp->opticalFlowEstimator())); // Ptr<ISparseOptFlowEstimator>
190  s.set("OutlierRejector", toStruct(pp->outlierRejector())); // Ptr<IOutlierRejector>
191  }
192  }
193  return s;
194 }
195 
196 MxArray toStruct(Ptr<InpainterBase> p)
197 {
199  if (!p.empty()) {
200  s.set("TypeId", string(typeid(*p).name()));
201  s.set("MotionModel", MotionModelInvMap[p->motionModel()]);
202  s.set("Radius", p->radius());
203  // Frames, Motions, StabilizedFrames, StabilizationMotions: data from stabilizer
204  {
205  Ptr<ConsistentMosaicInpainter> pp = p.dynamicCast<ConsistentMosaicInpainter>();
206  if (!pp.empty())
207  s.set("StdevThresh", pp->stdevThresh());
208  }
209  {
210  Ptr<MotionInpainter> pp = p.dynamicCast<MotionInpainter>();
211  if (!pp.empty()) {
212  s.set("FlowErrorThreshold", pp->flowErrorThreshold());
213  s.set("DistThresh", pp->distThresh());
214  s.set("BorderMode", BorderTypeInv[pp->borderMode()]);
215  s.set("OptFlowEstimator", toStruct(pp->optFlowEstimator())); // Ptr<IDenseOptFlowEstimator>
216  }
217  }
218  {
219  Ptr<InpaintingPipeline> pp = p.dynamicCast<InpaintingPipeline>();
220  if (!pp.empty())
221  s.set("Empty", pp->empty());
222  }
223  }
224  return s;
225 }
226 
227 MxArray toStruct(Ptr<MotionFilterBase> p)
228 {
230  if (!p.empty()) {
231  s.set("TypeId", string(typeid(*p).name()));
232  Ptr<GaussianMotionFilter> pp = p.dynamicCast<GaussianMotionFilter>();
233  if (!pp.empty()) {
234  s.set("Radius", pp->radius());
235  s.set("Stdev", pp->stdev());
236  }
237  }
238  return s;
239 }
240 
241 MxArray toStruct(Ptr<IMotionStabilizer> p)
242 {
244  if (!p.empty()) {
245  s.set("TypeId", string(typeid(*p).name()));
246  {
247  Ptr<LpMotionStabilizer> pp = p.dynamicCast<LpMotionStabilizer>();
248  if (!pp.empty()) {
249  s.set("MotionModel", MotionModelInvMap[pp->motionModel()]);
250  s.set("FrameSize", pp->frameSize());
251  s.set("TrimRatio", pp->trimRatio());
252  s.set("Weight1", pp->weight1());
253  s.set("Weight2", pp->weight2());
254  s.set("Weight3", pp->weight3());
255  s.set("Weight4", pp->weight4());
256  }
257  }
258  {
259  Ptr<GaussianMotionFilter> pp = p.dynamicCast<GaussianMotionFilter>();
260  if (!pp.empty()) {
261  s.set("Radius", pp->radius());
262  s.set("Stdev", pp->stdev());
263  }
264  }
265  {
266  Ptr<MotionStabilizationPipeline> pp = p.dynamicCast<MotionStabilizationPipeline>();
267  if (!pp.empty())
268  s.set("Empty", pp->empty());
269  }
270  }
271  return s;
272 }
273 
274 MxArray toStruct(Ptr<WobbleSuppressorBase> p)
275 {
277  if (!p.empty()) {
278  s.set("TypeId", string(typeid(*p).name()));
279  s.set("MotionEstimator", toStruct(p->motionEstimator())); // Ptr<ImageMotionEstimatorBase>
280  // FrameCount, Motions, Motions2, StabilizationMotions: data from stabilizer
281  Ptr<MoreAccurateMotionWobbleSuppressorBase> pp = p.dynamicCast<MoreAccurateMotionWobbleSuppressorBase>();
282  if (!pp.empty())
283  s.set("Period", pp->period());
284  }
285  return s;
286 }
287 
288 
289 // ==================== XXX ====================
290 
291 Ptr<ILog> createILog(const string& type)
292 {
293  Ptr<ILog> p;
294  if (type == "LogToMATLAB")
295  p = makePtr<LogToMATLAB>();
296  else if (type == "LogToStdout")
297  p = makePtr<LogToStdout>();
298  else if (type == "NullLog")
299  p = makePtr<NullLog>();
300  else
301  mexErrMsgIdAndTxt("mexopencv:error",
302  "Unrecognized logger type %s", type.c_str());
303  if (p.empty())
304  mexErrMsgIdAndTxt("mexopencv:error",
305  "Failed to create ILog");
306  return p;
307 }
308 
309 Ptr<VideoFileSource> createVideoFileSource(
310  vector<MxArray>::const_iterator first,
311  vector<MxArray>::const_iterator last)
312 {
313  ptrdiff_t len = std::distance(first, last);
314  nargchk(len>=1 && (len%2)==1);
315  string path(first->toString()); ++first;
316  bool volatileFrame = false;
317  for (; first != last; first += 2) {
318  string key(first->toString());
319  const MxArray& val = *(first + 1);
320  if (key == "VolatileFrame")
321  volatileFrame = val.toBool();
322  else
323  mexErrMsgIdAndTxt("mexopencv:error",
324  "Unrecognized option %s", key.c_str());
325  }
326  return makePtr<VideoFileSource>(path, volatileFrame);
327 }
328 
329 Ptr<IFrameSource> createIFrameSource(
330  const string& type,
331  vector<MxArray>::const_iterator first,
332  vector<MxArray>::const_iterator last)
333 {
334  ptrdiff_t len = std::distance(first, last);
335  Ptr<IFrameSource> p;
336  if (type == "VideoFileSource")
337  p = createVideoFileSource(first, last);
338  else if (type == "NullFrameSource") {
339  nargchk(len==0);
340  p = makePtr<NullFrameSource>();
341  }
342  else
343  mexErrMsgIdAndTxt("mexopencv:error",
344  "Unrecognized frame source %s", type.c_str());
345  if (p.empty())
346  mexErrMsgIdAndTxt("mexopencv:error",
347  "Failed to create IFrameSource");
348  return p;
349 }
350 
351 Ptr<WeightingDeblurer> createWeightingDeblurer(
352  vector<MxArray>::const_iterator first,
353  vector<MxArray>::const_iterator last)
354 {
355  ptrdiff_t len = std::distance(first, last);
356  nargchk((len%2)==0);
357  Ptr<WeightingDeblurer> p = makePtr<WeightingDeblurer>();
358  if (p.empty())
359  mexErrMsgIdAndTxt("mexopencv:error",
360  "Failed to create WeightingDeblurer");
361  for (; first != last; first += 2) {
362  string key(first->toString());
363  const MxArray& val = *(first + 1);
364  // Frames, Motions, BlurrinessRates: data from stabilizer
365  if (key == "Radius")
366  p->setRadius(val.toInt());
367  else if (key == "Sensitivity")
368  p->setSensitivity(val.toFloat());
369  else
370  mexErrMsgIdAndTxt("mexopencv:error",
371  "Unrecognized option %s", key.c_str());
372  }
373  return p;
374 }
375 
376 Ptr<DeblurerBase> createDeblurerBase(
377  const string& type,
378  vector<MxArray>::const_iterator first,
379  vector<MxArray>::const_iterator last)
380 {
381  ptrdiff_t len = std::distance(first, last);
382  Ptr<DeblurerBase> p;
383  if (type == "WeightingDeblurer")
384  p = createWeightingDeblurer(first, last);
385  else if (type == "NullDeblurer") {
386  nargchk(len==3);
387  p = makePtr<NullDeblurer>();
388  }
389  else
390  mexErrMsgIdAndTxt("mexopencv:error",
391  "Unrecognized deblurer %s", type.c_str());
392  if (p.empty())
393  mexErrMsgIdAndTxt("mexopencv:error",
394  "Failed to create DeblurerBase");
395  return p;
396 }
397 
398 Ptr<MotionEstimatorL1> createMotionEstimatorL1(
399  vector<MxArray>::const_iterator first,
400  vector<MxArray>::const_iterator last)
401 {
402  ptrdiff_t len = std::distance(first, last);
403  nargchk((len%2)==0);
404  MotionModel model = cv::videostab::MM_AFFINE;
405  for (; first != last; first += 2) {
406  string key(first->toString());
407  const MxArray& val = *(first + 1);
408  if (key == "MotionModel")
409  model = MotionModelMap[val.toString()];
410  else
411  mexErrMsgIdAndTxt("mexopencv:error",
412  "Unrecognized option %s", key.c_str());
413  }
414  return makePtr<MotionEstimatorL1>(model);
415 }
416 
417 Ptr<MotionEstimatorRansacL2> createMotionEstimatorRansacL2(
418  vector<MxArray>::const_iterator first,
419  vector<MxArray>::const_iterator last)
420 {
421  ptrdiff_t len = std::distance(first, last);
422  nargchk((len%2)==0);
423  MotionModel model = cv::videostab::MM_AFFINE;
424  RansacParams ransacParams = RansacParams::default2dMotion(model);
425  float minInlierRatio = 0.1f;
426  for (; first != last; first += 2) {
427  string key(first->toString());
428  const MxArray& val = *(first + 1);
429  if (key == "MotionModel")
430  model = MotionModelMap[val.toString()];
431  else if (key == "RansacParams")
432  ransacParams = (val.isStruct() ? toRansacParams(val) :
433  RansacParams::default2dMotion(MotionModelMap[val.toString()]));
434  else if (key == "MinInlierRatio")
435  minInlierRatio = val.toFloat();
436  else
437  mexErrMsgIdAndTxt("mexopencv:error",
438  "Unrecognized option %s", key.c_str());
439  }
440  Ptr<MotionEstimatorRansacL2> p = makePtr<MotionEstimatorRansacL2>(model);
441  if (p.empty())
442  mexErrMsgIdAndTxt("mexopencv:error",
443  "Failed to create MotionEstimatorRansacL2");
444  p->setRansacParams(ransacParams);
445  p->setMinInlierRatio(minInlierRatio);
446  return p;
447 }
448 
449 Ptr<MotionEstimatorBase> createMotionEstimatorBase(
450  const string& type,
451  vector<MxArray>::const_iterator first,
452  vector<MxArray>::const_iterator last)
453 {
454  Ptr<MotionEstimatorBase> p;
455  if (type == "MotionEstimatorL1")
456  p = createMotionEstimatorL1(first, last);
457  else if (type == "MotionEstimatorRansacL2")
458  p = createMotionEstimatorRansacL2(first, last);
459  else
460  mexErrMsgIdAndTxt("mexopencv:error",
461  "Unrecognized motion estimator %s", type.c_str());
462  if (p.empty())
463  mexErrMsgIdAndTxt("mexopencv:error",
464  "Failed to create MotionEstimatorBase");
465  return p;
466 }
467 
468 Ptr<SparsePyrLkOptFlowEstimator> createSparsePyrLkOptFlowEstimator(
469  vector<MxArray>::const_iterator first,
470  vector<MxArray>::const_iterator last)
471 {
472  ptrdiff_t len = std::distance(first, last);
473  nargchk((len%2)==0);
474  Ptr<SparsePyrLkOptFlowEstimator> p = makePtr<SparsePyrLkOptFlowEstimator>();
475  if (p.empty())
476  mexErrMsgIdAndTxt("mexopencv:error",
477  "Failed to create SparsePyrLkOptFlowEstimator");
478  for (; first != last; first += 2) {
479  string key(first->toString());
480  const MxArray& val = *(first + 1);
481  if (key == "WinSize")
482  p->setWinSize(val.toSize());
483  else if (key == "MaxLevel")
484  p->setMaxLevel(val.toInt());
485  else
486  mexErrMsgIdAndTxt("mexopencv:error",
487  "Unrecognized option %s", key.c_str());
488  }
489  return p;
490 }
491 
492 Ptr<ISparseOptFlowEstimator> createISparseOptFlowEstimator(
493  const string& type,
494  vector<MxArray>::const_iterator first,
495  vector<MxArray>::const_iterator last)
496 {
497  Ptr<ISparseOptFlowEstimator> p;
498  if (type == "SparsePyrLkOptFlowEstimator")
499  p = createSparsePyrLkOptFlowEstimator(first, last);
500  else
501  mexErrMsgIdAndTxt("mexopencv:error",
502  "Unrecognized sparse optical flow estimator %s", type.c_str());
503  if (p.empty())
504  mexErrMsgIdAndTxt("mexopencv:error",
505  "Failed to create ISparseOptFlowEstimator");
506  return p;
507 }
508 
509 Ptr<IDenseOptFlowEstimator> createIDenseOptFlowEstimator(
510  const string& type,
511  vector<MxArray>::const_iterator /*first*/,
512  vector<MxArray>::const_iterator /*last*/)
513 {
514  Ptr<IDenseOptFlowEstimator> p;
515  if (type == "DensePyrLkOptFlowEstimatorGpu")
516  // TODO: no CPU version, only CUDA
517  ; //p = createDensePyrLkOptFlowEstimatorGpu(first, last);
518  else
519  mexErrMsgIdAndTxt("mexopencv:error",
520  "Unrecognized dense optical flow estimator %s", type.c_str());
521  if (p.empty())
522  mexErrMsgIdAndTxt("mexopencv:error",
523  "Failed to create IDenseOptFlowEstimator");
524  return p;
525 }
526 
527 Ptr<TranslationBasedLocalOutlierRejector> createTranslationBasedLocalOutlierRejector(
528  vector<MxArray>::const_iterator first,
529  vector<MxArray>::const_iterator last)
530 {
531  ptrdiff_t len = std::distance(first, last);
532  nargchk((len%2)==0);
533  Ptr<TranslationBasedLocalOutlierRejector> p = makePtr<TranslationBasedLocalOutlierRejector>();
534  if (p.empty())
535  mexErrMsgIdAndTxt("mexopencv:error",
536  "Failed to create TranslationBasedLocalOutlierRejector");
537  for (; first != last; first += 2) {
538  string key(first->toString());
539  const MxArray& val = *(first + 1);
540  if (key == "CellSize")
541  p->setCellSize(val.toSize());
542  else if (key == "RansacParams")
543  p->setRansacParams((val.isStruct()) ? toRansacParams(val) :
544  RansacParams::default2dMotion(MotionModelMap[val.toString()]));
545  else
546  mexErrMsgIdAndTxt("mexopencv:error",
547  "Unrecognized option %s", key.c_str());
548  }
549  return p;
550 }
551 
552 Ptr<IOutlierRejector> createIOutlierRejector(
553  const string& type,
554  vector<MxArray>::const_iterator first,
555  vector<MxArray>::const_iterator last)
556 {
557  ptrdiff_t len = std::distance(first, last);
558  Ptr<IOutlierRejector> p;
559  if (type == "TranslationBasedLocalOutlierRejector")
561  else if (type == "NullOutlierRejector") {
562  nargchk(len==0);
563  p = makePtr<NullOutlierRejector>();
564  }
565  else
566  mexErrMsgIdAndTxt("mexopencv:error",
567  "Unrecognized outlier rejector %s", type.c_str());
568  if (p.empty())
569  mexErrMsgIdAndTxt("mexopencv:error",
570  "Failed to create IOutlierRejector");
571  return p;
572 }
573 
574 Ptr<KeypointBasedMotionEstimator> createKeypointBasedMotionEstimator(
575  vector<MxArray>::const_iterator first,
576  vector<MxArray>::const_iterator last)
577 {
578  ptrdiff_t len = std::distance(first, last);
579  nargchk(len>=1 && (len%2)==1);
580  Ptr<KeypointBasedMotionEstimator> p;
581  {
582  vector<MxArray> args(first->toVector<MxArray>()); ++first;
583  nargchk(args.size() >= 1);
584  Ptr<MotionEstimatorBase> estimator = createMotionEstimatorBase(
585  args[0].toString(), args.begin() + 1, args.end());
586  p = makePtr<KeypointBasedMotionEstimator>(estimator);
587  }
588  if (p.empty())
589  mexErrMsgIdAndTxt("mexopencv:error",
590  "Failed to create KeypointBasedMotionEstimator");
591  for (; first != last; first += 2) {
592  string key(first->toString());
593  const MxArray& val = *(first + 1);
594  if (key == "MotionModel")
595  p->setMotionModel(MotionModelMap[val.toString()]);
596  else if (key == "Detector") {
597  vector<MxArray> args(val.toVector<MxArray>());
598  nargchk(args.size() >= 1);
599  Ptr<FeatureDetector> pp = createFeatureDetector(
600  args[0].toString(), args.begin() + 1, args.end());
601  p->setDetector(pp);
602  }
603  else if (key == "OpticalFlowEstimator") {
604  vector<MxArray> args(val.toVector<MxArray>());
605  nargchk(args.size() >= 1);
606  Ptr<ISparseOptFlowEstimator> pp = createISparseOptFlowEstimator(
607  args[0].toString(), args.begin() + 1, args.end());
608  p->setOpticalFlowEstimator(pp);
609  }
610  else if (key == "OutlierRejector") {
611  vector<MxArray> args(val.toVector<MxArray>());
612  nargchk(args.size() >= 1);
613  Ptr<IOutlierRejector> pp = createIOutlierRejector(
614  args[0].toString(), args.begin() + 1, args.end());
615  p->setOutlierRejector(pp);
616  }
617  else
618  mexErrMsgIdAndTxt("mexopencv:error",
619  "Unrecognized option %s", key.c_str());
620  }
621  return p;
622 }
623 
624 Ptr<FromFileMotionReader> createFromFileMotionReader(
625  vector<MxArray>::const_iterator first,
626  vector<MxArray>::const_iterator last)
627 {
628  ptrdiff_t len = std::distance(first, last);
629  nargchk(len>=1 && (len%2)==1);
630  string path(first->toString()); ++first;
631  Ptr<FromFileMotionReader> p = makePtr<FromFileMotionReader>(path);
632  if (p.empty())
633  mexErrMsgIdAndTxt("mexopencv:error",
634  "Failed to create FromFileMotionReader");
635  for (; first != last; first += 2) {
636  string key(first->toString());
637  const MxArray& val = *(first + 1);
638  if (key == "MotionModel")
639  p->setMotionModel(MotionModelMap[val.toString()]);
640  else
641  mexErrMsgIdAndTxt("mexopencv:error",
642  "Unrecognized option %s", key.c_str());
643  }
644  return p;
645 }
646 
647 Ptr<ToFileMotionWriter> createToFileMotionWriter(
648  vector<MxArray>::const_iterator first,
649  vector<MxArray>::const_iterator last)
650 {
651  ptrdiff_t len = std::distance(first, last);
652  nargchk(len>=2 && (len%2)==0);
653  Ptr<ToFileMotionWriter> p;
654  {
655  string path(first->toString()); ++first;
656  vector<MxArray> args(first->toVector<MxArray>()); ++first;
657  nargchk(args.size() >= 1);
658  Ptr<ImageMotionEstimatorBase> estimator = createImageMotionEstimator(
659  args[0].toString(), args.begin() + 1, args.end());
660  p = makePtr<ToFileMotionWriter>(path, estimator);
661  }
662  if (p.empty())
663  mexErrMsgIdAndTxt("mexopencv:error",
664  "Failed to create ToFileMotionWriter");
665  for (; first != last; first += 2) {
666  string key(first->toString());
667  const MxArray& val = *(first + 1);
668  if (key == "MotionModel")
669  p->setMotionModel(MotionModelMap[val.toString()]);
670  else
671  mexErrMsgIdAndTxt("mexopencv:error",
672  "Unrecognized option %s", key.c_str());
673  }
674  return p;
675 }
676 
677 Ptr<ImageMotionEstimatorBase> createImageMotionEstimator(
678  const string& type,
679  vector<MxArray>::const_iterator first,
680  vector<MxArray>::const_iterator last)
681 {
682  Ptr<ImageMotionEstimatorBase> p;
683  if (type == "KeypointBasedMotionEstimator")
684  p = createKeypointBasedMotionEstimator(first, last);
685  else if (type == "FromFileMotionReader")
686  p = createFromFileMotionReader(first, last);
687  else if (type == "ToFileMotionWriter")
688  p = createToFileMotionWriter(first, last);
689  else
690  mexErrMsgIdAndTxt("mexopencv:error",
691  "Unrecognized image motion estimator %s", type.c_str());
692  if (p.empty())
693  mexErrMsgIdAndTxt("mexopencv:error",
694  "Failed to create ImageMotionEstimatorBase");
695  return p;
696 }
697 
698 Ptr<ColorInpainter> createColorInpainter(
699  vector<MxArray>::const_iterator first,
700  vector<MxArray>::const_iterator last)
701 {
702  ptrdiff_t len = std::distance(first, last);
703  nargchk((len%2)==0);
704  int method = cv::INPAINT_TELEA;
705  double radius2 = 2.0;
706  int radius = 0;
707  MotionModel model = cv::videostab::MM_UNKNOWN;
708  for (; first != last; first += 2) {
709  string key(first->toString());
710  const MxArray& val = *(first + 1);
711  // Frames, Motions, StabilizedFrames, StabilizationMotions: data from stabilizer
712  if (key == "Method")
713  method = InpaintingAlgMap[val.toString()];
714  else if (key == "Radius2")
715  radius2 = val.toDouble();
716  else if (key == "MotionModel")
717  model = MotionModelMap[val.toString()];
718  else if (key == "Radius")
719  radius = val.toInt();
720  else
721  mexErrMsgIdAndTxt("mexopencv:error",
722  "Unrecognized option %s", key.c_str());
723  }
724  Ptr<ColorInpainter> p = makePtr<ColorInpainter>(method, radius2);
725  if (p.empty())
726  mexErrMsgIdAndTxt("mexopencv:error",
727  "Failed to create ColorInpainter");
728  p->setMotionModel(model);
729  p->setRadius(radius);
730  return p;
731 }
732 
733 Ptr<ColorAverageInpainter> createColorAverageInpainter(
734  vector<MxArray>::const_iterator first,
735  vector<MxArray>::const_iterator last)
736 {
737  ptrdiff_t len = std::distance(first, last);
738  nargchk((len%2)==0);
739  Ptr<ColorAverageInpainter> p = makePtr<ColorAverageInpainter>();
740  if (p.empty())
741  mexErrMsgIdAndTxt("mexopencv:error",
742  "Failed to create ColorAverageInpainter");
743  for (; first != last; first += 2) {
744  string key(first->toString());
745  const MxArray& val = *(first + 1);
746  // Frames, Motions, StabilizedFrames, StabilizationMotions: data from stabilizer
747  if (key == "MotionModel")
748  p->setMotionModel(MotionModelMap[val.toString()]);
749  else if (key == "Radius")
750  p->setRadius(val.toInt());
751  else
752  mexErrMsgIdAndTxt("mexopencv:error",
753  "Unrecognized option %s", key.c_str());
754  }
755  return p;
756 }
757 
758 Ptr<ConsistentMosaicInpainter> createConsistentMosaicInpainter(
759  vector<MxArray>::const_iterator first,
760  vector<MxArray>::const_iterator last)
761 {
762  ptrdiff_t len = std::distance(first, last);
763  nargchk((len%2)==0);
764  Ptr<ConsistentMosaicInpainter> p = makePtr<ConsistentMosaicInpainter>();
765  if (p.empty())
766  mexErrMsgIdAndTxt("mexopencv:error",
767  "Failed to create ConsistentMosaicInpainter");
768  for (; first != last; first += 2) {
769  string key(first->toString());
770  const MxArray& val = *(first + 1);
771  // Frames, Motions, StabilizedFrames, StabilizationMotions: data from stabilizer
772  if (key == "MotionModel")
773  p->setMotionModel(MotionModelMap[val.toString()]);
774  else if (key == "Radius")
775  p->setRadius(val.toInt());
776  else if (key == "StdevThresh")
777  p->setStdevThresh(val.toFloat());
778  else
779  mexErrMsgIdAndTxt("mexopencv:error",
780  "Unrecognized option %s", key.c_str());
781  }
782  return p;
783 }
784 
785 Ptr<MotionInpainter> createMotionInpainter(
786  vector<MxArray>::const_iterator first,
787  vector<MxArray>::const_iterator last)
788 {
789  ptrdiff_t len = std::distance(first, last);
790  nargchk((len%2)==0);
791  Ptr<MotionInpainter> p = makePtr<MotionInpainter>();
792  if (p.empty())
793  mexErrMsgIdAndTxt("mexopencv:error",
794  "Failed to create MotionInpainter");
795  for (; first != last; first += 2) {
796  string key(first->toString());
797  const MxArray& val = *(first + 1);
798  // Frames, Motions, StabilizedFrames, StabilizationMotions: data from stabilizer
799  if (key == "MotionModel")
800  p->setMotionModel(MotionModelMap[val.toString()]);
801  else if (key == "Radius")
802  p->setRadius(val.toInt());
803  else if (key == "FlowErrorThreshold")
804  p->setFlowErrorThreshold(val.toFloat());
805  else if (key == "DistThreshold")
806  p->setDistThreshold(val.toFloat());
807  else if (key == "BorderMode")
808  p->setBorderMode(BorderType[val.toString()]);
809  else if (key == "OptFlowEstimator") {
810  vector<MxArray> args(val.toVector<MxArray>());
811  nargchk(args.size() >= 1);
812  Ptr<IDenseOptFlowEstimator> pp = createIDenseOptFlowEstimator(
813  args[0].toString(), args.begin() + 1, args.end());
814  p->setOptFlowEstimator(pp);
815  }
816  else
817  mexErrMsgIdAndTxt("mexopencv:error",
818  "Unrecognized option %s", key.c_str());
819  }
820  return p;
821 }
822 
823 Ptr<InpaintingPipeline> createInpaintingPipeline(
824  vector<MxArray>::const_iterator first,
825  vector<MxArray>::const_iterator last)
826 {
827  ptrdiff_t len = std::distance(first, last);
828  nargchk(len>=1 && (len%2)==1);
829  Ptr<InpaintingPipeline> p = makePtr<InpaintingPipeline>();
830  if (p.empty())
831  mexErrMsgIdAndTxt("mexopencv:error",
832  "Failed to create InpaintingPipeline");
833  {
834  vector<vector<MxArray> > inpainters(first->toVector(
835  const_mem_fun_ref_t<vector<MxArray>, MxArray>(
836  &MxArray::toVector<MxArray>))); ++first;
837  for (vector<vector<MxArray> >::const_iterator it = inpainters.begin(); it != inpainters.end(); ++it) {
838  nargchk(it->size() >= 1);
839  Ptr<InpainterBase> inpainter = createInpainterBase(
840  (*it)[0].toString(), it->begin() + 1, it->end());
841  p->pushBack(inpainter);
842  }
843  }
844  for (; first != last; first += 2) {
845  string key(first->toString());
846  const MxArray& val = *(first + 1);
847  // Frames, Motions, StabilizedFrames, StabilizationMotions: data from stabilizer
848  if (key == "MotionModel")
849  p->setMotionModel(MotionModelMap[val.toString()]);
850  else if (key == "Radius")
851  p->setRadius(val.toInt());
852  else
853  mexErrMsgIdAndTxt("mexopencv:error",
854  "Unrecognized option %s", key.c_str());
855  }
856  return p;
857 }
858 
859 Ptr<InpainterBase> createInpainterBase(
860  const string& type,
861  vector<MxArray>::const_iterator first,
862  vector<MxArray>::const_iterator last)
863 {
864  ptrdiff_t len = std::distance(first, last);
865  Ptr<InpainterBase> p;
866  if (type == "ColorInpainter")
867  p = createColorInpainter(first, last);
868  else if (type == "ColorAverageInpainter")
869  p = createColorAverageInpainter(first, last);
870  else if (type == "ConsistentMosaicInpainter")
871  p = createConsistentMosaicInpainter(first, last);
872  else if (type == "MotionInpainter")
873  p = createMotionInpainter(first, last);
874  else if (type == "InpaintingPipeline")
875  p = createInpaintingPipeline(first, last);
876  else if (type == "NullInpainter") {
877  nargchk(len==0);
878  p = makePtr<NullInpainter>();
879  }
880  else
881  mexErrMsgIdAndTxt("mexopencv:error",
882  "Unrecognized inpainter %s", type.c_str());
883  if (p.empty())
884  mexErrMsgIdAndTxt("mexopencv:error",
885  "Failed to create InpainterBase");
886  return p;
887 }
888 
889 Ptr<GaussianMotionFilter> createGaussianMotionFilter(
890  vector<MxArray>::const_iterator first,
891  vector<MxArray>::const_iterator last)
892 {
893  ptrdiff_t len = std::distance(first, last);
894  nargchk((len%2)==0);
895  int radius = 15;
896  float stdev = -1.0f;
897  for (; first != last; first += 2) {
898  string key(first->toString());
899  const MxArray& val = *(first + 1);
900  if (key == "Radius")
901  radius = val.toInt();
902  else if (key == "Stdev")
903  stdev = val.toFloat();
904  else
905  mexErrMsgIdAndTxt("mexopencv:error",
906  "Unrecognized option %s", key.c_str());
907  }
908  return makePtr<GaussianMotionFilter>(radius, stdev);
909 }
910 
911 Ptr<MotionFilterBase> createMotionFilterBase(
912  const string& type,
913  vector<MxArray>::const_iterator first,
914  vector<MxArray>::const_iterator last)
915 {
916  Ptr<MotionFilterBase> p;
917  if (type == "GaussianMotionFilter")
918  p = createGaussianMotionFilter(first, last);
919  else
920  mexErrMsgIdAndTxt("mexopencv:error",
921  "Unrecognized motion filter %s", type.c_str());
922  if (p.empty())
923  mexErrMsgIdAndTxt("mexopencv:error",
924  "Failed to create MotionFilterBase");
925  return p;
926 }
927 
928 Ptr<LpMotionStabilizer> createLpMotionStabilizer(
929  vector<MxArray>::const_iterator first,
930  vector<MxArray>::const_iterator last)
931 {
932  ptrdiff_t len = std::distance(first, last);
933  nargchk((len%2)==0);
934  Ptr<LpMotionStabilizer> p = makePtr<LpMotionStabilizer>();
935  if (p.empty())
936  mexErrMsgIdAndTxt("mexopencv:error",
937  "Failed to create LpMotionStabilizer");
938  for (; first != last; first += 2) {
939  string key(first->toString());
940  const MxArray& val = *(first + 1);
941  if (key == "MotionModel")
942  p->setMotionModel(MotionModelMap[val.toString()]);
943  else if (key == "FrameSize")
944  p->setFrameSize(val.toSize());
945  else if (key == "TrimRatio")
946  p->setTrimRatio(val.toFloat());
947  else if (key == "Weight1")
948  p->setWeight1(val.toFloat());
949  else if (key == "Weight2")
950  p->setWeight2(val.toFloat());
951  else if (key == "Weight3")
952  p->setWeight3(val.toFloat());
953  else if (key == "Weight4")
954  p->setWeight4(val.toFloat());
955  else
956  mexErrMsgIdAndTxt("mexopencv:error",
957  "Unrecognized option %s", key.c_str());
958  }
959  return p;
960 }
961 
962 Ptr<MotionStabilizationPipeline> createMotionStabilizationPipeline(
963  vector<MxArray>::const_iterator first,
964  vector<MxArray>::const_iterator last)
965 {
966  ptrdiff_t len = std::distance(first, last);
967  nargchk(len==1);
968  Ptr<MotionStabilizationPipeline> p = makePtr<MotionStabilizationPipeline>();
969  if (p.empty())
970  mexErrMsgIdAndTxt("mexopencv:error",
971  "Failed to create MotionStabilizationPipeline");
972  {
973  vector<vector<MxArray> > stabilizers(first->toVector(
974  const_mem_fun_ref_t<vector<MxArray>, MxArray>(
975  &MxArray::toVector<MxArray>))); ++first;
976  for (vector<vector<MxArray> >::const_iterator it = stabilizers.begin(); it != stabilizers.end(); ++it) {
977  nargchk(it->size() >= 1);
978  Ptr<IMotionStabilizer> stabilizer = createIMotionStabilizer(
979  (*it)[0].toString(), it->begin() + 1, it->end());
980  p->pushBack(stabilizer);
981  }
982  }
983  return p;
984 }
985 
986 Ptr<IMotionStabilizer> createIMotionStabilizer(
987  const string& type,
988  vector<MxArray>::const_iterator first,
989  vector<MxArray>::const_iterator last)
990 {
991  Ptr<IMotionStabilizer> p;
992  if (type == "LpMotionStabilizer")
993  p = createLpMotionStabilizer(first, last);
994  else if (type == "GaussianMotionFilter")
995  p = createGaussianMotionFilter(first, last);
996  else if (type == "MotionStabilizationPipeline")
997  p = createMotionStabilizationPipeline(first, last);
998  else
999  mexErrMsgIdAndTxt("mexopencv:error",
1000  "Unrecognized motion stabilizer %s", type.c_str());
1001  if (p.empty())
1002  mexErrMsgIdAndTxt("mexopencv:error",
1003  "Failed to create IMotionStabilizer");
1004  return p;
1005 }
1006 
1007 Ptr<MoreAccurateMotionWobbleSuppressor> createMoreAccurateMotionWobbleSuppressor(
1008  vector<MxArray>::const_iterator first,
1009  vector<MxArray>::const_iterator last)
1010 {
1011  ptrdiff_t len = std::distance(first, last);
1012  nargchk((len%2)==0);
1013  Ptr<MoreAccurateMotionWobbleSuppressor> p = makePtr<MoreAccurateMotionWobbleSuppressor>();
1014  if (p.empty())
1015  mexErrMsgIdAndTxt("mexopencv:error",
1016  "Failed to create MoreAccurateMotionWobbleSuppressor");
1017  for (; first != last; first += 2) {
1018  string key(first->toString());
1019  const MxArray& val = *(first + 1);
1020  // FrameCount, Motions, Motions2, StabilizationMotions: data from stabilizer
1021  if (key == "MotionEstimator") {
1022  vector<MxArray> args(val.toVector<MxArray>());
1023  nargchk(args.size() >= 1);
1024  Ptr<ImageMotionEstimatorBase> pp = createImageMotionEstimator(
1025  args[0].toString(), args.begin() + 1, args.end());
1026  p->setMotionEstimator(pp);
1027  }
1028  else if (key == "Period")
1029  p->setPeriod(val.toInt());
1030  else
1031  mexErrMsgIdAndTxt("mexopencv:error",
1032  "Unrecognized option %s", key.c_str());
1033  }
1034  return p;
1035 }
1036 
1037 Ptr<WobbleSuppressorBase> createWobbleSuppressorBase(
1038  const string& type,
1039  vector<MxArray>::const_iterator first,
1040  vector<MxArray>::const_iterator last)
1041 {
1042  ptrdiff_t len = std::distance(first, last);
1043  Ptr<WobbleSuppressorBase> p;
1044  if (type == "MoreAccurateMotionWobbleSuppressor")
1046  else if (type == "NullWobbleSuppressor") {
1047  nargchk(len==0);
1048  p = makePtr<NullWobbleSuppressor>();
1049  }
1050  else
1051  mexErrMsgIdAndTxt("mexopencv:error",
1052  "Unrecognized wobble suppressor %s", type.c_str());
1053  if (p.empty())
1054  mexErrMsgIdAndTxt("mexopencv:error",
1055  "Failed to create WobbleSuppressorBase");
1056  return p;
1057 }
1058 
cv::Ptr< cv::videostab::GaussianMotionFilter > createGaussianMotionFilter(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of GaussianMotionFilter using options in arguments.
cv::Ptr< cv::videostab::MotionEstimatorRansacL2 > createMotionEstimatorRansacL2(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MotionEstimatorRansacL2 using options in arguments.
Common definitions for the videostab module.
cv::Ptr< cv::videostab::ConsistentMosaicInpainter > createConsistentMosaicInpainter(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ConsistentMosaicInpainter using options in arguments.
cv::Ptr< cv::videostab::MotionEstimatorL1 > createMotionEstimatorL1(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MotionEstimatorL1 using options in arguments.
cv::Ptr< cv::videostab::IDenseOptFlowEstimator > createIDenseOptFlowEstimator(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of IDenseOptFlowEstimator using options in arguments.
cv::Ptr< cv::videostab::DeblurerBase > createDeblurerBase(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of DeblurerBase using options in arguments.
cv::Ptr< cv::videostab::InpainterBase > createInpainterBase(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of InpainterBase using options in arguments.
cv::Ptr< cv::videostab::MoreAccurateMotionWobbleSuppressor > createMoreAccurateMotionWobbleSuppressor(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MoreAccurateMotionWobbleSuppressor using options in arguments.
cv::Ptr< cv::videostab::WeightingDeblurer > createWeightingDeblurer(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of WeightingDeblurer using options in arguments.
cv::Ptr< cv::videostab::LpMotionStabilizer > createLpMotionStabilizer(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of LpMotionStabilizer using options in arguments.
cv::Ptr< cv::videostab::KeypointBasedMotionEstimator > createKeypointBasedMotionEstimator(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of KeypointBasedMotionEstimator using options in arguments.
cv::Ptr< cv::videostab::IMotionStabilizer > createIMotionStabilizer(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of IMotionStabilizer using options in arguments.
cv::Ptr< cv::videostab::ColorInpainter > createColorInpainter(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ColorInpainter using options in arguments.
const ConstMap< string, int > InpaintingAlgMap
inpainting algorithm types for option processing
void set(mwIndex index, const T &value)
Template for numeric array element write accessor.
Definition: MxArray.hpp:1310
cv::Ptr< cv::videostab::SparsePyrLkOptFlowEstimator > createSparsePyrLkOptFlowEstimator(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of SparsePyrLkOptFlowEstimator using options in arguments.
cv::Ptr< cv::videostab::MotionStabilizationPipeline > createMotionStabilizationPipeline(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MotionStabilizationPipeline using options in arguments.
cv::Ptr< cv::videostab::ColorAverageInpainter > createColorAverageInpainter(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ColorAverageInpainter using options in arguments.
MxArray toStruct(const std::vector< cv::ml::DTrees::Node > &nodes)
Convert tree nodes to struct array.
const ConstMap< int, std::string > BorderTypeInv
Inverse border type map for option processing.
Definition: mexopencv.hpp:62
int toInt() const
Convert MxArray to int.
Definition: MxArray.cpp:489
cv::Ptr< cv::videostab::MotionInpainter > createMotionInpainter(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MotionInpainter using options in arguments.
cv::Ptr< cv::videostab::WobbleSuppressorBase > createWobbleSuppressorBase(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of WobbleSuppressorBase using options in arguments.
const ConstMap< cv::videostab::MotionModel, std::string > MotionModelInvMap
inverse motion model types for option processing
cv::Ptr< cv::videostab::ISparseOptFlowEstimator > createISparseOptFlowEstimator(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ISparseOptFlowEstimator using options in arguments.
cv::Ptr< cv::videostab::FromFileMotionReader > createFromFileMotionReader(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of FromFileMotionReader using options in arguments.
cv::Ptr< cv::FeatureDetector > createFeatureDetector(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Factory function for FeatureDetector creation.
const ConstMap< std::string, int > BorderType
Border type map for option processing.
Definition: mexopencv.hpp:52
cv::Ptr< cv::videostab::TranslationBasedLocalOutlierRejector > createTranslationBasedLocalOutlierRejector(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of createTranslationBasedLocalOutlierRejector using options in arguments...
const ConstMap< std::string, cv::videostab::MotionModel > MotionModelMap
motion model types for option processing
cv::Ptr< cv::videostab::IFrameSource > createIFrameSource(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of IFrameSource using options in arguments.
mxArray object wrapper for data conversion and manipulation.
Definition: MxArray.hpp:123
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Definition: mexopencv.hpp:166
static MxArray Struct(const char **fields=NULL, int nfields=0, mwSize m=1, mwSize n=1)
Create a new struct array.
Definition: MxArray.hpp:312
bool toBool() const
Convert MxArray to bool.
Definition: MxArray.cpp:510
cv::Ptr< cv::videostab::IOutlierRejector > createIOutlierRejector(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of IOutlierRejector using options in arguments.
cv::Ptr< cv::videostab::ToFileMotionWriter > createToFileMotionWriter(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ToFileMotionWriter using options in arguments.
cv::Ptr< cv::videostab::VideoFileSource > createVideoFileSource(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of VideoFileSource using options in arguments.
cv::Ptr< cv::videostab::ImageMotionEstimatorBase > createImageMotionEstimator(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of ImageMotionEstimatorBase using options in arguments.
T at(mwIndex index) const
Template for numeric array element accessor.
Definition: MxArray.hpp:1250
RansacParams toRansacParams(const MxArray &arr)
Convert MxArray to RansacParams.
std::map wrapper with one-line initialization and lookup method.
Definition: MxArray.hpp:927
cv::Ptr< cv::videostab::MotionFilterBase > createMotionFilterBase(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MotionFilterBase using options in arguments.
cv::Ptr< cv::videostab::InpaintingPipeline > createInpaintingPipeline(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of InpaintingPipeline using options in arguments.
cv::Ptr< cv::videostab::ILog > createILog(const std::string &type)
Create an instance of ILog of the specified type.
cv::Ptr< cv::videostab::MotionEstimatorBase > createMotionEstimatorBase(const std::string &type, std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of MotionEstimatorBase using options in arguments.