Reputation: 263
How would you take a Fourier transform of an image and reconstruct it with, say, only the 10 most dominant frequencies in Matlab? I couldn't see anything too useful in the Matlab help. Many thanks!
Upvotes: 0
Views: 136
Reputation: 26040
You will probably want to keep the constant amplitude, i.e., preserve the mean of the image.
Sort all other frequencies by the absolute value of their amplitude, find the midpoint of the 10th and 11th highest amplitude and set all amplitudes with values below to zero, then transform back.
To experiment, one can consider that edges lead to the asymptotic behavior of amplitudes abs(A(m,n))
of C/(abs(m)+abs(n))
. Thus to preserve frequencies that might contribute to the definition of edges, sort by the modified absolute value abs(A(m,n))*(1+abs(m)+abs(n))
. This will probably not make much of a difference for 10 preserved amplitudes, so experiment by taking O(N) or O(N*log(N)) frequencies for an NxN image.
Upvotes: 2