Table of Contents

Method EnumerateNonZero

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

EnumerateNonZero()

Enumerates every stored (non-zero) element together with its index, mirroring cv::SparseMatConstIterator. This visits only the stored elements, not the full dense index space.

public IEnumerable<(int[] Index, T Value)> EnumerateNonZero()

Returns

IEnumerable<(int[] Index, T Value)>

A sequence of (index, value) pairs. Each Index is a fresh array of length Dims(). The enumeration is a snapshot taken when the method is called.