2d fft for many images
Afficher commentaires plus anciens
If I would like to compute and plot the 2D frequency spectrum for multiple images (50 frames), can I do that for each individual image and the avrege them?
here is the code:
min=zeros;
for K = 1 :1500:75000
this_file = strcat('C:\Users\Admin\Desktop\Tutorial\frame',num2str(K),'.tif');
im_input= rgb2gray(imread(this_file));
z_min=10*log10(abs(fftshift(fft2(im_input))));
min=min+z_min;
end
PSD_min= (min)/ 50;
______________
1- is this a right way compute the spectrum?
2- If I would like to remove the DC component, I tried
z_min=10*log10(abs(fftshift(fft2(im_input-mean2((im_input))... do you recommend other way?
Thanks
2 commentaires
Jonas
le 15 Mai 2021
it looks like the correct way to conpute the 2d spectrum, also the removal of the dc component ist correct. the questions if it is ok to add up the spectra depends on your goal, like already wrote you will get an anverage spectrum, this would make for me only sense, if the images are similar, otherwise you add up information that do not necessarily belong to each other / are related to each other.
you could also consider to add up the complex spectra (without the abs() ) and afterwards you can use abs on the summed spectrum and average it
Image Analyst
le 15 Mai 2021
Modifié(e) : Image Analyst
le 15 Mai 2021
@Jonas Looks like a fine "Answer" to me so it should be down below in the "Answer" section.
Réponse acceptée
Plus de réponses (1)
Sulaymon Eshkabilov
le 15 Mai 2021
To remove the DC from your calculated values, you can use:
DC=mean2(im_input);
IM2=im_input-DC;
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!