OpenCV 4.5.3(日本語機械翻訳)
rlofflow.hpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4 #ifndef __OPENCV_OPTFLOW_RLOFFLOW_HPP__
5 #define __OPENCV_OPTFLOW_RLOFFLOW_HPP__
6
7 #include "opencv2/core.hpp"
8 #include "opencv2/video.hpp"
9
10 namespace cv
11{
12 namespace optflow
13{
16
19 SR_CROSS = 1
22 };
25 ST_BILINEAR = 1
28 };
29
31{
35};
36
64 class CV_EXPORTS_W RLOFOpticalFlowParameter{
65 public:
67 :solverType(ST_BILINEAR)
68 ,supportRegionType(SR_CROSS)
71 ,smallWinSize(9)
72 ,largeWinSize(21)
73 ,crossSegmentationThreshold(25)
74 ,maxLevel(4)
75 ,useInitialFlow(false)
76 ,useIlluminationModel(true)
77 ,useGlobalMotionPrior(true)
78 ,maxIteration(30)
79 ,minEigenValue(0.0001f)
80 ,globalMotionRansacThreshold(10)
81 {}
82
155
160 CV_WRAP void setUseMEstimator(bool val);
161
162 CV_WRAP void setSolverType(SolverType val);
163 CV_WRAP SolverType getSolverType() const;
164
165 CV_WRAP void setSupportRegionType(SupportRegionType val);
166 CV_WRAP SupportRegionType getSupportRegionType() const;
167
168 CV_WRAP void setNormSigma0(float val);
169 CV_WRAP float getNormSigma0() const;
170
171 CV_WRAP void setNormSigma1(float val);
172 CV_WRAP float getNormSigma1() const;
173
174 CV_WRAP void setSmallWinSize(int val);
175 CV_WRAP int getSmallWinSize() const;
176
177 CV_WRAP void setLargeWinSize(int val);
178 CV_WRAP int getLargeWinSize() const;
179
180 CV_WRAP void setCrossSegmentationThreshold(int val);
181 CV_WRAP int getCrossSegmentationThreshold() const;
182
183 CV_WRAP void setMaxLevel(int val);
184 CV_WRAP int getMaxLevel() const;
185
186 CV_WRAP void setUseInitialFlow(bool val);
187 CV_WRAP bool getUseInitialFlow() const;
188
189 CV_WRAP void setUseIlluminationModel(bool val);
190 CV_WRAP bool getUseIlluminationModel() const;
191
192 CV_WRAP void setUseGlobalMotionPrior(bool val);
193 CV_WRAP bool getUseGlobalMotionPrior() const;
194
195 CV_WRAP void setMaxIteration(int val);
196 CV_WRAP int getMaxIteration() const;
197
198 CV_WRAP void setMinEigenValue(float val);
199 CV_WRAP float getMinEigenValue() const;
200
201 CV_WRAP void setGlobalMotionRansacThreshold(float val);
202 CV_WRAP float getGlobalMotionRansacThreshold() const;
203
205 CV_WRAP static Ptr<RLOFOpticalFlowParameter> create();
206};
207
233 class CV_EXPORTS_W DenseRLOFOpticalFlow : public DenseOpticalFlow
234{
235 public:
237
240 CV_WRAP virtual void setRLOFOpticalFlowParameter(Ptr<RLOFOpticalFlowParameter> val) = 0;
244 CV_WRAP virtual Ptr<RLOFOpticalFlowParameter> getRLOFOpticalFlowParameter() const = 0;
246
253 CV_WRAP virtual void setForwardBackward(float val) = 0;
257 CV_WRAP virtual float getForwardBackward() const = 0;
259
263 CV_WRAP virtual Size getGridStep() const = 0;
267 CV_WRAP virtual void setGridStep(Size val) = 0;
268
270
275 CV_WRAP virtual void setInterpolation(InterpolationType val) = 0;
279 CV_WRAP virtual InterpolationType getInterpolation() const = 0;
281
285 CV_WRAP virtual int getEPICK() const = 0;
289 CV_WRAP virtual void setEPICK(int val) = 0;
291
296 CV_WRAP virtual float getEPICSigma() const = 0;
300 CV_WRAP virtual void setEPICSigma(float val) = 0;
302
306 CV_WRAP virtual float getEPICLambda() const = 0;
310 CV_WRAP virtual void setEPICLambda(float val) = 0;
312
315 CV_WRAP virtual float getFgsLambda() const = 0;
319 CV_WRAP virtual void setFgsLambda(float val) = 0;
321
324 CV_WRAP virtual float getFgsSigma() const = 0;
328 CV_WRAP virtual void setFgsSigma(float val) = 0;
330
333 CV_WRAP virtual void setUsePostProc(bool val) = 0;
337 CV_WRAP virtual bool getUsePostProc() const = 0;
339
342 CV_WRAP virtual void setUseVariationalRefinement(bool val) = 0;
346 CV_WRAP virtual bool getUseVariationalRefinement() const = 0;
348
351 CV_WRAP virtual void setRICSPSize(int val) = 0;
355 CV_WRAP virtual int getRICSPSize() const = 0;
362 CV_WRAP virtual void setRICSLICType(int val) = 0;
366 CV_WRAP virtual int getRICSLICType() const = 0;
368
383 CV_WRAP static Ptr<DenseRLOFOpticalFlow> create(
385 float forwardBackwardThreshold = 1.f,
386 Size gridStep = Size(6, 6),
388 int epicK = 128,
389 float epicSigma = 0.05f,
390 float epicLambda = 999.0f,
391 int ricSPSize = 15,
392 int ricSLICType = 100,
393 bool use_post_proc = true,
394 float fgsLambda = 500.0f,
395 float fgsSigma = 1.5f,
396 bool use_variational_refinement = false);
397};
398
412 class CV_EXPORTS_W SparseRLOFOpticalFlow : public SparseOpticalFlow
413{
414 public:
417 CV_WRAP virtual void setRLOFOpticalFlowParameter(Ptr<RLOFOpticalFlowParameter> val) = 0;
421 CV_WRAP virtual Ptr<RLOFOpticalFlowParameter> getRLOFOpticalFlowParameter() const = 0;
423
430 CV_WRAP virtual void setForwardBackward(float val) = 0;
434 CV_WRAP virtual float getForwardBackward() const = 0;
435
437
441 CV_WRAP static Ptr<SparseRLOFOpticalFlow> create(
443 float forwardBackwardThreshold = 1.f);
444
445};
446
501 CV_EXPORTS_W void calcOpticalFlowDenseRLOF(InputArray I0, InputArray I1, InputOutputArray flow,
503 float forwardBackwardThreshold = 0, Size gridStep = Size(6, 6),
505 int epicK = 128, float epicSigma = 0.05f, float epicLambda = 100.f,
506 int ricSPSize = 15, int ricSLICType = 100,
507 bool use_post_proc = true, float fgsLambda = 500.0f, float fgsSigma = 1.5f,
508 bool use_variational_refinement = false);
509
538 CV_EXPORTS_W void calcOpticalFlowSparseRLOF(InputArray prevImg, InputArray nextImg,
539 InputArray prevPts, InputOutputArray nextPts,
540 OutputArray status, OutputArray err,
542 float forwardBackwardThreshold = 0);
543
546
550
551} // namespace
552} // namespace
553 #endif
Definition: mat.hpp:386
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
Definition: video/tracking.hpp:437
Template class for specifying the size of an image or rectangle.
Definition: core/types.hpp:316
Base interface for sparse optical flow algorithms.
Definition: video/tracking.hpp:454
Fast dense optical flow computation based on robust local optical flow (RLOF) algorithms and sparse-t...
Definition: rlofflow.hpp:234
This is used store and set up the parameters of the robust local optical flow (RLOF) algoritm.
Definition: rlofflow.hpp:64
SolverType solverType
Definition: rlofflow.hpp:83
float minEigenValue
Definition: rlofflow.hpp:143
SupportRegionType supportRegionType
Definition: rlofflow.hpp:88
int largeWinSize
Definition: rlofflow.hpp:107
bool useIlluminationModel
Definition: rlofflow.hpp:126
int maxLevel
Definition: rlofflow.hpp:117
float normSigma0
Definition: rlofflow.hpp:92
int maxIteration
Definition: rlofflow.hpp:139
float normSigma1
Definition: rlofflow.hpp:98
bool useGlobalMotionPrior
Definition: rlofflow.hpp:134
int smallWinSize
Definition: rlofflow.hpp:104
bool useInitialFlow
Definition: rlofflow.hpp:122
float globalMotionRansacThreshold
Definition: rlofflow.hpp:147
int crossSegmentationThreshold
Definition: rlofflow.hpp:112
Class used for calculation sparse optical flow and feature tracking with robust local optical flow (R...
Definition: rlofflow.hpp:413
CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst)
Calculates per-element maximum of two arrays or an array and a scalar.
CV_EXPORTS_W void calcOpticalFlowSparseRLOF(InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray err, Ptr< RLOFOpticalFlowParameter > rlofParam=Ptr< RLOFOpticalFlowParameter >(), float forwardBackwardThreshold=0)
Calculates fast optical flow for a sparse feature set using the robust local optical flow (RLOF) simi...
CV_EXPORTS_W Ptr< SparseOpticalFlow > createOptFlow_SparseRLOF()
Additional interface to the Sparse RLOF algorithm - optflow::calcOpticalFlowSparseRLOF()
CV_EXPORTS_W Ptr< DenseOpticalFlow > createOptFlow_DenseRLOF()
Additional interface to the Dense RLOF algorithm - optflow::calcOpticalFlowDenseRLOF()
CV_EXPORTS_W void calcOpticalFlowDenseRLOF(InputArray I0, InputArray I1, InputOutputArray flow, Ptr< RLOFOpticalFlowParameter > rlofParam=Ptr< RLOFOpticalFlowParameter >(), float forwardBackwardThreshold=0, Size gridStep=Size(6, 6), InterpolationType interp_type=InterpolationType::INTERP_EPIC, int epicK=128, float epicSigma=0.05f, float epicLambda=100.f, int ricSPSize=15, int ricSLICType=100, bool use_post_proc=true, float fgsLambda=500.0f, float fgsSigma=1.5f, bool use_variational_refinement=false)
Fast dense optical flow computation based on robust local optical flow (RLOF) algorithms and sparse-t...
SolverType
Definition: rlofflow.hpp:23
SupportRegionType
Definition: rlofflow.hpp:17
InterpolationType
Definition: rlofflow.hpp:31
@ ST_BILINEAR
Definition: rlofflow.hpp:25
@ ST_STANDART
Definition: rlofflow.hpp:24
@ SR_FIXED
Definition: rlofflow.hpp:18
@ SR_CROSS
Definition: rlofflow.hpp:19
@ INTERP_EPIC
Definition: rlofflow.hpp:33
@ INTERP_RIC
Definition: rlofflow.hpp:34
@ INTERP_GEO
Definition: rlofflow.hpp:32
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74