matlab - 图像的二维傅里叶变换的 Matlab 错误
问题描述
我编写了一个实现 fft2 命令的程序,以获取图像的傅立叶变换以及其他更改,并且我不断收到以下输出错误: fft2 中的错误(第 17 行) F=fft2(imdata); 下面是我的这个程序的代码。我还以另一种方式编写了程序,并且对相同的功能有相同的错误。
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);
错误代码:
Attempt to execute SCRIPT fft2 as a function:
/MATLAB Drive/fft2.m
Error in FFT2Image (line 13)
F = fft2(imdata);
>>
解决方案
推荐阅读
- python - 在 python 中进行 API 调用的项目结构
- angular - 我想在指令中调用我的 API 并在需要的地方使用指令。任何人都可以帮助我。请罚款我的例子
- curl - 使用 certpath 初始化 NSS:sql:/etc/pki/nssdb 错误
- firebase - Kotlin suspendCancellableCoroutine 返回集合
- java - “Java Runtime Environment 检测到致命错误:”在 JDK eclipse 上运行 Java Project 时
- php - 在 PHP Linux Azure Web App 中,$_SERVER['REQUEST_METHOD'] 始终设置为 GET,即使 POST、PATCH、DELETE 等请求是通过 Postman 发出的
- excel - 如何删除列中的重复值但仅在 VBA 中的空行之间?
- tensorflow - 在 TF2.x 中使用 tf.while_loop 的第二个梯度返回 None
- android - 房间 Android 中的日期转换器
- excel - 当提供的值在其限制范围内时,字节数据类型出现溢出错误