1
我刚开始尝试MATLAB项目。我曾经分开红色,绿色和蓝色的颜色。 这是我的函数:使用MATLAB分离图像颜色
function x = colorsep(b) %
n = 256; % color is from 0->255, so it has 256
a = imread('peppers.png');
b=im2uint8(a);
x=figure; % create picture to put the image
subplot(2,2,1); %(2 rows, 2column, cell ti 1)
imshow(b),title('Full Color');
colorlist = {'Red','Green','Blue'};
gr = 0:1/(n-1):1;
for k=1:3
cMap = zeros(n,3);
cMap(:,k) = gr;
subplot(2,2,k+1);
imshow(ind2rgb(b(:,:,k),cMap)); %ind2r = index to rgb
title(colorlist{k});
end
end
现在我要分开三种颜色(粉红色,黄色,橙色),我该怎么办?任何人都知道这个?非常感谢。
感谢您的投票,没有任何推荐。 – Nothing 2011-12-23 08:37:12
什么,确切地说,你的意思是“分开”三种颜色? – Predictor 2011-12-23 14:41:59