Phase Scrambling/Fourier transform of Images?
24 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Matthew Peoples
il 1 Giu 2021
Risposto: Subhadeep Koley
il 1 Giu 2021
Hi there - I am trying to Fourier phase scramble an image and I am stuck on getting the image to appear. Upon transforming, imshow() shows a blank image - any idea what I am doing wrong? I've included the code below. Thank you so much.
img_object_path = "Object Image was specified here"
obj_img = imread(img_object_path);
object_fft = fft2(obj_img);
mag = abs(object_fft);
phase = angle(object_fft);
phase = -pi + (pi+pi)*rand(size(phase)); % Between -pi and pi
reconstruct_img = mag * exp(i * phase);
phase_scrambled_img = abs(ifft2(reconstruct_img));
imshow(phase_scrambled_img);
0 Commenti
Risposta accettata
Subhadeep Koley
il 1 Giu 2021
phase_scrambled_img is of type double but its range is beyond [0, 1], therefore use the below syntax so that imshow(_) can scale the display based on the range of pixel values in phase_scrambled_img.
imshow(phase_scrambled_img, []);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox 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!