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
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
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.

Connectez-vous pour commenter.

 Réponse acceptée

Jonas
Jonas le 15 Mai 2021
Modifié(e) : Jonas le 15 Mai 2021

0 votes

it looks like the correct way to conpute the 2d spectrum, also the removal of the dc component is correct. the questions if it is ok to add up the spectra depends on your goal, like you 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

1 commentaire

omar Alharbi
omar Alharbi le 16 Mai 2021
Thanks for your feedback. Yse the images are similar.
I appreciate your comments

Connectez-vous pour commenter.

Plus de réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 15 Mai 2021

0 votes

To remove the DC from your calculated values, you can use:
DC=mean2(im_input);
IM2=im_input-DC;

Community Treasure Hunt

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

Start Hunting!

Translated by