⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.m

📁 Fusion algorithm example to split a picture into different areas depending on their average color
💻 M
字号:
clc
clear
close all

img3 = double(imread('BE03I03.jpg'));
imshow(img3/255,'InitialMagnification',100);
figure;

taille = size(img3);

labels = zeros(taille(1),taille(2));

labels(1:16,1:16) =1;

zoneHomogene(img3,labels,1,55)

[labels labelMax] = partoche(img3,75,1);

labelMax

image(mod(labels,256));
colormap(colorcube(256));
figure;

matAdj = adjascence(labels);

fusionne = fusion(img3,labels,40);

image(mod(fusionne,256));
colormap(colorcube(256));
figure;


imgR = img3(:,:,1);
imgV = img3(:,:,2);
imgB = img3(:,:,3);

for i=1:size(matAdj,1)
    valR =round(mean(imgR(fusionne == i)));
    valV =round(mean(imgV(fusionne == i)));
    valB =round(mean(imgB(fusionne == i)));
    labelColorR(fusionne == i) = valR;
    labelColorV(fusionne == i) = valV;
    labelColorB(fusionne == i) = valB;
end

taille = size(img3);
labelColor(:,:,1) = reshape(labelColorR,taille(1),[]);
labelColor(:,:,2) = reshape(labelColorV,taille(1),[]);
labelColor(:,:,3) = reshape(labelColorB,taille(1),[]);

imshow(labelColor/255,'InitialMagnification',100);



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -