FFT2 command error
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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);
Risposte (0)
Vedere anche
Categorie
Scopri di più su Fourier Analysis and Filtering in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!