Class cv::SparseMatConstIterator#
Read-Only Sparse Matrix Iterator. View details
#include <opencv2/core/mat.hpp>Collaboration diagram for cv::SparseMatConstIterator:
Detailed Description#
Read-Only Sparse Matrix Iterator.
Here is how to use the iterator to compute the sum of floating-point sparse matrix elements:
SparseMatConstIterator it = m.begin(), it_end = m.end();
double s = 0;
CV_Assert( m.type() == CV_32F );
for( ; it != it_end; ++it )
s += it.value<float>();
Constructor & Destructor Documentation#
SparseMatConstIterator()#
cv::SparseMatConstIterator::SparseMatConstIterator()
the default constructor
SparseMatConstIterator()#
cv::SparseMatConstIterator::SparseMatConstIterator(const SparseMat * _m)
the full constructor setting the iterator to the first sparse matrix element
SparseMatConstIterator()#
cv::SparseMatConstIterator::SparseMatConstIterator(const SparseMatConstIterator & it)
the copy constructor
Member Function Documentation#
node()#
const SparseMat::Node * cv::SparseMatConstIterator::node()
returns the current node of the sparse matrix. it.node->idx is the current element index
operator++()#
SparseMatConstIterator & cv::SparseMatConstIterator::operator++()
moves iterator to the next element
operator++()#
SparseMatConstIterator cv::SparseMatConstIterator::operator++(int)
moves iterator to the next element
operator–()#
SparseMatConstIterator & cv::SparseMatConstIterator::operator–()
moves iterator to the previous element
operator–()#
SparseMatConstIterator cv::SparseMatConstIterator::operator–(int)
moves iterator to the previous element
operator=()#
SparseMatConstIterator & cv::SparseMatConstIterator::operator=(const SparseMatConstIterator & it)
the assignment operator
seekEnd()#
void cv::SparseMatConstIterator::seekEnd()
moves iterator to the element after the last element
value()#
template<typename _Tp>
const _Tp & cv::SparseMatConstIterator::value()
template method returning the current matrix element
Member Data Documentation#
hashidx#
size_t cv::SparseMatConstIterator::hashidx
m#
const SparseMat * cv::SparseMatConstIterator::m
ptr#
uchar * cv::SparseMatConstIterator::ptr
Source file#
The documentation for this class was generated from the following file:
opencv2/core/mat.hpp