0% found this document useful (0 votes)
13 views12 pages

DSP Report1 Merged

This document discusses an image deblurring project that aims to explore the effect of noise on the deblurring process. It introduces image deblurring, describes the algorithm used which involves blurring an image, adding Gaussian noise, and deblurring. It also includes code to implement this and results showing how increased noise variance decreases image clarity after deblurring.

Uploaded by

Shubham Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views12 pages

DSP Report1 Merged

This document discusses an image deblurring project that aims to explore the effect of noise on the deblurring process. It introduces image deblurring, describes the algorithm used which involves blurring an image, adding Gaussian noise, and deblurring. It also includes code to implement this and results showing how increased noise variance decreases image clarity after deblurring.

Uploaded by

Shubham Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Contents

S.No Topics Page

1. Introduc on 1
2. Flowchart 2

3. Input and Output 3


clearnace
4. Algorithm 4
5. Code Descrip on 7
6. Result 9
Introduc on
Image deblurring is a cri cal task in image processing;
aimed at restoring sharpness and clarity to images that
have been degraded by blur. In real-world scenarios,
images o en suffer from not only blur but also noise,
which further complicates the deblurring process.
In this project, we aim to extract original image by
deblurring and explore the effect of noise on the
deblurring process of images. By systema cally
analyzing how different levels of noise impact the
quality of deblurred images, we can gain insights into
the challenges posed by noise in image restora on tasks.
Addi onally, we seek to evaluate the robustness of
deblurring algorithms in noisy environments and
iden fy areas for improvement in exis ng
methodologies.
Flowchart:-
Input and Output:-
 Input :-
Our input is a blurred image

 Output:-
ALGORITHM:-
1.Reads the input image.
2.A disk filter of radius 8 pixels generated.
3.Blurring the Image:-
Convolu on of the grayscale image with the disk
filter to simulate blurring.
4.Adding Noise:
Adds Gaussian white noise to the blurred image at
three different levels of variance.
5.FFT Transforma on:
Performs FFT (Fast Fourier Transform) on the
original and noisy blurred images.
6.Deblurring:
Deconvolves the blurred images with the FFT of
the PSF to a empt to recover the original image.
Detailed Algorithm:-
To recover the original image X from the noisy
image Y and the known filter H(disk filter), we can
use the inverse filtering approach. However,
inverse filtering is sensi ve to noise and can
amplify noise and ar facts in the image,
par cularly if the noise is significant or the filter H
has zeros in its frequency response. It is generally
not recommended unless you have a noise-free
environment or precise knowledge of the filter.
The inverse filtering approach a empts to es mate
the original image X by dividing the noisy image Y
by the filter H in the frequency domain. This is
equivalent to performing deconvolu on.

Inverse filtering is an a empt to reverse the


blurring caused by a known filter H applied to an
image X, given only the blurred image Y.
Mathema cally, it aims to es mate the original
image X by deconvolving the blurred image Y with
the inverse of the filter H.
The process can be summarized as follows:
1.Frequency Domain Representa on: Both the
blurred image Y and the filter H are transformed
into the frequency domain using the Fourier
transform. This is because convolu on in the
spa al domain corresponds to mul plica on in the
frequency domain, simplifying the deconvolu on
process.
2.Inverse Filtering: In the frequency domain, the
inverse filtering opera on is performed by dividing
the Fourier transform of the blurred image by the
Fourier transform of the filter. This is equivalent to
the mathema cal opera on X = Y / H.
3.Inverse Fourier Transform: The resul ng
frequency domain representa on is transformed
back into the spa al domain using the inverse
Fourier transform to obtain the es mated original
image X.
Code Descrip on:-
Programming Language used: MATLAB
Library used: Image Processing Toolbox
Library func ons used:
Rgb2gray(), Imread(), im2double(), conv2(), imshow(),
2(), i 2()
Code:
clc
%image preprocessing
y=rgb2gray(imread('C:\Users\hp\OneDrive\Desktop\calendar.jpeg'));
y=im2double(y);

%take disk psf


PSF=fspecial('disk',8);

%convolve image with psf


yblur=conv2(y,PSF);

%plot original image


figure();
subplot(2,1,1); imshow(y); title('actual image');

%plot unnoisy blurred image


subplot(2,1,2); imshow(yblur); title('blurred image');

%add noise at different levels to the blurred image


y2BlurredNoisy=imnoise(yblur,'gaussian',0,.0000000000001);
y3BlurredNoisy=imnoise(yblur,'gaussian',0,.00000000001);
y4BlurredNoisy=imnoise(yblur,'gaussian',0,.00000001);

%plot different noisy blurred images


figure();
subplot(2,4,1); imshow(yblur); title('no noise');
subplot(2,4,2); imshow(y2BlurredNoisy); title('Gaussian white noise of variance
10^(-13)');
subplot(2,4,3); imshow(y3BlurredNoisy); title('Gaussian white noise of variance
10^(-11)');
subplot(2,4,4); imshow(y4BlurredNoisy); title('Gaussian white noise of variance
10^(-8)');

%use simple X=Y/H to get back original image


%show how much noise affects it
Y1=fft2(yblur);
Y2=fft2(y2BlurredNoisy);
Y3=fft2(y3BlurredNoisy);
Y4=fft2(y4BlurredNoisy);

%zero pad the psf to match the size of the blurred image
%noisy images are all the same size ,thus do not require unique PSF's
newh=zeros(size(yblur));
psfsize=size(PSF);
disp(psfsize)
newh(1:psfsize(1),1:psfsize(2))=PSF;
H=fft2(newh);

%use simple X=Y/H to get back original image


%show how much noise affects it
y1deblurred=ifft2(Y1./H);
y2deblurred=ifft2(Y2./H);
y3deblurred=ifft2(Y3./H);
y4deblurred=ifft2(Y4./H);

%plot deblurred images


subplot(2,4,5); imshow(y1deblurred); title('no noise');
subplot(2,4,6); imshow(y2deblurred); title('Gaussian white noise of variance
10^(-13)');
subplot(2,4,7); imshow(y3deblurred); title('Gaussian white noise of variance
10^(-11)');
subplot(2,4,8); imshow(y4deblurred); title('Gaussian white noise of variance
10^(-8)');
Result:
After processing our blurred input image and adding noise to
it, we got our output image for different variance of noise as
shown below. The input image with highest variance of noise
after deblurring gave the least clear output. The clearance of
the image decreased as our variance of noise increases.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy