Hi Ayesha,
I understand that you want to analyze the naturalness of images using 1/f amplitude-frequency scaling through Fourier transform.
I assume you want to compare the amplitude spectrum of naturalistic and artifactual images by analyzing their frequency content.
In order to perform 1/f amplitude-frequency scaling analysis, you can follow the below steps:
Read and Preprocess Images:
Load your images and convert them to grayscale.
imdata_natural = rgb2gray(imread('path_to_natural_image.jpg'));
imdata_artificial = rgb2gray(imread('path_to_artificial_image.jpg'));
Compute Fourier Transform:
Calculate the 2D Fourier transform to get frequency representation.
F_natural = fft2(imdata_natural);
F_artificial = fft2(imdata_artificial);
Calculate Amplitude Spectrum:
Shift the zero-frequency component to the center and compute amplitude.
amplitude_natural = abs(fftshift(F_natural));
amplitude_artificial = abs(fftshift(F_artificial));
Plot 1/f Amplitude-Frequency Scaling:
Compute and plot the radial average of the amplitude spectrum.
radial_natural = mean(amplitude_natural, 2);
radial_artificial = mean(amplitude_artificial, 2);
loglog(radial_natural, 'b'); hold on;
loglog(radial_artificial, 'r');
legend('Natural', 'Artificial');
Interpret Results:
Compare slopes on the log-log plot; steeper slopes suggest more natural scenes.
Refer to the documentation of “fft2” and “fftshift” functions to know more about their usage:
- https://www.mathworks.com/help/matlab/ref/fft2.html
- https://www.mathworks.com/help/matlab/ref/fftshift.html
Hope this helps!