加入邻居簇质心Matlab [英] Join neighbour cluster centroids Matlab

查看:114
本文介绍了加入邻居簇质心Matlab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用K-means使用此[X,C] = kmeans(XX, 8]将数据聚类为8个不同的聚类,这意味着我有8个质心,其位置存储在C在X Y Z下显示为列的示例"中.我想将8个质心连接在一起,其中仅彼此靠近的群集的质心彼此之间具有边界",而彼此不靠近的群集的质心未连接.因此,如果有人可以提出建议?

I have used K-means to cluster data into 8 different clusters using this [X,C] = kmeans(XX, 8] , this means I have 8 centroids where their locations is stored in C "example shown below X Y Z as coloumns". I want to connect the 8 centroids together where only the centroids of the clusters that are close to each other are connected "have borders between each other" while centroids of clusters that are not close to each other are not connected. So if anyone could please advise?

    C=
    -0.214560757496055  0.208243029984219   1.27200000000000
    -0.170247238295634  0.399735227073470   1.14600000000000
    -0.0129089952656497 0.410839908819919   1.22700000000000
    -0.244488865509381  0.0526915658425390  1.20200000000000
    -0.391215149921094  0.258634052253200   1.23600000000000
    -0.258542872172541  0.307469752761704   1.18100000000000
    -0.346834999123269  0.413056286165176   1.16100000000000
    -0.0885709275819744 0.278674381904261   1.23200000000000

我已经按照建议使用了,但是某些群集的质心,但是在非相邻群集的质心之间构建了一些不需要的连接,例如群集顶部的质心与底部群集的质心",如图所示.数字,所以如果您可以请指教

I've used the as suggested but the centroids of some clusters but there are some unwanted connections that are constructed between centroids of non-neighbour clusters "e.g the centroid of the cluster top with the centroids of bottom clusters" as shown in the figure, so if you could please advise

X=C(:,1);
Y=C(:,2);
Z=C(:,3);
dt      = DelaunayTri(X,Y,Z); 
tetramesh(dt,'FaceColor', 'none');

推荐答案

就像@Dan所说的那样,您正在寻找Delaunay三角剖分,这是Voronoi细胞的对偶.

Just as @Dan commented, you are looking for the Delaunay Triangulation, which is the dual of the Voronoi cells.

请参阅 https://en.wikipedia.org/wiki/Delaunay_triangulation 了解更多详细信息

See https://en.wikipedia.org/wiki/Delaunay_triangulation for more details.

图片版权信息: https://en.wikipedia.org/wiki/File :Delaunay_Voronoi.png

黑点是群集的中心".黑线是Delaunay三角剖分(可能是您正在寻找的),而红线和点是Voronoi图.实际上,计算Voronoi digaram的通常方法是先执行Deleaunay三角剖分,然后与附近边缘的正交线相交.

Black dots are the cluster "centers". Black lines are the Delaunay Triangulation (which is probably what you are looking for) while the red lines and dots are the Voronoi diagram. The usual way to compute the Voronoi digaram actually is to first perform Deleaunay Triangulation, then intersect the orthogonals of nearby edges.

这篇关于加入邻居簇质心Matlab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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