OpenCV for Unity
2.6.3
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
DIS optical flow algorithm. More...
Public Member Functions | |
int | getFinestScale () |
Finest level of the Gaussian pyramid on which the flow is computed (zero level corresponds to the original image resolution). The final flow is obtained by bilinear upscaling. More... | |
void | setFinestScale (int val) |
int | getPatchSize () |
Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases. More... | |
void | setPatchSize (int val) |
int | getPatchStride () |
Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality. More... | |
void | setPatchStride (int val) |
int | getGradientDescentIterations () |
Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases. More... | |
void | setGradientDescentIterations (int val) |
int | getVariationalRefinementIterations () |
Number of fixed point iterations of variational refinement per scale. Set to zero to disable variational refinement completely. Higher values will typically result in more smooth and high-quality flow. More... | |
void | setVariationalRefinementIterations (int val) |
float | getVariationalRefinementAlpha () |
Weight of the smoothness term. More... | |
void | setVariationalRefinementAlpha (float val) |
float | getVariationalRefinementDelta () |
Weight of the color constancy term. More... | |
void | setVariationalRefinementDelta (float val) |
float | getVariationalRefinementGamma () |
Weight of the gradient constancy term. More... | |
void | setVariationalRefinementGamma (float val) |
float | getVariationalRefinementEpsilon () |
Norm value shift for robust penalizer. More... | |
void | setVariationalRefinementEpsilon (float val) |
bool | getUseMeanNormalization () |
Whether to use mean-normalization of patches when computing patch distance. It is turned on by default as it typically provides a noticeable quality boost because of increased robustness to illumination variations. Turn it off if you are certain that your sequence doesn't contain any changes in illumination. More... | |
void | setUseMeanNormalization (bool val) |
bool | getUseSpatialPropagation () |
Whether to use spatial propagation of good optical flow vectors. This option is turned on by default, as it tends to work better on average and can sometimes help recover from major errors introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this option off can make the output flow field a bit smoother, however. More... | |
void | setUseSpatialPropagation (bool val) |
Public Member Functions inherited from OpenCVForUnity.VideoModule.DenseOpticalFlow | |
void | calc (Mat I0, Mat I1, Mat flow) |
Calculates an optical flow. More... | |
void | collectGarbage () |
Releases all inner buffers. More... | |
Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
IntPtr | getNativeObjAddr () |
virtual void | clear () |
Clears the algorithm state. More... | |
virtual bool | empty () |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More... | |
void | save (string filename) |
virtual string | getDefaultName () |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static new DISOpticalFlow | __fromPtr__ (IntPtr addr) |
static DISOpticalFlow | create (int preset) |
Creates an instance of DISOpticalFlow. More... | |
static DISOpticalFlow | create () |
Creates an instance of DISOpticalFlow. More... | |
Static Public Member Functions inherited from OpenCVForUnity.VideoModule.DenseOpticalFlow | |
static new DenseOpticalFlow | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
static Algorithm | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
Public Attributes | |
const int | PRESET_ULTRAFAST = 0 |
const int | PRESET_FAST = 1 |
const int | PRESET_MEDIUM = 2 |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
DIS optical flow algorithm.
This class implements the Dense Inverse Search (DIS) optical flow algorithm. More details about the algorithm can be found at [Kroeger2016] . Includes three presets with preselected parameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is still relatively fast, use DeepFlow if you need better quality and don't care about speed.
This implementation includes several additional features compared to the algorithm described in the paper, including spatial propagation of flow vectors (getUseSpatialPropagation), as well as an option to utilize an initial flow approximation passed to calc (which is, essentially, temporal propagation, if the previous frame's flow field is passed).
|
static |
|
static |
Creates an instance of DISOpticalFlow.
preset | one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM |
|
static |
Creates an instance of DISOpticalFlow.
preset | one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM |
|
protectedvirtual |
Reimplemented from OpenCVForUnity.VideoModule.DenseOpticalFlow.
int OpenCVForUnity.VideoModule.DISOpticalFlow.getFinestScale | ( | ) |
Finest level of the Gaussian pyramid on which the flow is computed (zero level corresponds to the original image resolution). The final flow is obtained by bilinear upscaling.
int OpenCVForUnity.VideoModule.DISOpticalFlow.getGradientDescentIterations | ( | ) |
Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.
int OpenCVForUnity.VideoModule.DISOpticalFlow.getPatchSize | ( | ) |
Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases.
int OpenCVForUnity.VideoModule.DISOpticalFlow.getPatchStride | ( | ) |
Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality.
bool OpenCVForUnity.VideoModule.DISOpticalFlow.getUseMeanNormalization | ( | ) |
Whether to use mean-normalization of patches when computing patch distance. It is turned on by default as it typically provides a noticeable quality boost because of increased robustness to illumination variations. Turn it off if you are certain that your sequence doesn't contain any changes in illumination.
bool OpenCVForUnity.VideoModule.DISOpticalFlow.getUseSpatialPropagation | ( | ) |
Whether to use spatial propagation of good optical flow vectors. This option is turned on by default, as it tends to work better on average and can sometimes help recover from major errors introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this option off can make the output flow field a bit smoother, however.
float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementAlpha | ( | ) |
Weight of the smoothness term.
float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementDelta | ( | ) |
Weight of the color constancy term.
float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementEpsilon | ( | ) |
Norm value shift for robust penalizer.
float OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementGamma | ( | ) |
Weight of the gradient constancy term.
int OpenCVForUnity.VideoModule.DISOpticalFlow.getVariationalRefinementIterations | ( | ) |
Number of fixed point iterations of variational refinement per scale. Set to zero to disable variational refinement completely. Higher values will typically result in more smooth and high-quality flow.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setFinestScale | ( | int | val | ) |
Finest level of the Gaussian pyramid on which the flow is computed (zero level corresponds to the original image resolution). The final flow is obtained by bilinear upscaling.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setGradientDescentIterations | ( | int | val | ) |
Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setPatchSize | ( | int | val | ) |
Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well enough in most cases.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setPatchStride | ( | int | val | ) |
Stride between neighbor patches. Must be less than patch size. Lower values correspond to higher flow quality.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setUseMeanNormalization | ( | bool | val | ) |
Whether to use mean-normalization of patches when computing patch distance. It is turned on by default as it typically provides a noticeable quality boost because of increased robustness to illumination variations. Turn it off if you are certain that your sequence doesn't contain any changes in illumination.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setUseSpatialPropagation | ( | bool | val | ) |
Whether to use spatial propagation of good optical flow vectors. This option is turned on by default, as it tends to work better on average and can sometimes help recover from major errors introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this option off can make the output flow field a bit smoother, however.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementAlpha | ( | float | val | ) |
Weight of the smoothness term.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementDelta | ( | float | val | ) |
Weight of the color constancy term.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementEpsilon | ( | float | val | ) |
Norm value shift for robust penalizer.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementGamma | ( | float | val | ) |
Weight of the gradient constancy term.
void OpenCVForUnity.VideoModule.DISOpticalFlow.setVariationalRefinementIterations | ( | int | val | ) |
Maximum number of gradient descent iterations in the patch inverse search stage. Higher values may improve quality in some cases.
const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_FAST = 1 |
const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_MEDIUM = 2 |
const int OpenCVForUnity.VideoModule.DISOpticalFlow.PRESET_ULTRAFAST = 0 |