Fourier transform of multiple ROI not working
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The for loop plots 30 ROI on my image, calculates the FFT of an demeaned ROI, and stores it in a 3D matrix. I then average and normalize all my fft transformed ROIs. However, when i go to plot my image, I am not sure what I am doing wrong here. My plot should be donut shaped.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/757279/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/757279/image.png)
for i = 1:nROI
rectBW = createMask(drawrectangle(gca, 'Position', [x1(i),y1(i),ROIsize,ROIsize]));
roi = NoiseImg1;
roi(rectBW == 0) = 0;
r = mean(roi);
demean_roi = roi - r;
NPS1 = fftshift(fft2(demean_roi)).^2;
NPSdata1(:,:,i) = NPS1;
end
avgNPS1 = mean(NPSdata1,3) .* (voxelspace(1)^2/(ROIsize^2));
figure; %Nx = Ny = image size, fs = 1/pixelsize
imagesc([-(fs/2) (fs/2) * (Nx-2)/Nx], [-(fs/2) (fs/2) * (Ny-2)/Ny], abs(avgNPS1)); colorbar; colormap hot;
title('NPS 1 (mm^2*HU^2)'); axis image;
xlabel('Spatial Frequency in X (mm^{-1})'); ylabel('Spatial Frequency in Y (mm^{-1})');
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Filtering and Enhancement finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!