OpenCV K均值(kmeans2) [英] OpenCV K-Means (kmeans2)

查看:84
本文介绍了OpenCV K均值(kmeans2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Opencv的K-means实现对一大组8维向量进行聚类.它们可以很好地聚类,但是我找不到任何方法来查看由聚类过程创建的原型.这有可能吗? OpenCV似乎只允许访问群集索引(或标签).

I'm using Opencv's K-means implementation to cluster a large set of 8-dimensional vectors. They cluster fine, but I can't find any way to see the prototypes created by the clustering process. Is this even possible? OpenCV only seems to give access to the cluster indexes (or labels).

如果没有,我想是时候做我自己的实现了!

If not I guess it'll be time to make my own implementation!

推荐答案

我不能说我使用了OpenCV的Kmeans实现,但是如果您可以访问分配给每个实例的标签,则可以通过计算得出质心实例的平均向量属于每个聚类.

I can't say I used OpenCV's implementation of Kmeans, but if you have access to the labels given to each instance, you can simply get the centroids by calculating the average vector of instances belong to each of the clusters.

这篇关于OpenCV K均值(kmeans2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆