Saturday, January 21, 2012

Shannon!

One can predict, predict and predict unless the residue becomes perfect noise and that is the limit of compression, the Shannon limit!!

Saturday, January 14, 2012

Denoise it!!


This algorithm may not be very competent but it still gave appreciable results as I made them on my own without any background on image processing. What I have done is, First found out the irregular value in 3X3 matrix, which could possibly be noise. By irregular value I mean, the value which is 20 (this factor can be varied to study its effect) units farther from its neighborhood. Then we substitute the mean of regular values in the matrix to the irregular value.

Below is the MATLAB code for the same and in the end the result. A 3 to 4dB gain in PSNR is observed. Cheers!!



a=imread('plane.jpg');
sze=1200;
a=a(1:sze,1:sze,:);
b=imnoise(a,'gaussian');
c=b;
d=a;


for rgb=1:3
  rgb                       % for R, G and B matrices
  for i=2:sze-1
    i;
    for j=2:sze-1
      z=0;
      arr=zeros(3,3,3);
      for l=1:3
        for n=1:3     % if statement for neighborhood
          pqr=0;      % limit
 if((c(i-2+l,j-2+n,rgb))-c(i,j,rgb)<20 && (c(i-2+l,j-2+n,rgb))-c(i,j,rgb)>-20)
        z=z+1;
        pqr=1;
        arr(l,n,rgb)=c(i-2+l,j-2+n,rgb);   
        end
      end
    end
    c(i,j,rgb)=round((9/z)*(mean(mean(arr(1:3,1:3,rgb)))));
    end
 end 
end
imwrite(b,'3noised.png');
imwrite(a,'3original.png');
imwrite(c,'3noise+myalgo.png');

error_diff = c - b;          
decibels=20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR after reduction= +%5.2f dB',decibels)
error_diff = b - a;
decibels=20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR of noised image = +%5.2f dB',decibels))
original Image
Noised Image
Noised image, denoised!


Quater image denoised


removed noise!!

Thursday, January 5, 2012

The Colours!!

See the world around us! Its beautiful, isn't it? Why?
I guess beauty is defined as correct composition of shapes and colors that somehow appears nice to our mind, even if you cant perceive it. Now just look around you and observe the no. of colors you might see. For example I can see my roommate in green jacket, the color of wall of my hostel room - Yellow, the table - Brown, my pillow cover - Blue. I mean we are just covered with millions of colors.
And the strangest thing majority of elements which, surprisingly comprises of more than 99% of Universe, more than 90% of earth's crust, the s and p block elements are either colorless or white. The f block is too radio active to be around us.
So it is d block elements that surround us and adds colors to our life. The surroundings of yours wouldn't be as colorful as they are without the presence of these d block elements. These small percentage mass of earth's crust has somehow become so important that the earth; leave earth, even our imaginations, our dreams wouldn't be as beautiful as they are, so colorful, so beautiful and so happening.  We must respect nature for all it has given to us and keep our search on, to unveil the secrets.