Translate

miércoles, 29 de febrero de 2012

Problema de subplots en Matlab

Programa Original
clc
fig=imread('leucocito.bmp');
corte=imread('leucocito_1.bmp');
R=1; G=2; B=3;
hist_R=imhist(corte(:,:,1));
hist_G=imhist(corte(:,:,2));
hist_B=imhist(corte(:,:,3));
subplot(2,4,1)
imshow(corte)
title('image corte')
subplot(2,4,2)
plot(hist_R)
title('canal R')
subplot(2,4,3)
plot(hist_G)
title('canal G')
subplot(2,4,4)
plot(hist_B)
title('canal  B')
cortes=imread('leucocito_2.bmp');
R=1; G=2; B=3;
hist_Red=imhist(cortes(:,:,1));
hist_Green=imhist(cortes(:,:,2));
hist_Blue=imhist(cortes(:,:,3));
subplot(1,4,1)
imshow(cortes)
title('image cortes')
subplot(1,4,2)
plot(hist_Red)
title('canal Red')
subplot(1,4,3)
plot(hist_Green)
title('canal Green')
subplot(1,4,4)
plot(hist_Blue)
title('canal  Blue')
Respuesta

clear, clc
fig=imread('leucocito.bmp');
corte=imread('leucocito_1.bmp');
R=1; G=2; B=3;
hist_R=imhist(corte(:,:,R));
hist_G=imhist(corte(:,:,G));
hist_B=imhist(corte(:,:,B));


%primer renglón
subplot(2,4,1)
imshow(corte)
title('image corte')
subplot(2,4,2)
plot(hist_R)
title('canal R')
subplot(2,4,3)
plot(hist_G)
title('canal G')
subplot(2,4,4)
plot(hist_B)
title('canal  B')
% segundo renglon
cortes=imread('leucocito_2.bmp');
hist_Red=imhist(cortes(:,:,R));
hist_Green=imhist(cortes(:,:,G));
hist_Blue=imhist(cortes(:,:,B));
subplot(2,4,5)
imshow(cortes)
title('image cortes')
subplot(2,4,6)
plot(hist_Red)
title('canal Red')
subplot(2,4,7)
plot(hist_Green)
title('canal Green')
subplot(2,4,8)
plot(hist_Blue)
title('canal  Blue')