【发布时间】:2011-12-23 07:58:24
【问题描述】:
我刚开始尝试 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
现在我想分离三种颜色(粉色、黄色、橙色),我该怎么办?有人知道吗?非常感谢。
【问题讨论】:
-
感谢您的不赞成投票。
-
你所说的“分离”三种颜色是什么意思?
标签: matlab