@@ -30,14 +30,16 @@ enum SolverType {
30
30
enum InterpolationType
31
31
{
32
32
INTERP_GEO = 0 , /* *< Fast geodesic interpolation, see @cite Geistert2016 */
33
- INTERP_EPIC = 1 , /* *< Edge-preserving interpolation, see @cite Revaud2015,Geistert2016. */
33
+ INTERP_EPIC = 1 , /* *< Edge-preserving interpolation using ximgproc::EdgeAwareInterpolator, see @cite Revaud2015,Geistert2016. */
34
+ INTERP_RIC = 2 , /* *< SLIC based robust interpolation using ximgproc::RICInterpolator, see @cite Hu2017. */
34
35
};
35
36
36
37
/* * @brief This is used store and set up the parameters of the robust local optical flow (RLOF) algoritm.
37
38
*
38
39
* The RLOF is a fast local optical flow approach described in @cite Senst2012 @cite Senst2013 @cite Senst2014
39
40
* and @cite Senst2016 similar to the pyramidal iterative Lucas-Kanade method as
40
- * proposed by @cite Bouguet00. The implementation is derived from optflow::calcOpticalFlowPyrLK().
41
+ * proposed by @cite Bouguet00. More details and experiments can be found in the following thesis @cite Senst2019.
42
+ * The implementation is derived from optflow::calcOpticalFlowPyrLK().
41
43
* This RLOF implementation can be seen as an improved pyramidal iterative Lucas-Kanade and includes
42
44
* a set of improving modules. The main improvements in respect to the pyramidal iterative Lucas-Kanade
43
45
* are:
@@ -200,7 +202,8 @@ class CV_EXPORTS_W RLOFOpticalFlowParameter{
200
202
*
201
203
* The RLOF is a fast local optical flow approach described in @cite Senst2012 @cite Senst2013 @cite Senst2014
202
204
* and @cite Senst2016 similar to the pyramidal iterative Lucas-Kanade method as
203
- * proposed by @cite Bouguet00. The implementation is derived from optflow::calcOpticalFlowPyrLK().
205
+ * proposed by @cite Bouguet00. More details and experiments can be found in the following thesis @cite Senst2019.
206
+ * The implementation is derived from optflow::calcOpticalFlowPyrLK().
204
207
*
205
208
* The sparse-to-dense interpolation scheme allows for fast computation of dense optical flow using RLOF (see @cite Geistert2016).
206
209
* For this scheme the following steps are applied:
@@ -324,6 +327,35 @@ class CV_EXPORTS_W DenseRLOFOpticalFlow : public DenseOpticalFlow
324
327
* @see ximgproc::fastGlobalSmootherFilter, setUsePostProc
325
328
*/
326
329
CV_WRAP virtual bool getUsePostProc () const = 0;
330
+ // ! @brief enables VariationalRefinement
331
+ /* *
332
+ * @see getUseVariationalRefinement
333
+ */
334
+ CV_WRAP virtual void setUseVariationalRefinement (bool val) = 0;
335
+ /* * @copybrief setUseVariationalRefinement
336
+ * @see ximgproc::fastGlobalSmootherFilter, setUsePostProc
337
+ */
338
+ CV_WRAP virtual bool getUseVariationalRefinement () const = 0;
339
+ // ! @brief Parameter to tune the approximate size of the superpixel used for oversegmentation.
340
+ /* *
341
+ * @see cv::ximgproc::createSuperpixelSLIC, cv::ximgproc::RICInterpolator
342
+ */
343
+ CV_WRAP virtual void setRICSPSize (int val) = 0;
344
+ /* * @copybrief setRICSPSize
345
+ * @see setRICSPSize
346
+ */
347
+ CV_WRAP virtual int getRICSPSize () const = 0;
348
+ /* * @brief Parameter to choose superpixel algorithm variant to use:
349
+ * - cv::ximgproc::SLICType SLIC segments image using a desired region_size (value: 100)
350
+ * - cv::ximgproc::SLICType SLICO will optimize using adaptive compactness factor (value: 101)
351
+ * - cv::ximgproc::SLICType MSLIC will optimize using manifold methods resulting in more content-sensitive superpixels (value: 102).
352
+ * @see cv::ximgproc::createSuperpixelSLIC, cv::ximgproc::RICInterpolator
353
+ */
354
+ CV_WRAP virtual void setRICSLICType (int val) = 0;
355
+ /* * @copybrief setRICSLICType
356
+ * @see setRICSLICType
357
+ */
358
+ CV_WRAP virtual int getRICSLICType () const = 0;
327
359
// ! @brief Creates instance of optflow::DenseRLOFOpticalFlow
328
360
/* *
329
361
* @param rlofParam see optflow::RLOFOpticalFlowParameter
@@ -333,9 +365,12 @@ class CV_EXPORTS_W DenseRLOFOpticalFlow : public DenseOpticalFlow
333
365
* @param epicK see setEPICK
334
366
* @param epicSigma see setEPICSigma
335
367
* @param epicLambda see setEPICLambda
368
+ * @param ricSPSize see setRICSPSize
369
+ * @param ricSLICType see setRICSLICType
336
370
* @param use_post_proc see setUsePostProc
337
371
* @param fgsLambda see setFgsLambda
338
372
* @param fgsSigma see setFgsSigma
373
+ * @param use_variational_refinement see setUseVariationalRefinement
339
374
*/
340
375
CV_WRAP static Ptr<DenseRLOFOpticalFlow> create (
341
376
Ptr<RLOFOpticalFlowParameter> rlofParam = Ptr<RLOFOpticalFlowParameter>(),
@@ -345,16 +380,20 @@ class CV_EXPORTS_W DenseRLOFOpticalFlow : public DenseOpticalFlow
345
380
int epicK = 128,
346
381
float epicSigma = 0.05f,
347
382
float epicLambda = 999.0f,
383
+ int ricSPSize = 15,
384
+ int ricSLICType = 100,
348
385
bool use_post_proc = true,
349
386
float fgsLambda = 500.0f,
350
- float fgsSigma = 1.5f);
387
+ float fgsSigma = 1.5f,
388
+ bool use_variational_refinement = false);
351
389
};
352
390
353
391
/* * @brief Class used for calculation sparse optical flow and feature tracking with robust local optical flow (RLOF) algorithms.
354
392
*
355
393
* The RLOF is a fast local optical flow approach described in @cite Senst2012 @cite Senst2013 @cite Senst2014
356
394
* and @cite Senst2016 similar to the pyramidal iterative Lucas-Kanade method as
357
- * proposed by @cite Bouguet00. The implementation is derived from optflow::calcOpticalFlowPyrLK().
395
+ * proposed by @cite Bouguet00. More details and experiments can be found in the following thesis @cite Senst2019.
396
+ * The implementation is derived from optflow::calcOpticalFlowPyrLK().
358
397
*
359
398
* For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details.
360
399
* Parameters have been described in @cite Senst2012, @cite Senst2013, @cite Senst2014 and @cite Senst2016.
@@ -401,7 +440,8 @@ class CV_EXPORTS_W SparseRLOFOpticalFlow : public SparseOpticalFlow
401
440
*
402
441
* The RLOF is a fast local optical flow approach described in @cite Senst2012 @cite Senst2013 @cite Senst2014
403
442
* and @cite Senst2016 similar to the pyramidal iterative Lucas-Kanade method as
404
- * proposed by @cite Bouguet00. The implementation is derived from optflow::calcOpticalFlowPyrLK().
443
+ * proposed by @cite Bouguet00. More details and experiments can be found in the following thesis @cite Senst2019.
444
+ * The implementation is derived from optflow::calcOpticalFlowPyrLK().
405
445
*
406
446
* The sparse-to-dense interpolation scheme allows for fast computation of dense optical flow using RLOF (see @cite Geistert2016).
407
447
* For this scheme the following steps are applied:
@@ -430,12 +470,15 @@ class CV_EXPORTS_W SparseRLOFOpticalFlow : public SparseOpticalFlow
430
470
* supported:
431
471
* - **INTERP_GEO** applies the fast geodesic interpolation, see @cite Geistert2016.
432
472
* - **INTERP_EPIC_RESIDUAL** applies the edge-preserving interpolation, see @cite Revaud2015,Geistert2016.
433
- * @param epicK see ximgproc::EdgeAwareInterpolator() sets the respective parameter.
434
- * @param epicSigma see ximgproc::EdgeAwareInterpolator() sets the respective parameter.
435
- * @param epicLambda see ximgproc::EdgeAwareInterpolator() sets the respective parameter.
473
+ * @param epicK see ximgproc::EdgeAwareInterpolator sets the respective parameter.
474
+ * @param epicSigma see ximgproc::EdgeAwareInterpolator sets the respective parameter.
475
+ * @param epicLambda see ximgproc::EdgeAwareInterpolator sets the respective parameter.
476
+ * @param ricSPSize see ximgproc::RICInterpolator sets the respective parameter.
477
+ * @param ricSLICType see ximgproc::RICInterpolator sets the respective parameter.
436
478
* @param use_post_proc enables ximgproc::fastGlobalSmootherFilter() parameter.
437
479
* @param fgsLambda sets the respective ximgproc::fastGlobalSmootherFilter() parameter.
438
480
* @param fgsSigma sets the respective ximgproc::fastGlobalSmootherFilter() parameter.
481
+ * @param use_variational_refinement enables VariationalRefinement
439
482
*
440
483
* Parameters have been described in @cite Senst2012, @cite Senst2013, @cite Senst2014, @cite Senst2016.
441
484
* For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details.
@@ -451,14 +494,17 @@ CV_EXPORTS_W void calcOpticalFlowDenseRLOF(InputArray I0, InputArray I1, InputOu
451
494
float forwardBackwardThreshold = 0, Size gridStep = Size(6 , 6 ),
452
495
InterpolationType interp_type = InterpolationType::INTERP_EPIC,
453
496
int epicK = 128, float epicSigma = 0.05f, float epicLambda = 100.f,
454
- bool use_post_proc = true, float fgsLambda = 500.0f, float fgsSigma = 1.5f);
497
+ int ricSPSize = 15, int ricSLICType = 100,
498
+ bool use_post_proc = true, float fgsLambda = 500.0f, float fgsSigma = 1.5f,
499
+ bool use_variational_refinement = false);
455
500
456
501
/* * @brief Calculates fast optical flow for a sparse feature set using the robust local optical flow (RLOF) similar
457
502
* to optflow::calcOpticalFlowPyrLK().
458
503
*
459
504
* The RLOF is a fast local optical flow approach described in @cite Senst2012 @cite Senst2013 @cite Senst2014
460
505
* and @cite Senst2016 similar to the pyramidal iterative Lucas-Kanade method as
461
- * proposed by @cite Bouguet00. The implementation is derived from optflow::calcOpticalFlowPyrLK().
506
+ * proposed by @cite Bouguet00. More details and experiments can be found in the following thesis @cite Senst2019.
507
+ * The implementation is derived from optflow::calcOpticalFlowPyrLK().
462
508
*
463
509
* @param prevImg first 8-bit input image. If The cross-based RLOF is used (by selecting optflow::RLOFOpticalFlowParameter::supportRegionType
464
510
* = SupportRegionType::SR_CROSS) image has to be a 8-bit 3 channel image.
0 commit comments