Effects of varying number of samples in an image

Post on 11-Jun-2015

211 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

What is the effect of varying number of samples in an image. . includes matlab code ..

Transcript

EFFECT OF VARYING NUMBER OF SAMPLES ON

IMAGE QUALITY

LAKSHMI.MM.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

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); %downsamplingdown=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);%upsamplingup=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 imagedown=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);

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

top related