Class cv::SparseMat_#
Template sparse n-dimensional array class derived from SparseMat. View details
#include <opencv2/core/mat.hpp>Collaboration diagram for cv::SparseMat_:
Public Types#
Public Types inherited from cv::SparseMat
Return |
Name |
Description |
|---|---|---|
Public Member Functions#
Public Member Functions inherited from cv::SparseMat
Return |
Name |
Description |
|---|---|---|
Various SparseMat constructors. |
||
the destructor |
||
|
manually increments the reference counter to the header. |
|
|
||
|
returns the number of channels |
|
|
sets all the sparse matrix elements to 0, which means clearing the hash table. |
|
|
creates full copy of the matrix |
|
|
|
converts sparse matrix to dense n-dim matrix with optional type conversion and scaling. |
|
multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type |
|
|
converts sparse matrix to dense matrix. |
|
|
copies all the data to the destination matrix. All the previous content of m is erased |
|
|
reallocates sparse matrix. |
|
|
returns the depth of sparse matrix elements |
|
|
returns the matrix dimensionality |
|
|
converts sparse matrix to the old-style representation; all the elements are copied. |
|
|
returns elemSize()/channels() |
|
returns the sparse matrix iterator at the matrix end |
||
|
returns the typed sparse matrix iterator at the matrix end |
|
returns the read-only sparse matrix iterator at the matrix end |
||
|
returns the typed read-only sparse matrix iterator at the matrix end |
|
|
erases the specified element (nD case) |
|
|
erases the specified element (3D case) |
|
|
erases the specified element (2D case) |
|
|
computes the element hash value (nD case) |
|
|
computes the element hash value (1D case) |
|
|
computes the element hash value (2D case) |
|
|
computes the element hash value (3D case) |
|
|
||
|
||
|
||
|
returns the number of non-zero elements (=the number of hash table nodes) |
|
equivalent to the corresponding constructor |
||
assignment operator. This is O(1) operation, i.e. no data is copied |
||
|
||
|
||
|
||
|
returns the array of sizes, or NULL if the matrix is not allocated |
|
|
returns the size of i-th matrix dimension (or 0) |
|
|
returns type of sparse matrix elements |
|
|
returns the value stored in the sparse martix node |
|
|
returns the value stored in the sparse martix node |
Public Attributes#
Public Attributes inherited from cv::SparseMat
Detailed Description#
Template sparse n-dimensional array class derived from SparseMat.
SparseMat_ is a thin wrapper on top of SparseMat created in the same way as Mat_ . It simplifies notation of some operations:
int sz[] = {10, 20, 30};
SparseMat_<double> M(3, sz);
...
M.ref(1, 2, 3) = M(4, 5, 6) + M(7, 8, 9);
Member Typedef Documentation#
const_iterator#
typedef SparseMatConstIterator_< Tp > cv::SparseMat::const_iterator
iterator#
typedef SparseMatIterator_< Tp > cv::SparseMat::iterator
Constructor & Destructor Documentation#
SparseMat_()#
the default constructor
SparseMat_()#
cv::SparseMat_::SparseMat_(const Mat & m)
converts dense matrix to the sparse form
SparseMat_()#
cv::SparseMat_::SparseMat_(const SparseMat & m)
the copy constructor. If DataType<_Tp>.type != m.type(), the m elements are converted
SparseMat_()#
cv::SparseMat_::SparseMat_(const SparseMat_ & m)
the copy constructor. This is O(1) operation - no data is copied
SparseMat_()#
cv::SparseMat_::SparseMat_(
int dims,
const int * _sizes )
the full constructor equivalent to SparseMat(dims, _sizes, DataType<_Tp>::type)
Member Function Documentation#
begin()#
SparseMatIterator_< Tp > cv::SparseMat::begin()
returns sparse matrix iterator pointing to the first sparse matrix element
begin()#
SparseMatConstIterator_< Tp > cv::SparseMat::begin()
returns read-only sparse matrix iterator pointing to the first sparse matrix element
channels()#
int cv::SparseMat_::channels()
returns the number of channels in each matrix element
clone()#
CV_NODISCARD_STD SparseMat_ cv::SparseMat_::clone()
makes full copy of the matrix. All the elements are duplicated
create()#
void cv::SparseMat_::create(
int dims,
const int * _sizes )
equivalent to cv::SparseMat::create(dims, _sizes, DataType<_Tp>::type)
depth()#
int cv::SparseMat_::depth()
returns depth of the matrix elements
end()#
SparseMatIterator_< Tp > cv::SparseMat::end()
returns sparse matrix iterator pointing to the element following the last sparse matrix element
end()#
SparseMatConstIterator_< Tp > cv::SparseMat::end()
returns read-only sparse matrix iterator pointing to the element following the last sparse matrix element
operator()()#
Tp cv::SparseMat::operator()(
const int * idx,
size_t * hashval = 0 )
equivalent to SparseMat::value<_Tp>(idx, hashval)
operator()()#
Tp cv::SparseMat::operator()(
int i0,
int i1,
int i2,
size_t * hashval = 0 )
equivalent to SparseMat::value<_Tp>(i0, i1, i2, hashval)
operator()()#
Tp cv::SparseMat::operator()(
int i0,
int i1,
size_t * hashval = 0 )
equivalent to SparseMat::value<_Tp>(i0, i1, hashval)
operator()()#
Tp cv::SparseMat::operator()(
int i0,
size_t * hashval = 0 )
equivalent to SparseMat::value<_Tp>(i0, hashval)
operator=()#
SparseMat_ & cv::SparseMat_::operator=(const Mat & m)
converts dense matrix to the sparse form
operator=()#
SparseMat_ & cv::SparseMat_::operator=(const SparseMat & m)
converts the old-style sparse matrix to the C++ class. All the elements are copied
the assignment operator. If DataType<_Tp>.type != m.type(), the m elements are converted
operator=()#
SparseMat_ & cv::SparseMat_::operator=(const SparseMat_ & m)
the assignment operator. This is O(1) operation - no data is copied
ref()#
Tp & cv::SparseMat::ref(
const int * idx,
size_t * hashval = 0 )
equivalent to SparseMat::ref<_Tp>(idx, hashval)
ref()#
Tp & cv::SparseMat::ref(
int i0,
int i1,
int i2,
size_t * hashval = 0 )
equivalent to SparseMat::ref<_Tp>(i0, i1, i2, hashval)
ref()#
Tp & cv::SparseMat::ref(
int i0,
int i1,
size_t * hashval = 0 )
equivalent to SparseMat::ref<_Tp>(i0, i1, hashval)
ref()#
Tp & cv::SparseMat::ref(
int i0,
size_t * hashval = 0 )
equivalent to SparseMat::ref<_Tp>(i0, hashval)
type()#
int cv::SparseMat_::type()
converts sparse matrix to the old-style CvSparseMat. All the elements are copied
returns type of the matrix elements
Source file#
The documentation for this class was generated from the following file:
opencv2/core/mat.hpp