%DIP Class Demo
%Shreekanth Mandayam, Rowan University
%
% Digital Image Sampling

close all; clear
dog=imread('sherlock.jpg');
%Converting to intensity image
dog=mat2gray(rgb2gray(dog));
[M, N] = size(dog);
figure; imshow(dog,'InitialMagnification','fit'); 
title([int2str(M) ' x ' int2str(N)  ' Sherlock image, 256 Graylevels']);

pause;
dog2=imresize(dog,0.5);
[M2, N2] = size(dog2);
figure; imshow(dog2,'InitialMagnification','fit');  
title([int2str(M2) ' x ' int2str(N2)  ' Sherlock image, 256 Graylevels']);

pause;
dog4=imresize(dog,0.25);
[M4, N4] = size(dog4);
figure; imshow(dog4,'InitialMagnification','fit');  
title([int2str(M4) ' x ' int2str(N4)  ' Sherlock image, 256 Graylevels']);

pause;
dog8=imresize(dog,0.125);
[M8, N8] = size(dog8);
figure; imshow(dog8,'InitialMagnification','fit');  
title([int2str(M8) ' x ' int2str(N8)  ' Sherlock image, 256 Graylevels']);

pause;
dog16=imresize(dog,0.0625);
[M16, N16] = size(dog16);
figure; imshow(dog16,'InitialMagnification','fit');  
title([int2str(M16) ' x ' int2str(N16)  ' Sherlock image, 256 Graylevels']);
