0
$\begingroup$

Let's say I have an image, which is NxN pixels in size. If I calculate the fourier power spectrum of this image, I get NxN values, with the highest distinguishable frequency at +- N/2 in each direction.

Let's also say I wanted to get a histogram of power over frequency, because I want to know which frequency carries which amount of power. Then I'd create concentric circles, with the origin of the fft. Bigger radius (and bigger distance from the origin), higher frequency, etc.

But now the questions start:

If the input image is not a square, but a rectangle, the highest frequency still has to be N/2 and M/2, respectively, and again both + and -.

In my opinion, it does not make any sense to still use circles for calculating the histogram. I'd have to use ellipses, wouldn't I?

Imagine a circle/ellipse now, going in each direction to the max frequency. Then there are four areas (area of the square minus the area of the circle) in each corner, from which I don't get any contribution to this histogram, because the absolute distance is larger than my max frequency.

Where's the error in that?

And last, I read several books and articles in the past few weeks. I read a passage about the same problem, but they didn't use circles/ellipses, they used a crooked square, i.e. a rhombus, with each corner on one of the axis. The problem is, I can neither find the passage again nor remember the actual text (for full text search). Does this approach make any sense? What about the four triangle-shaped areas in this case?

Regards and thanks for your help.

$\endgroup$
1
$\begingroup$

it does not make any sense to still use circles for calculating the histogram. I'd have to use ellipses, wouldn't I?

That's right. For radial averaging on a rectangular grid, the locus of equidistant points from the origin would look like an ellipse instead of a circle.

there are four areas (area of the square minus the area of the circle) in each corner, from which I don't get any contribution

That's right, and there's nothing we can do about that. If you care about those high frequencies, you should re-acquire your image at a higher sampling rate.

they used a crooked square, i.e. a rhombus, with each corner on one of the axis. ... Does this approach make any sense? What about the four triangle-shaped areas in this case?

In this case the locus represents points where the sum of the two spatial frequencies is a constant, i.e. instead of $\sqrt{f_1^2 + f_2^2} = \mbox{constant}$ we follow the points where $|f_1| + |f_2|=\mbox{constant}$. There's no reason why one is better or worse than the other. They are both valid methods of collapsing a 2D function of two spatial frequencies into a 1D function of one "combined" spatial frequency.

As with the circle/ellipse, there's nothing we can do about the bins outside the triangle area that never get analyzed.

When using a DFT, distance can be measured as the number of steps taken on a discrete 2D frequency grid. (See the discussion at the bottom of the page here: http://iubemcenter.indiana.edu/beyondNyquist.html). Constant frequency "ellipses" in this case are really "rectangles" of grid cells centered around the origin. This way all grid points get accounted for and there are no "dead" zones when computing the 1D collapsed PSD from the 2D DFT.

$\endgroup$
  • 1
    $\begingroup$ Thanks for your answer. Concerning the "dead" areas in the corners, I found a site with a different view: iubemcenter.indiana.edu/beyondNyquist.html In their opinion, all values with the same distance to the origin are not located on a circle, but a square. Due to discrete values in each direction, it does not matter which way to go in order to reach those values. They also state that values in the far corners dont violate Nyquist criteria. So a ellipse would then turn into a simple rectangle? $\endgroup$ – PhreakShow Feb 28 '17 at 12:45
  • $\begingroup$ Good find! I'll update my answer. $\endgroup$ – Atul Ingle Feb 28 '17 at 14:14
  • $\begingroup$ Thanks again for your answer. At least this makes sense to me now. What I still don't get: Almost every paper/journal/article/book/webpage that deals with fourier magnitude spectra and (especially) filtering in the fourier domain uses circle apertures for all kinds of filters (lowpass, highpass, doesn't matter). Why is that? Wouldn't the all need to use rectangles/squares as well? Example: cs.unm.edu/~brayer/vision/lowpass.gif $\endgroup$ – PhreakShow Mar 1 '17 at 23:20
  • $\begingroup$ And an additional issue: If I start creating rectangles in a matrix of discrete magnitude values, how would I determine if a row or column should be a part of the current rectangle, or the next, or the previous? If it were a square I could simple go one pixel to the left and one up, but for a rectangle this does not work. $\endgroup$ – PhreakShow Mar 2 '17 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.