필터 지우기
필터 지우기

Fourier transform of multiple ROI not working

조회 수: 2 (최근 30일)
Russell Chow
Russell Chow 2021년 10월 4일
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.
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개)

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by