基于matlab两个图像输入模糊C+-均值图像分割源码

Posted fpga&matlab

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了基于matlab两个图像输入模糊C+-均值图像分割源码相关的知识,希望对你有一定的参考价值。

% This Matlab script illustrate how to use two images as input for FCM segmentation

clc
clear all


%Load GADO image
info = imfinfo('GADOimage.jpg');
I = im2double(imread('GADOimage','jpg'));
I = imadjust(I);


%Load AXIAL FLAIR image
info2 = imfinfo('FLAIRimage.jpg');
I2 = im2double(imread('FLAIRimage','jpg'));
I2 = imadjust(I);

figure;imshow(I,[]);impixelinfo; % Show Image I
  
data = [I(:) I2(:)]; % data array


[center,U,obj_fcn] = fcm(data,7); % Fuzzy C-means classification with 7 classes
         
% Finding the pixels for each class
maxU = max(U);
index1 = find(U(1,:) == maxU);
index2 = find(U(2,:) == maxU);
index3 = find(U(3,:) == maxU);
index4 = find(U(4,:) == maxU);
index5 = find(U(5,:) == maxU);
index6 = find(U(6,:) == maxU);
index7 = find(U(7,:) == maxU);
 
% Assigning pixel to each class by giving them a specific value
fcmImage(1:length(data))=0;       
fcmImage(index1)= 1;
fcmImage(index2)= 0.8;
fcmImage(index3)= 0.6;
fcmImage(index4)= 0.4;
fcmImage(index5)= 0.2;
fcmImage(index6)= 0.1;
fcmImage(index7)= 0.0;

% Reshapeing the array to a image
imagNew = reshape(fcmImage,512,512);
figure;imshow(imagNew,[]);impixelinfo;

B15

 

以上是关于基于matlab两个图像输入模糊C+-均值图像分割源码的主要内容,如果未能解决你的问题,请参考以下文章

图像分割基于局部信息的模糊C均值聚类算法(FLICM)实现图像分割matlab源码

图像分割基于FCM和改进的模糊聚类FCM实现脑部CT图像分割matlab源码

matlab基于局部信息的模糊C均值聚类算法(FLICM)实现图像分割

matlab基于局部信息的模糊C均值聚类算法(FLICM)实现图像分割

如何应用 Matlab 模糊 C 均值 (fcm) 输出进行图像分割

图像分割基于空间信息的模糊均值聚类算法实现图像分割matlab源码