February 2020
Intermediate to advanced
372 pages
9h 26m
English
k-means clustering is a method of quantization whereby we analyze a large number of vectors in order to find a small number of clusters. Given a dataset, k represents the number of clusters into which the dataset is going to be divided. The term means refers to the mathematical concept of the mean or the average; when visually represented, the mean of a cluster is its centroid or the geometric center of points in the cluster.
OpenCV provides a class called cv2.BOWKMeansTrainer, which we will use to help train our classifier. As you might expect, the OpenCV documentation gives the following summary of this class: