Matlab Code for Displaying Red, Green and Blue Component of a Color Image
%Simulation Results
%Read Input Image a=imread('flowers.tif'); %Display Input Image subplot(2,2,1); imshow(a); R=a; G=a; B=a; R(:,:,2:3)=0; %RED Component subplot(2,2,2);imshow(R); G(:,:,1)=0; G(:,:,3)=0; %GREEN Component subplot(2,2,3);imshow(G); B(:,:,1)=0; B(:,:,2)=0; %BLUE Component subplot(2,2,4);imshow(B);
Leave a Comment