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

Jonas
Jonas 2021년 5월 15일
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 2021년 5월 15일
편집: Image Analyst 2021년 5월 15일
@Jonas Looks like a fine "Answer" to me so it should be down below in the "Answer" section.

댓글을 달려면 로그인하십시오.

 채택된 답변

Jonas
Jonas 2021년 5월 15일
편집: Jonas 2021년 5월 15일

0 개 추천

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

omar Alharbi
omar Alharbi 2021년 5월 16일
Thanks for your feedback. Yse the images are similar.
I appreciate your comments

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 5월 15일

0 개 추천

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

질문:

2021년 5월 15일

댓글:

2021년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by