2d fft for many images
이전 댓글 표시
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
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
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.
채택된 답변
추가 답변 (1개)
Sulaymon Eshkabilov
2021년 5월 15일
To remove the DC from your calculated values, you can use:
DC=mean2(im_input);
IM2=im_input-DC;
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!