Why i cannot getting correct Fourier transformed image using matlab?

dariush

I am trying a test some Fourier transformation operations, but i cannot get correct Fourier transformed image, for example, consider following images:

Lennaenter image description hereWhat is suppose to be

The last image is the Fourier transformed image what which should be my output

The matlab code i have used is as following:

function fftshow(file)
    close all;
    img=imread(file);
    ft=fft2(img(:,:,1));
    sft=fftshift(ft);
    asft = abs(sft);
    lasft = log2(asft+1);
    imagesc(img), title('The real image');
    pause
    imagesc(asft), colormap([0,0,0;1,1,1]), title('The magnitude image');
    pause
    imagesc(lasft), colormap([0,0,0;1,1,1]), title('The log2 magnitude image');
    clear img ft sft;
end

what am i doing wrong?

Any help would be appreciated.

lennon310

colormap([0,0,0;1,1,1]) works as a binary display, use colormap(gray) instead.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

why image is rotated when i get Fourier transform of image in matlab

From Dev

why image is rotated when i get Fourier transform of image in matlab

From Dev

MATLAB fourier image filtering

From Dev

How can I Fourier phase scramble a grayscale JPEG image in Matlab?

From Dev

Why am I getting the "cannot find image" error in javascript?

From Dev

Why am I getting tile cannot extend outside image error when trying to split image in half

From Dev

Why do I need to query twice for correct reply using serial port in Matlab?

From Dev

Optimizing Fourier transformed signal length

From Dev

Why MATLAB cannot give the correct result of the quartic equation?

From Dev

Filtering signal noise using Fourier Transforms and MATLAB

From Dev

Fourier transform and FFT for an arbitrary plot using MATLAB

From Dev

Filtering signal noise using Fourier Transforms and MATLAB

From Dev

How can I define the period before fitting a Fourier series to discrete data using MATLAB?

From Dev

Why am I getting "Cannot resolve symbol"?

From Dev

Why I am not getting the POST data of image?

From Dev

why i'm not getting the exact image back?

From Dev

Why I am not getting the POST data of image?

From Dev

Matlab: getting a subset of an image

From Dev

Why am I not get getting correct column positions in that parse tree?

From Dev

Why am I not getting the correct number of objects in my list?

From Dev

Why am I not getting correct output with sort command

From Dev

why am I not getting the correct URL path in swift OSX

From Dev

Why aren't I getting the correct Len of the number of elements in a key?

From Dev

Why am I getting "The magic number in GZip header is not correct." error using OWIN auth against Azure SQL

From Dev

I cannot figure out why I am getting AttributeError

From Dev

Why am I getting a "cannot find symbol" when I compile?

From Dev

I cannot figure out why I am getting AttributeError

From Dev

Why I cannot pass the correct argument to my static function in Swift?

From Dev

Why I am getting wrong matrix norm in matlab?

Related Related

  1. 1

    why image is rotated when i get Fourier transform of image in matlab

  2. 2

    why image is rotated when i get Fourier transform of image in matlab

  3. 3

    MATLAB fourier image filtering

  4. 4

    How can I Fourier phase scramble a grayscale JPEG image in Matlab?

  5. 5

    Why am I getting the "cannot find image" error in javascript?

  6. 6

    Why am I getting tile cannot extend outside image error when trying to split image in half

  7. 7

    Why do I need to query twice for correct reply using serial port in Matlab?

  8. 8

    Optimizing Fourier transformed signal length

  9. 9

    Why MATLAB cannot give the correct result of the quartic equation?

  10. 10

    Filtering signal noise using Fourier Transforms and MATLAB

  11. 11

    Fourier transform and FFT for an arbitrary plot using MATLAB

  12. 12

    Filtering signal noise using Fourier Transforms and MATLAB

  13. 13

    How can I define the period before fitting a Fourier series to discrete data using MATLAB?

  14. 14

    Why am I getting "Cannot resolve symbol"?

  15. 15

    Why I am not getting the POST data of image?

  16. 16

    why i'm not getting the exact image back?

  17. 17

    Why I am not getting the POST data of image?

  18. 18

    Matlab: getting a subset of an image

  19. 19

    Why am I not get getting correct column positions in that parse tree?

  20. 20

    Why am I not getting the correct number of objects in my list?

  21. 21

    Why am I not getting correct output with sort command

  22. 22

    why am I not getting the correct URL path in swift OSX

  23. 23

    Why aren't I getting the correct Len of the number of elements in a key?

  24. 24

    Why am I getting "The magic number in GZip header is not correct." error using OWIN auth against Azure SQL

  25. 25

    I cannot figure out why I am getting AttributeError

  26. 26

    Why am I getting a "cannot find symbol" when I compile?

  27. 27

    I cannot figure out why I am getting AttributeError

  28. 28

    Why I cannot pass the correct argument to my static function in Swift?

  29. 29

    Why I am getting wrong matrix norm in matlab?

HotTag

Archive