Table of Contents

Method Partition

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Partition<T>(IEnumerable<T>, out int[], PartitionPredicate<T>)

Splits an element set into equivalency classes. Consider using GroupBy of Linq instead.

[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static int Partition<T>(IEnumerable<T> vec, out int[] labels, Cv2.PartitionPredicate<T> predicate)

Parameters

vec IEnumerable<T>

Set of elements stored as a vector.

labels int[]

Output vector of labels. It contains as many elements as vec. Each label labels[i] is a 0-based cluster index of vec[i] .

predicate Cv2.PartitionPredicate<T>

Equivalence predicate (a boolean function of two arguments). The predicate returns true when the elements are certainly in the same class, and returns false if they may or may not be in the same class.

Returns

int

Type Parameters

T