I just start to try MATLAB Project. I used to separate the Red, Green and Blue colors. This is my function:
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
Now I want to separate three color ( Pink, Yellow, Orange), what will I do? Anyone know about this? Thanks so much.