myimageprocessingclass

Monday, May 13, 2013

fourier transform of image

command run 1:























octave:1> imga=imread('/home/hp/Downloads/1.jpg');
octave:2> imshow(imga)
octave:3>figray=fft2(imga); //figray is complex
octave:4>imshow(figray)

octave:9> imshow(abs(figray),[])

We can shift the quadrant back to its proper place by using the command 
imshow(fftshift(abs(figray))), [])
imshow(fftshift(abs(figray)))


Now we can inverse the transform we used by using another FFT. 
imshow(abs(fft2(fft2(Imga))));

it may look like the original circle but it is already inverse of the original. image. We can see it more clearly by doing the same things done on the circle to the image with the letter 'A'.
































































octave:26> imgb=imread('/home/hp/Downloads/6.jpg');


octave:28> imshow(imgb)


octave:29> fftb=fft2(imgb);
octave:30> imshow(fftb)
warning: imshow: only showing real part of complex image



octave:31> imshow(abs(fftb)); image obtained is white as below


octave:32> imshow(abs(fftb),[]); image obtained is same as white above







Posted by Prashant at 3:43 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Pages

  • Home
  • Transformations
  • General Topics
  • Plotting
  • Books
  • Communication Grid
  • Maths Workout
  • libraries
  • Suck
  • OpenGL
  • Opencv

Flickr Photos

Blogger templates

Blogger news

Popular Posts

  • image processing using scilab
    courtesy:http://www.scilab.in/files/workshops/30-03-2011-nagpur/Image_Processing_using_Scilab.pps
  • giotto-di-bondone-ognissanti-madonna-(madonna-in-maesta)
  • Image histogram in MATLAB
    %load rgb image src = 'C:\rainbow.jpg'; rgbI = imread(src); grayI = rgb2gray(rgbI); %get image histogram [counts bins]=imhist(grayI...
  • code
    img=imread('8.jpg'); figure(1);imshow(img); print -dpng a.png; img_gray=rgb2gray(img); figure(2);imshow(img_gray); print -dpn...
  • error in scilab
    error: The shared archive was not loaded: libjpeg.so.62: cannot open shared object file: No such file or dir solution: http://ubuntufor...
Simple theme. Powered by Blogger.