GpuMat Class OpenCvSharp Class Library
Smart pointer for GPU memory with reference counting. Its interface is mostly similar with cv::Mat.
Inheritance Hierarchy

SystemObject
  OpenCvSharpDisposableObject
    OpenCvSharpDisposableCvObject
      OpenCvSharp.CPlusPlus.GpuGpuMat

Namespace:  OpenCvSharp.CPlusPlus.Gpu
Assembly:  OpenCvSharp.CPlusPlus (in OpenCvSharp.CPlusPlus.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public class GpuMat : DisposableCvObject, ICloneable

The GpuMat type exposes the following members.

Constructors

  NameDescription
Public methodGpuMat
Creates empty GpuMat
Public methodGpuMat(IntPtr)
Creates from native cv::gpu::GpuMat* pointer
Public methodGpuMat(GpuMat)
creates a matrix for other matrix
Public methodGpuMat(Mat)
creates a matrix for other matrix
Public methodGpuMat(GpuMat, Rect)
creates a matrix header for a part of the bigger matrix
Public methodGpuMat(Size, MatType)
constructs 2D matrix of the specified size and type
Public methodGpuMat(Int32, Int32, MatType)
constructs 2D matrix of the specified size and type
Public methodGpuMat(GpuMat, Range, Range)
creates a matrix header for a part of the bigger matrix
Public methodGpuMat(Size, MatType, Scalar)
constucts 2D matrix and fills it with the specified Scalar value.
Public methodGpuMat(Int32, Int32, MatType, Scalar)
constucts 2D matrix and fills it with the specified Scalar value.
Public methodGpuMat(Size, MatType, IntPtr, Int64)
constructor for matrix headers pointing to user-allocated data
Public methodGpuMat(Int32, Int32, MatType, IntPtr, Int64)
constructor for matrix headers pointing to user-allocated data
Top
Properties

  NameDescription
Protected propertyAllocatedMemory
Gets or sets a memory address allocated by AllocMemory.
(Inherited from DisposableObject.)
Protected propertyAllocatedMemorySize
Gets or sets the byte length of the allocated memory
(Inherited from DisposableObject.)
Public propertyBpp
Public propertyCol
Indexer to access GpuMat column
Public propertyCols
the number of columns
Public propertyCvPtr
Native pointer of OpenCV structure
(Inherited from DisposableCvObject.)
Public propertyData
pointer to the data
Public propertyDataEnd
helper fields used in locateROI and adjustROI
Public propertyDataStart
helper fields used in locateROI and adjustROI
Public propertyFlags
includes several bit-fields: 1.the magic signature 2.continuity flag 3.depth 4.number of channels
Public propertyHeight
the number of rows
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed.
(Inherited from DisposableObject.)
Public propertyIsEnabledDispose
Gets or sets a value indicating whether you permit disposing this instance.
(Inherited from DisposableObject.)
Public propertyItemRect
Public propertyItemRange, Range
Public propertyItemInt32, Int32, Int32, Int32
Extracts a rectangular submatrix.
Public propertyRefCount
pointer to the reference counter; when matrix points to user-allocated data, the pointer is NULL
Public propertyRow
Indexer to access GpuMat row
Public propertyRows
the number of rows
Public propertyWidth
the number of columns
Top
Methods

  NameDescription
Public methodAdjustROI
moves/resizes the current matrix ROI inside the parent matrix.
Protected methodAllocGCHandle
Pins the object to be allocated by cvSetData.
(Inherited from DisposableObject.)
Protected methodAllocMemory
Allocates the specified size of memory.
(Inherited from DisposableObject.)
Public methodAssignTo(GpuMat)
Public methodAssignTo(GpuMat, MatType)
Public methodAtT
Returns a value to the specified array element.
Public methodChannels
Returns the number of matrix channels.
Public methodClone
returns deep copy of the matrix, i.e. the data is copied
Public methodColRange(Range)
returns a new matrix header for the specified column span
Public methodColRange(Int32, Int32)
returns a new matrix header for the specified column span
Public methodConvertTo
converts matrix to another datatype with optional scalng. See cvConvertScale.
Public methodCopyTo(GpuMat)
copies those matrix elements to "m"
Public methodCopyTo(GpuMat, GpuMat)
copies those matrix elements to "m" that are marked with non-zero mask elements.
Public methodCreate(Size, MatType)
allocates new matrix data unless the matrix already has specified size and type. previous data is unreferenced if needed.
Public methodCreate(Int32, Int32, MatType)
allocates new matrix data unless the matrix already has specified size and type. previous data is unreferenced if needed.
Public methodDepth
Returns the depth of a matrix element.
Public methodDispose
Releases the resources
(Inherited from DisposableObject.)
Protected methodDispose(Boolean)
Clean up any resources being used.
(Overrides DisposableCvObjectDispose(Boolean).)
Public methodDownload
Downloads data from device to host memory. Blocking calls.
Public methodElemSize
Returns the matrix element size in bytes.
Public methodElemSize1
Returns the size of each matrix element channel in bytes.
Public methodEmpty
returns true if GpuMatrix data is NULL
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Destructor
(Inherited from DisposableObject.)
Public methodGetT
Returns a value to the specified array element.
Public methodGetGenericIndexerT
Gets a type-specific indexer. The indexer has getters/setters to access each matrix element.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodIsContinuous
returns true iff the GpuMatrix data is continuous (i.e. when there are no gaps between successive rows). similar to CV_IS_GpuMat_CONT(cvGpuMat->type)
Public methodLocateROI
locates matrix header within a parent matrix.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodNotifyMemoryPressure
Notifies the allocated size of memory.
(Inherited from DisposableObject.)
Public methodPtr
returns pointer to y-th row
Public methodRelease
Clean up any resources being used.
Public methodReshape
creates alternative matrix header for the same data, with different number of channels and/or different number of rows. see cvReshape.
Public methodRowRange(Range)
returns a new matrix header for the specified row span
Public methodRowRange(Int32, Int32)
returns a new matrix header for the specified row span
Public methodSetT
Set a value to the specified array element.
Public methodSetTo
sets some of the matrix elements to s, according to the mask
Public methodSize
Returns a matrix size.
Public methodStep
a distance between successive rows in bytes; includes the gap if any
Public methodStep1
Returns a normalized step.
Public methodSwap
swaps with other smart pointer
Public methodThrowIfDisposed
If this object is disposed, then ObjectDisposedException is thrown.
(Inherited from DisposableObject.)
Public methodToString
Returns a string that represents this Mat.
(Overrides ObjectToString.)
Public methodType
Returns the type of a matrix element.
Public methodUpload
Pefroms blocking upload data to GpuMat.
Top
Operators

  NameDescription
Public operatorStatic member(Mat to GpuMat)
converts header to GpuMat
Public operatorStatic member(GpuMat to Mat)
converts header to Mat
Top
Fields

  NameDescription
Protected fielddataHandle
Gets or sets a handle which allocates using cvSetData.
(Inherited from DisposableObject.)
Protected fieldptr
Data pointer
(Inherited from DisposableCvObject.)
Top
See Also

Reference