Class NvidiaOpticalFlow_2_0
Class for computing the optical flow vectors between two images using NVIDIA Optical Flow hardware and Optical Flow SDK 2.0.
public class NvidiaOpticalFlow_2_0 : SharedPtrObject, IDisposable, INvidiaOpticalFlow, IAlgorithm
- Inheritance
-
NvidiaOpticalFlow_2_0
- Implements
- Inherited Members
- Extension Methods
Constructors
NvidiaOpticalFlow_2_0(Size, PerfLevel, OutputVectorGridSize, HintVectorGridSize, bool, bool, bool, int, Stream, Stream)
Class for computing the optical flow vectors between two images using NVIDIA Optical Flow hardware and Optical Flow SDK 2.0.
public NvidiaOpticalFlow_2_0(Size imageSize, NvidiaOpticalFlow_2_0.PerfLevel perfPreset = PerfLevel.Slow, NvidiaOpticalFlow_2_0.OutputVectorGridSize outputGridSize = OutputVectorGridSize.Size1, NvidiaOpticalFlow_2_0.HintVectorGridSize hintGridSize = HintVectorGridSize.Size1, bool enableTemporalHints = false, bool enableExternalHints = false, bool enableCostBuffer = false, int gpuId = 0, Stream inputStream = null, Stream outputStream = null)
Parameters
imageSize
SizeSize of input image in pixels.
perfPreset
NvidiaOpticalFlow_2_0.PerfLevelOptional parameter. Refer https://developer.nvidia.com/opticalflow-sdk for details about presets. Defaults to Slow.
outputGridSize
NvidiaOpticalFlow_2_0.OutputVectorGridSizeOptional parameter. Refer https://developer.nvidia.com/opticalflow-sdk for details about presets.
hintGridSize
NvidiaOpticalFlow_2_0.HintVectorGridSizeOptional parameter. Refer https://developer.nvidia.com/opticalflow-sdk for details about presets.
enableTemporalHints
boolOptional Parameter. Flag to enable passing external hints buffer to calc(). Defaults to false.
enableExternalHints
boolOptional Parameter. Flag to enable passing external hints buffer to calc(). Defaults to false.
enableCostBuffer
boolOptional Parameter. Flag to enable cost buffer output from calc(). Defaults to false.
gpuId
intOptional parameter to select the GPU ID on which the optical flow should be computed. Useful in multi-GPU systems. Defaults to 0.
inputStream
StreamOptical flow algorithm may optionally involve cuda preprocessing on the input buffers. The input cuda stream can be used to pipeline and synchronize the cuda preprocessing tasks with OF HW engine. If input stream is not set, the execute function will use default stream which is NULL stream
outputStream
StreamOptical flow algorithm may optionally involve cuda post processing on the output flow vectors. The output cuda stream can be used to pipeline and synchronize the cuda post processing tasks with OF HW engine. If output stream is not set, the execute function will use default stream which is NULL stream
Properties
AlgorithmPtr
Pointer to the algorithm object
public nint AlgorithmPtr { get; }
Property Value
NvidiaOpticalFlowPtr
Pointer to the NvidiaOpticalFlow object
public nint NvidiaOpticalFlowPtr { get; }
Property Value
Methods
ConvertToFloat(IInputArray, IInputOutputArray)
Converts the hardware-generated flow vectors to floating point representation
public void ConvertToFloat(IInputArray flow, IInputOutputArray floatFlow)
Parameters
flow
IInputArrayBuffer of type CV_16FC2 containing flow vectors generated by Calc().
floatFlow
IInputOutputArrayBuffer of type CV_32FC2, containing flow vectors in floating point representation, each flow vector for 1 pixel per gridSize, in the pitch-linear layout.
DisposeObject()
Release all the unmanaged memory associated with this optical flow solver.
protected override void DisposeObject()