The document discusses the effect of varying the number of samples on image quality through upsampling and downsampling. It shows how downsampling an image by omitting pixel values reduces the image resolution and quality. In contrast, upsampling does not remove pixel values but instead interpolates new values, so downsampling the upsampled image back to the original size nearly recovers the original quality. The key factors are that downsampling removes information while upsampling preserves information through interpolation.
2. SAMPLING
Sampling is the first operation done in digitalization of
an analog signal followed by quantization
Sampling - principal factor determining the spatial
resolution of an image.
Spatial resolution is the smallest discernible detail in an
image.
11. EFFECT OF VARYING NUMBER OF SAMPLES
256*256 256*256
Upsampled by a
factor of 3
Downsampled by
a factor of 3
12. f=imread('cameraman.tif');
y=imresize(f,[4 4]);
display('pixel values of original image');
figure; imshow(y);
title('original image');
disp(y);
display('size of original image:');
l1=size(y);
disp(l1);
%upsampling
up=y(1:0.4:end,1:0.4:end);
display('pixel values of downsampled
image');
disp(up);
display('size of upsampled image:');
l2=size(up);
disp(l2);
figure; imshow(up);
title('upsampled image');
Downsampling the upsampled image
%downsampling the upsampled image
down=up(1:2:end,1:2:end);
display('pixel values of reconstructed
image');
disp(down);
display('size of reconstructed image:');
l2=size(down);
disp(l2);
figure; imshow(down);
14. Inference:
Downsampling provides reduced pixel value
image which when zoomed, results in poor
image quality
In upsampling, no pixel value is removed
and hence when downsampled to its original
image size, almost the original image quality
is obtained.