使用聚类进行图像分割?树形图有帮助吗?

时间:2017-05-06 17:17:10

标签: matlab image-processing image-segmentation hierarchical-clustering

我为图像构建了树形图,我想将其分割

clear all;close all;
maxclust=3
RGB = imread('yellowlily.jpg');
imshow(RGB,'InitialMagnification',50)
RGB=rgb2gray(RGB);
rgb=double(RGB);
T = clusterdata(rgb,'maxclust',3);
X2=zscore(rgb);% standardized data
Y2=pdist(X2);% distance calculation
% % The connection between Step2 making making variable definition
Z2=linkage(Y2);
% % Step3 making clustering information
C2=cophenet(Z2,Y2); 
% % Step4 create cluster, and make a pedigree chart
T=cluster(Z2,6);
H=dendrogram(Z2);

从这个树形图中我得到了两个分支。它是否处理2个对象???

0 个答案:

没有答案
相关问题