Spatial frequency (SF) is an image quality metric that measures the overall activity level in an image . The spatial frequency is defined as
SF= sqrt (RF^2 + CF^2)
where RF is the row frequency and CF is the column frequency. Formulas for CF, RF and SF can be found here [1,2].
Li et al. present values for SF, which are between 5 and 30. Spatial frequency function given here generates values between 0 and 1. This is presumably due to the greyscaling. Li et al. do not present the method of their greyscaling.
Here, Matlab function rgb2gray  is used to convert RGB values to grayscale values by forming a weighted sum of the R, G, and B components:
0.2989 * R + 0.5870 * G + 0.1140 * B
These are the same weights used by the rgb2ntsc function to compute the Y component.
The coefficients used to calculate grayscale values in rgb2gray are identical to those used to calculate luminance (E'y) in Rec.ITU-R BT.601-7 after rounding to 3 decimal places.
Rec.ITU-R BT.601-7 calculates E'y using the following formula:
0.299 * R + 0.587 * G + 0.114 * B
The SF should not be mixed with the spatial frequency of the visual system. Spatial frequency (in the context of the visual system) refers to the level of detail present in a stimulus per degree of visual angle .
 Eskicioglu, A. M., & Fisher, P. S. (1995). Image quality measures and their performance. IEEE Transactions on communications, 43(12), 2959-2965.
 Li, S., Kwok, J. T., & Wang, Y. (2001). Combination of images with diverse focuses using the spatial frequency. Information fusion, 2(3), 169-176.
dralp (2021). Spatial frequency (SF) (https://www.mathworks.com/matlabcentral/fileexchange/68753-spatial-frequency-sf), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!