SparseMat Class OpenCvSharp Class Library
Sparse matrix class.
Inheritance Hierarchy

SystemObject
  OpenCvSharpDisposableObject
    OpenCvSharpDisposableCvObject
      OpenCvSharp.CPlusPlusSparseMat

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

public class SparseMat : DisposableCvObject, ICloneable

The SparseMat type exposes the following members.

Constructors

  NameDescription
Public methodSparseMat
Creates empty SparseMat
Public methodSparseMat(IntPtr)
Creates from native cv::SparseMat* pointer
Public methodSparseMat(CvSparseMat)
converts old-style CvSparseMat to the new matrix; the data is not copied by default
Public methodSparseMat(Mat)
converts old-style CvMat to the new matrix; the data is not copied by default
Public methodSparseMat(IEnumerableInt32, MatType)
constructs n-dimensional sparse matrix
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 propertyCvPtr
Native pointer of OpenCV structure
(Inherited from DisposableCvObject.)
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.)
Top
Methods

  NameDescription
Public methodAddref
manually increments the reference counter to the header.
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 methodAssignFrom(Mat)
Assignment operator. equivalent to the corresponding constructor.
Public methodAssignFrom(SparseMat)
Assignment operator. This is O(1) operation, i.e. no data is copied
Public methodAssignTo
not used now
Public methodChannels
Returns the number of sparse matrix channels.
Public methodClear
sets all the sparse matrix elements to 0, which means clearing the hash table.
Public methodClone
creates full copy of the matrix
Public methodConvertTo(SparseMat, Int32, Double)
multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type
Public methodConvertTo(Mat, Int32, Double, Double)
converts sparse matrix to dense n-dim matrix with optional type conversion and scaling.
Public methodCopyTo(Mat)
converts sparse matrix to dense matrix.
Public methodCopyTo(SparseMat)
copies all the data to the destination matrix. All the previous content of m is erased.
Public methodCreate
Reallocates sparse matrix. If the matrix already had the proper size and type, it is simply cleared with clear(), otherwise, the old matrix is released (using release()) and the new one is allocated.
Public methodDepth
Returns the depth of sparse matrix element.
Public methodDims
Returns the matrix dimensionality
Public methodDispose
Releases the resources
(Inherited from DisposableObject.)
Protected methodDispose(Boolean)
Releases the resources
(Overrides DisposableCvObjectDispose(Boolean).)
Public methodElemSize
returns the size of each element in bytes (not including the overhead - the space occupied by SparseMat::Node elements)
Public methodElemSize1
returns elemSize()/channels()
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Destructor
(Inherited from DisposableObject.)
Public methodFindT(Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, null.
Public methodFindT(Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, null.
Public methodFindT(Int32, Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, null.
Public methodFindT(Int32, Int32, Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, null.
Public methodStatic memberFromCvSparseMat
Public methodStatic memberFromMat
Public methodGetT(Int32, NullableInt64)
Returns a value to the specified array element.
Public methodGetT(Int32, NullableInt64)
Returns a value to the specified array element.
Public methodGetT(Int32, Int32, NullableInt64)
Returns a value to the specified array element.
Public methodGetT(Int32, Int32, Int32, NullableInt64)
Returns a value to the specified array element.
Public methodGetHashCode (Inherited from Object.)
Public methodGetIndexerT
Gets a type-specific indexer. The indexer has getters/setters to access each matrix element.
Public methodGetType (Inherited from Object.)
Public methodHash(Int32)
Computes the element hash value (1D case)
Public methodHash(Int32)
Computes the element hash value (nD case)
Public methodHash(Int32, Int32)
Computes the element hash value (2D case)
Public methodHash(Int32, Int32, Int32)
Computes the element hash value (3D case)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodNotifyMemoryPressure
Notifies the allocated size of memory.
(Inherited from DisposableObject.)
Public methodPtr(Int32, Boolean, NullableInt64)
Low-level element-access function.
Public methodPtr(Int32, Boolean, NullableInt64)
Low-level element-access function.
Public methodPtr(Int32, Int32, Boolean, NullableInt64)
Low-level element-access function.
Public methodPtr(Int32, Int32, Int32, Boolean, NullableInt64)
Low-level element-access function.
Public methodRefT
Gets a type-specific indexer. The indexer has getters/setters to access each matrix element.
Public methodRelease
Releases the resources
Public methodSetT(Int32, T, NullableInt64)
Set a value to the specified array element.
Public methodSetT(Int32, T, NullableInt64)
Set a value to the specified array element.
Public methodSetT(Int32, Int32, T, NullableInt64)
Set a value to the specified array element.
Public methodSetT(Int32, Int32, Int32, T, NullableInt64)
Set a value to the specified array element.
Public methodSize
Returns the array of sizes, or null if the matrix is not allocated
Public methodSize(Int32)
Returns the size of i-th matrix dimension (or 0)
Public methodThrowIfDisposed
If this object is disposed, then ObjectDisposedException is thrown.
(Inherited from DisposableObject.)
Public methodToCvSparseMat
Creates the CvMat header or clone instance for the matrix.
Public methodToString
Returns a string that represents this Mat.
(Overrides ObjectToString.)
Public methodType
Returns the type of sparse matrix element.
Public methodValueT(Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, default(T).
Public methodValueT(Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, default(T).
Public methodValueT(Int32, Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, default(T).
Public methodValueT(Int32, Int32, Int32, NullableInt64)
Return pthe specified sparse matrix element if it exists; otherwise, default(T).
Top
Operators

  NameDescription
Public operatorStatic member(SparseMat to CvSparseMat)
Creates the CvMat clone instance for the matrix.
Top
Fields

  NameDescription
Protected fielddataHandle
Gets or sets a handle which allocates using cvSetData.
(Inherited from DisposableObject.)
Protected fieldptr
Data pointer
(Inherited from DisposableCvObject.)
Public fieldStatic memberSizeOf
sizeof(cv::Mat)
Top
See Also

Reference