@Namespace(value="cv::cuda") @Properties(inherit=opencv_cudaoptflow.class) public class NvidiaHWOpticalFlow extends Algorithm
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
NvidiaHWOpticalFlow(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calc(GpuMat inputImage,
GpuMat referenceImage,
GpuMat flow) |
void |
calc(GpuMat inputImage,
GpuMat referenceImage,
GpuMat flow,
Stream stream,
GpuMat hint,
GpuMat cost) |
void |
calc(Mat inputImage,
Mat referenceImage,
Mat flow) |
void |
calc(Mat inputImage,
Mat referenceImage,
Mat flow,
Stream stream,
Mat hint,
Mat cost)
\brief Calculates Optical Flow using NVIDIA Optical Flow SDK.
|
void |
calc(UMat inputImage,
UMat referenceImage,
UMat flow) |
void |
calc(UMat inputImage,
UMat referenceImage,
UMat flow,
Stream stream,
UMat hint,
UMat cost) |
void |
collectGarbage()
\brief Releases all buffers, contexts and device pointers.
|
int |
getGridSize()
\brief Returns grid size of output buffer as per the hardware's capability.
|
clear, empty, getDefaultName, position, read, save, save, write, write, writeaddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic NvidiaHWOpticalFlow(Pointer p)
Pointer.Pointer(Pointer).public void calc(@ByVal Mat inputImage, @ByVal Mat referenceImage, @ByVal Mat flow, @ByRef(nullValue="cv::cuda::Stream::Null()") Stream stream, @ByVal(nullValue="cv::InputArray(cv::noArray())") Mat hint, @ByVal(nullValue="cv::OutputArray(cv::noArray())") Mat cost)
NVIDIA GPUs starting with Turing contain a dedicated hardware accelerator for computing optical flow vectors between pairs of images. The optical flow hardware accelerator generates block-based optical flow vectors. The size of the block depends on hardware in use, and can be queried using the function getGridSize(). The block-based flow vectors generated by the hardware can be converted to dense representation (i.e. per-pixel flow vectors) using upSampler() helper function, if needed. The flow vectors are stored in CV_16SC2 format with x and y components of each flow vector in 16-bit signed fixed point representation S10.5.
inputImage - Input image.referenceImage - Reference image of the same size and the same type as input image.flow - A buffer consisting of inputImage.Size() / getGridSize() flow vectors in CV_16SC2 format.stream - Stream for the asynchronous version.hint - Hint buffer if client provides external hints. Must have same size as flow buffer.
Caller can provide flow vectors as hints for optical flow calculation.cost - Cost buffer contains numbers indicating the confidence associated with each of the generated flow vectors.
Higher the cost, lower the confidence. Cost buffer is of type CV_32SC1.
\note - Client must use critical sections around each calc() function if calling it from multiple threads.
public void calc(@ByVal UMat inputImage, @ByVal UMat referenceImage, @ByVal UMat flow, @ByRef(nullValue="cv::cuda::Stream::Null()") Stream stream, @ByVal(nullValue="cv::InputArray(cv::noArray())") UMat hint, @ByVal(nullValue="cv::OutputArray(cv::noArray())") UMat cost)
public void calc(@ByVal GpuMat inputImage, @ByVal GpuMat referenceImage, @ByVal GpuMat flow, @ByRef(nullValue="cv::cuda::Stream::Null()") Stream stream, @ByVal(nullValue="cv::InputArray(cv::noArray())") GpuMat hint, @ByVal(nullValue="cv::OutputArray(cv::noArray())") GpuMat cost)
public void collectGarbage()
public int getGridSize()
Copyright © 2020. All rights reserved.