Sunteți pe pagina 1din 4

%carga de la imagen

a=imread('paganizondacinque.jpg');
imshow(a)

%extraccion de planos
ar=a(:,:,1);
ag=a(:,:,2);
ab=a(:,:,3);

%despliegue
figure(1),subplot(2,3,2),imshow(a), title('Imagen Originial')
figure(1),subplot(2,3,4),imshow(ar), title('Plano Rojo')
figure(1),subplot(2,3,5),imshow(ag), title('Imagen Verde')
figure(1),subplot(2,3,6),imshow(ab), title('Imagen Azul')

Imagen Originial

Plano Rojo Imagen Verde Imagen Azul


%Imagen plano de bit del plano Rojo
arb7=bitand(ar,128)*2;
arb6=bitand(ar,64)*2;
arb5=bitand(ar,32)*2;
arb4=bitand(ar,16)*2;
arb3=bitand(ar,8)*2;
arb2=bitand(ar,4)*2;
arb1=bitand(ar,2)*2;
arb0=bitand(ar,1)*2;
figure(2)
subplot(3,3,1),imshow(ar)
subplot(3,3,2),imshow(arb7)
subplot(3,3,3),imshow(arb6)
subplot(3,3,4),imshow(arb5)
subplot(3,3,5),imshow(arb4)
subplot(3,3,6),imshow(arb3)
subplot(3,3,7),imshow(arb2)
subplot(3,3,8),imshow(arb1)
subplot(3,3,9),imshow(arb0)
%Imagen plano de bit del plano Verde
agb7=bitand(ag,128)*2;
agb6=bitand(ag,64)*2;
agb5=bitand(ag,32)*2;
agb4=bitand(ag,16)*2;
agb3=bitand(ag,8)*2;
agb2=bitand(ag,4)*2;
agb1=bitand(ag,2)*2;
agb0=bitand(ag,1)*2;
figure(3)
subplot(3,3,1),imshow(ag)
subplot(3,3,2),imshow(agb7)
subplot(3,3,3),imshow(agb6)
subplot(3,3,4),imshow(agb5)
subplot(3,3,5),imshow(agb4)
subplot(3,3,6),imshow(agb3)
subplot(3,3,7),imshow(agb2)
subplot(3,3,8),imshow(agb1)
subplot(3,3,9),imshow(agb0)
%Imagen plano de bit del plano Azul
abb7=bitand(ab,128)*2;
abb6=bitand(ab,64)*2;
abb5=bitand(ab,32)*2;
abb4=bitand(ab,16)*2;
abb3=bitand(ab,8)*2;
abb2=bitand(ab,4)*2;
abb1=bitand(ab,2)*2;
abb0=bitand(ab,1)*2;
figure(4)
subplot(3,3,1),imshow(ab)
subplot(3,3,2),imshow(abb7)
subplot(3,3,3),imshow(abb6)
subplot(3,3,4),imshow(abb5)
subplot(3,3,5),imshow(abb4)
subplot(3,3,6),imshow(abb3)
subplot(3,3,7),imshow(abb2)
subplot(3,3,8),imshow(abb1)
subplot(3,3,9),imshow(abb0)

S-ar putea să vă placă și