ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
EFFECT OF VARYING
NUMBER OF SAMPLES ON
IMAGE QUALITY
LAKSHMI.M
M.E, COMMUNICATION SYSTEMS
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.
SAMPLING
UPSAMPLING
- INCREASING THE NUMBER OF SAMPLES
DOWNSAMPLING
- DECREASING THE NUMBER OF SAMPLES
Upsampling and Downsampling of a
discrete signal
Effects of varying number of samples in an image
CODE FOR DOWNSAMPLING:
clc;
clear all;
close all;
f=imread('cameraman.tif');
y=imresize(f,[1024 1024]);
figure; imshow(y);
down=y(1:2:end,1:2:end);
figure; imshow(down);
down1=y(1:4:end,1:4:end);
figure; imshow(down1);
down2=y(1:8:end,1:8:end);
figure; imshow(down2);
down3=y(1:16:end,1:16:end);
figure; imshow(down3);
down4=y(1:16:end,1:16:end);
figure; imshow(down4);
Fig1.
1024*1024
Fig2.
512*512
Fig3.
256*256
Fig4.
128*128
Fig5.
64*64
Fig6.
32*32
DOWNSAMPLED IMAGES
EFFECT OF VARYING NUMBER OF SAMPLES
256*256 256*256
Downsampled by
a factor of 3
Upsampled by a
factor of 3
clc;
clear all;
close all;
f=imread('cameraman.tif');
y=imresize(f,[8 8]);
figure; imshow(y);
disp(y);
display('size of original image:');
l1=size(y);
disp(l1);
%downsampling
down=y(1:2:end,1:2:end);
disp(down);
display('size of downsampled image:');
l2=size(down);
disp(l2);
figure; imshow(down);
Upsampling the downsampled image
% upsampling the downsampled image
up=down(1:0.4:end,1:0.4:end);
disp(up);
display('size of upsampled image:');
l3=size(up);
disp(l3);
figure; imshow(up);
Pixel values of original image
EFFECT OF VARYING NUMBER OF SAMPLES
256*256 256*256
Upsampled by a
factor of 3
Downsampled by
a factor of 3
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);
Effects of varying number of samples in an image
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.
THANK YOU

More Related Content

Effects of varying number of samples in an image

  • 1. EFFECT OF VARYING NUMBER OF SAMPLES ON IMAGE QUALITY LAKSHMI.M M.E, COMMUNICATION SYSTEMS
  • 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.
  • 3. SAMPLING UPSAMPLING - INCREASING THE NUMBER OF SAMPLES DOWNSAMPLING - DECREASING THE NUMBER OF SAMPLES
  • 4. Upsampling and Downsampling of a discrete signal
  • 6. CODE FOR DOWNSAMPLING: clc; clear all; close all; f=imread('cameraman.tif'); y=imresize(f,[1024 1024]); figure; imshow(y); down=y(1:2:end,1:2:end); figure; imshow(down); down1=y(1:4:end,1:4:end); figure; imshow(down1); down2=y(1:8:end,1:8:end); figure; imshow(down2); down3=y(1:16:end,1:16:end); figure; imshow(down3); down4=y(1:16:end,1:16:end); figure; imshow(down4);
  • 8. EFFECT OF VARYING NUMBER OF SAMPLES 256*256 256*256 Downsampled by a factor of 3 Upsampled by a factor of 3
  • 9. clc; clear all; close all; f=imread('cameraman.tif'); y=imresize(f,[8 8]); figure; imshow(y); disp(y); display('size of original image:'); l1=size(y); disp(l1); %downsampling down=y(1:2:end,1:2:end); disp(down); display('size of downsampled image:'); l2=size(down); disp(l2); figure; imshow(down); Upsampling the downsampled image % upsampling the downsampled image up=down(1:0.4:end,1:0.4:end); disp(up); display('size of upsampled image:'); l3=size(up); disp(l3); figure; imshow(up);
  • 10. Pixel values of original 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.