Monday, 7 November 2016

Blurring and de blurring of Color images

Deblurring is a main technique that used to removed the blurred noise from the blurred images.

Mat lab is an important platform to play with an images. Here we can simply remove blurred by using some filters.There are

  1. wiener filter
  2.  regul filter
  3. blind filter
  4. lucy filter
for an example,I used an image to blurred and recovered blurred.

% Load image
    I = im2double(imread('C:\Users\KIRUVI5\Desktop\matlab_final\project\star.jpg'));  
  %read an image

    %I = im2double(Image) converts the intensity image  to double precision, re scaling the data if necessary.

    %Image can be a gray scale intensity image, a true color image, or a binary image.If the input image is of class double, then the output image is identical.

    subplot(2,3,1);imshow(I); title('Source image');                    %show the image


by this mat lab code we can read the image from the file. Then we add the blurred to the image

% Blurre image
    PSF = fspecial('disk', 15);                             
%set the point separate function***************for blurring if add gaussian, blind filter doesn't work
    Blurred = imfilter(I, PSF,'circular','conv' );          %set the point separate in blurred image


Then we add the noise to the image.

% Add noise
    noise_mean = 0;
    noise_var = 0.00001;
    Blurred = imnoise(Blurred, 'gaussian', noise_mean, noise_var); %add the gaussian noise
   subplot(2,3,2); imshow(Blurred); title('Blurred image');         %show the blurred image
    estimated_nsr = noise_var / var(Blurred(:));                  
  %noise signal ratio = noise variance / variance of blurred image


Then used the filters to restores the images
% Restore image
    subplot(2,3,3);imshow(deconvwnr(Blurred, PSF, estimated_nsr)), title('Wiener'); 
                                                                                                                        % add the wiener filter
    subplot(2,3,4); imshow(deconvreg(Blurred, PSF)); title('Regul');                %add the regul filter
    subplot(2,3,5); imshow(deconvblind(Blurred, PSF, 100));title('Blind');          %add the blind filter
    subplot(2,3,6); imshow(deconvlucy(Blurred, PSF, 100)); title('Lucy');           %add the lucy filter

Note that I used different colors for fonts that indicates that are the same colors like mat lab code





K.vimalan | KIRUVI5

Author & Editor

MCSD | Microsoft Certified Solution Developer - App Builder

Software Engineer at H2 Compute-LK

0 comments:

Post a Comment