:param size: 2D array size: ``Size(cols, rows)`` . In the ``Size()`` constructor, the number of rows and the number of columns go in the reverse order.
:param sizes: Array of integers specifying an n-dimensional array shape.
:param samples: Floating-point matrix of input samples, one row per sample.
...
...
@@ -25,6 +25,8 @@ Finds centers of clusters and groups input samples around the clusters.
:param attempts: Flag to specify the number of times the algorithm is executed using different initial labelings. The algorithm returns the labels that yield the best compactness (see the last function parameter).
:param rng: CvRNG state initialized by RNG().
:param flags: Flag that can take the following values:
* **KMEANS_RANDOM_CENTERS** Select random initial centers in each attempt.
...
...
@@ -35,6 +37,8 @@ Finds centers of clusters and groups input samples around the clusters.
:param centers: Output matrix of the cluster centers, one row per each cluster center.
:param compactness: The returned value that is described below.
The function ``kmeans`` implements a k-means algorithm that finds the
centers of ``clusterCount`` clusters and groups the input samples
.. ocv:cfunction:: int cvSliceLength( CvSlice slice, const CvSeq* seq )
Calculates the sequence slice length
:param slice: The slice of sequence.
:param seq: Source sequence.
Calculates the sequence slice length.
Some of functions that operate on sequences take a ``CvSlice slice`` parameter that is often set to the whole sequence (CV_WHOLE_SEQ) by default. Either of the ``start_index`` and ``end_index`` may be negative or exceed the sequence length. If they are equal, the slice is considered empty (i.e., contains no elements). Because sequences are treated as circular structures, the slice may select a
few elements in the end of a sequence followed by a few elements at the beginning of the sequence. For example, ``cvSlice(-2, 3)`` in the case of a 10-element sequence will select a 5-element slice, containing the pre-last (8th), last (9th), the very first (0th), second (1th) and third (2nd)