-
大小: 2KB文件类型: .rar金币: 2下载: 0 次发布日期: 2021-06-09
- 语言: Matlab
- 标签: FuzzyMeans Cluster matlab
资源简介
基于FuzzyMeansCluster算法的高光谱遥感图像聚类(matlab实现)

代码片段和文件信息
%function [clusters] = Fuzzy_K(patterns_incplot_on)
clear all
clc
%read an image file 92av3c9.lan from Multispec
fid1=fopen(‘c:\image\92av3c9.lan‘‘rb‘);
status=fseek(fid1128‘bof‘);
bandnum=9;
row=145;
column=145;
X1=uint16(fread(fid1[row*bandnum column]‘uint16‘));
fclose(fid1);
% change the multispect picture 92av3c9.lan to 3D
for n=1:bandnum
Y1(1:row1:columnn)=X1(1+(n-1)*row:n*row1:column)‘;
end
%read ground truth from the file ‘92av3gt.gis‘
fid=fopen(‘C:\image\92AV3GT.GIS‘‘rb‘);
status=fseek(fid128‘bof‘);
row=145;
column=145;
X=uint8(fread(fid[column row]‘uint8‘));
fclose(fid);
X=X‘;
X_ESSS=X;
max=0;
for i=1:row
for j=1:column
if max max=X_ESSS(ij);
end
end
end
count=zeros(161);
for i=1:1:16
for j=1:row
for k=1:column
if X_ESSS(jk)==i
count(i)=count(i)+1;
end
end
end
end
count
% define the patterns that needs to be classified
for n=1:bandnum
pattern=Y1(::n);
pattern=pattern‘;
X=X‘;
X111=X;
pattern1=pattern(find(X(::)==2));
pattern2=pattern(find(X(::)==5));
pattern3=pattern(find(X(::)==6));
pattern4=pattern(find(X(::)==8));
pattern5=pattern(find(X(::)==11));
pattern6=pattern(find(X(::)==14));
patterns_in(n:)=[pattern1‘pattern2‘pattern3‘pattern4‘pattern5‘pattern6‘];
end
patterns_in=double(patterns_in);
X=X‘;
% define the matrix for the coordinates of the patterns that are to be classified
[R1C1]=find(X(::)==2);
co1=[R1C1]‘;
[R2C2]=find(X(::)==5);
co2=[R2C2]‘;
[R3C3]=find(X(::)==6);
co3=[R3C3]‘;
[R4C4]=find(X(::)==8);
co4=[R4C4]‘;
[R5C5]=find(X(::)==11);
co5=[R5C5]‘;
[R6C6]=find(X(::)==14);
co6=[R6C6]‘;
coordinates=[co1co2co3co4co5co6];
% fuzzy K-means
%Reduce the number of data points using the fuzzy k-means algorithm
%Inputs:
% patterns_in - Input patterns
% c - Number of output data points
% plot_on - Plot stages of the algorithm
%
%Outputs
% patterns - New patterns
% clusters - New clusters
m = 2;
N = size(patterns_in2);
c = 6;%c--the number of clusters designated
dist = zeros(cN);
Dim = size(patterns_in1);%t = size(Xdim) returns the size of the dimension of X specified by scalar dim.
%Initialize the V‘s
%V--the clustering centroids
V = randn(Dimc);
V = sqrtm(cov(patterns_in‘1))*V + mean(patterns_in‘)‘*ones(1c);
old_V = zeros(Dimc);
%Initialize the U‘s
%U--the membership matrix
for i = 1:c
dist(i:) = sum((patterns_in(::) - V(:i)*ones(1N)).^2);
%the sum of the square of the distance from one pattern to eac clustering centroid
end
%Compute U‘s
U = (1./dist).^(1/(m-1));
U = U ./ (ones(c1) * sum(U));
%If A is a matrix sum(A) treats the columns of A as vectors returning a row vector of the sums of
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4714 2007-06-04 19:25 Fuzzy_K.m
----------- --------- ---------- ----- ----
4714 1
- 上一篇:指纹识别matlab程序
- 下一篇:阵列信号处理的理论和应用 matlab程序
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论