FFT2 command error

18 visualizaciones (últimos 30 días)
William Klingenstein
William Klingenstein el 29 de Nov. de 2020
Comentada: Stephan el 1 de Dic. de 2020
I have written a program implementing the fft2 command to get the Fourier transformation of an image along with other changes and i keep recieving an out put error for:
Error in fft2 (line 17)
F=fft2(imdata);
Below is my code for this program. I also wrote the program another way and had the same error fo the same function.
clear all; close all; clc
imdata = imread('BluOrn Star.jpg');
figure(1);imshow(imdata);
originalRGBImage = imdata; % Save original image for later display in figure (7)
title('Original Image');
imdata = rgb2gray(imdata);
figure(2); imshow(imdata); title('Gray Image');
%Get Fourier Transform of an image
F = fft2(imdata);
% Fourier transform of an image
S = abs(F);
figure(3);imshow(S,[]);title('Fourier transform of an image');
%get the centered spectrum
Fsh = fftshift(F);
figure(4);imshow(abs(Fsh),[]);title('Centered fourier transform of Image')
%apply log transform
S2 = log(1+abs(Fsh));
figure(5);imshow(S2,[]);title('log transformed Image')
%reconstruct the Image
F = ifftshift(Fsh);
f = ifft2(F);
figure(6);imshow(f,[]),title('reconstructed Image')
h7 = figure(7);
imshow(originalRGBImage);
  1 comentario
Stephan
Stephan el 1 de Dic. de 2020
What shows up for:
which fft2 -all

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by