Effacer les filtres
Effacer les filtres

why i cant get the second figure ? how can i fix it

1 vue (au cours des 30 derniers jours)
sevgul demir
sevgul demir le 2 Sep 2022
Commenté : Rena Berman le 1 Nov 2022
clear all; close all;
I = imread('64img.png','png');
I = double(I);
figure;imshow (abs(I));
title ('test')
PH=rand([64,64]);
I = I .* exp(2i*pi*PH);
FTS = fftshift (ifft2 (fftshift (I)));
A = abs (FTS);
figure; imshow (mat2gray (A));
title ('objective spectrum')
here i can get the first figure but after that got an error why i cant get the objective spectrum? Couldnt fix it :(
  2 commentaires
Chunru
Chunru le 2 Sep 2022
What is error message? Where it goes wrong?
Rena Berman
Rena Berman le 1 Nov 2022
(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponse acceptée

Chunru
Chunru le 2 Sep 2022
I = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1114385/image.bmp');
I = double(I);
figure;imshow (abs(I));
title ('test')
%PH=rand([64,64]);
PH = rand(size(I)); % make PH the same size as I
I = I .* exp(2i*pi*PH);
FTS = fftshift (ifft2 (fftshift (I)));
A = abs (FTS);
figure; imshow (mat2gray (A));
title ('objective spectrum')

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Tags

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by