FFT2 command error

조회 수: 18 (최근 30일)
William Klingenstein
William Klingenstein 2020년 11월 29일
댓글: Stephan 2020년 12월 1일
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
Stephan
Stephan 2020년 12월 1일
What shows up for:
which fft2 -all

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by