Table of Contents

Class NvidiaOpticalFlow_2_0

Namespace
Emgu.CV.Cuda
Assembly
Emgu.CV.dll

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 Size

Size of input image in pixels.

perfPreset NvidiaOpticalFlow_2_0.PerfLevel

Optional parameter. Refer https://developer.nvidia.com/opticalflow-sdk for details about presets. Defaults to Slow.

outputGridSize NvidiaOpticalFlow_2_0.OutputVectorGridSize

Optional parameter. Refer https://developer.nvidia.com/opticalflow-sdk for details about presets.

hintGridSize NvidiaOpticalFlow_2_0.HintVectorGridSize

Optional parameter. Refer https://developer.nvidia.com/opticalflow-sdk for details about presets.

enableTemporalHints bool

Optional Parameter. Flag to enable passing external hints buffer to calc(). Defaults to false.

enableExternalHints bool

Optional Parameter. Flag to enable passing external hints buffer to calc(). Defaults to false.

enableCostBuffer bool

Optional Parameter. Flag to enable cost buffer output from calc(). Defaults to false.

gpuId int

Optional parameter to select the GPU ID on which the optical flow should be computed. Useful in multi-GPU systems. Defaults to 0.

inputStream Stream

Optical 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 Stream

Optical 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

nint

NvidiaOpticalFlowPtr

Pointer to the NvidiaOpticalFlow object

public nint NvidiaOpticalFlowPtr { get; }

Property Value

nint

Methods

ConvertToFloat(IInputArray, IInputOutputArray)

Converts the hardware-generated flow vectors to floating point representation

public void ConvertToFloat(IInputArray flow, IInputOutputArray floatFlow)

Parameters

flow IInputArray

Buffer of type CV_16FC2 containing flow vectors generated by Calc().

floatFlow IInputOutputArray

Buffer 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()