Measuring the resolution of a stereomicroscope: FFT method

Back to resolution page

Fourier Transform

A microscope acts like a low-pass spatial frequency filter between the subject and the image, blocking higher spatial frequencies that contribute to image sharpness. Thus by analysing the spatial frequency content of a photomicrograph taken through a microscope, we can get a feel for the extent of the filtering imposed by the microscope, especially if the subject contains high spatial frequencies. A Fourier transform can be used to determine the spatial frequency components of an image.

Background

Figure 1 shows four computer-generated images and their Fourier transforms (FT). The first image is a random pattern of single pixels (computer-generated). The next images were generated by treating the first with Photoshop's Gaussian Blur filter at the indicated pixel radius. This has the effect of reducing the higher spatial frequency components of the image. Below each image is its Fourier transform.

A FT maps how much 'energy' is at each spatial frequency. Axes are not shown, but cross at the center of the image (as in the fourth FT -- though those aren't axes, they are due to edge effects). White areas indicate the presence of energy; the further from the origin, the higher the frequency. Thus we can see the first image has energy evenly distributed thoughout the spatial frequencies, but as the subject image is blurred, energy is increasingly constricted closer and closer to low frequencies near the origin. An image with no contrast (all one shade) would have just a point (all the energy) at the origin.

Fig 1. Random single pixels, blurred with a radius of 1, 2, and 4 pixels. Second row: FFT of image.

There are many fascinating details available on the web, eg., Introduction to Fourier Transforms for Image Processing -- search on '2D fourier transform'. For purposes here, the main point is that an FT provides a view of the spatial frequency components in an image, and that the further the 'white areas' are from the origin of an FT, the higher the spatial frequency.

The highest possible spatial frequency in the image, the Nyquist frequency, is 2 pixels per cycle (because it takes at least one pixel to represent each peak of a single cycle). Thus one needs to ensure that the camera mounted on a microscope has sufficient pixel density to capture all the frequencies passed by the microscope (discussed at How many pixels does a microscope camera need?).

A free and widely-used FFT package is included with ImageJ from the US National Institute of Health. Here's how to use it: Start the application; a small control panel will open. Open an image file (eg., JPG or TIF). Select a region of the image to analyse. If necessary, ImageJ will pad your selection to increase its size to a power of 2 and make it a square, so it's just as well to provide that shape to begin with; select the area selection tool, then click-drag an area of your image. Hold the shift key as you drag to make the selection a square. Watch the status line at the bottom of the ImageJ window to see the width of the square as you drag. Once a selection is made, you can reposition it just by dragging. When you are ready, select Process->FFT->FFT to generate an FFT for the selected region.

(You can go in reverse too, experimenting with altering the FFT, ie., the frequency domain, with ImageJ editing tools, and then use Inverse FFT to see what it looks like in the spatial domain.)

Fig 2. Replicated image

To do its work, the FFT algorithm makes an endless, repeating mosaic of tiles, with each tile being the image you provide (made into a square of size a power of 2, if yours wasn't already). If your image edges happen to blend seamlessly horizontally and vertically when tiled, the FFT display will be 'clean' and as you expect. However, if (as is common) there are abrupt jumps between 'tiles' when the opposite sides of your image are joined, such as in figure 2, that will create high frequency components in the resulting FFT along the axes (figure 3). (See the above Intro reference for more information.) The slight 'round off' at the edges of the '2 px' and '4 px' images in figure 1, and the abrupt jumps at the image edges in figure 2, give rise to the energy along the axes in their FFTs.

Figure 3 shows four computer-generated images (top row) and their FTs. The diagonal edge generates the diagonal 'line' in the FT frequency domain; slanting the edge ensures that in the frequency domain (FT), its energy will be distinct from the energy along the axes created by the tiling. Notice that the frequency components of the edge constrict toward the center at the edge is increasingly blurred.

Fig 3. FFTs of diagonal edge, 35 degrees, of fig 2, blurred with a radius of 1, 2, and 4 pixels.

ImageJ displays spatial wavelength, the inverse of spatial frequency (wavelength = 1 / frequency). The wavelength (a.k.a. cycle length) of a point on the FT can be obtained using ImageJ by positioning the cursor over the FFT display and reading the wavelength, in image pixels per cycle, from the status bar at the bottom of the ImageJ window. This can be converted to subject pixels per cycle by using Analyse->Set Scale (a way to obtain subject pixels per mm is to photograph a millimeter scale through the microscope).

If we assume the cycle length of the highest frequencies visible in the FFT of the photomicrograph correspond to the diffraction limit resolution distance rAiry (the radius of an Airy disc), then NA can be estimated from the FFT. If νFFT is the highest spatial wavelength (in subject plane length units per cycle), then:

NA = 0.61 λ / rAiry = 0.61 λ / νFFT

where λ is the wavelength of the light (eg., 550 nm, an average of visible light wavelengths).

Method

Any unsharpened photomicrograph from the microscope and camera system of interest can be analysed; chances are high that the subject had higher spatial frequency components than were able to pass through the microscope+camera, so an FFT of the image will likely show a discernable maximum radius of frequency energy. A good test subject is one that generates high spatial frequencies near and beyond the resolution limit of the microscope. Good test subject features are sharp edges and a high degree of randomness. A sharp edge is good, and also are random scratches on metal (eg., sandpaper scratches).

Sharpening algorithms (eg., in imaging processing software in the camera, in the computer attached to the camera, or in Raw processing software) can significantly increase the spatial frequency content of an image. It is essential to disable or defeat sharpening to get a true reading of the microscope + camera. If the camera provides Raw format, that's great; just be sure the Raw converter does no sharpening (by default, Photoshop Raw converters do a minor amount of sharpening; turn it off). With cameras that don't provide Raw, sharpening may be suppressed by using low contrast subjects (the sharpening algorithms only kick in at a certain contrast level). Sharpening, when it occurs, is usually visible, and test images at different contrast levels (eg., by varying the lighting on the razor blade target) can reveal at what contrast level sharpening occurs.

If the microscope objective passes higher spatial frequencies than the camera can record, then the FFT may show energy at wavelengths up to and shorter than 2 pixels per cycle. This means the camera sensor is the limiting component. To capture higher frequencies, the image projected onto the sensor could be magnified, or a different camera with more pixels per unit distance could be used.

To 'normalize' an image so that its FFT can be better compared with another, once selected and prior to FFT analysis, the image area should be treated with Process->Enhance Contrast. This will set the contrast to maximum.

Obviously this method involves subjective decisions (eg., judging the bounds of energy in the FFT) and so the results are estimates.

Example

See Review: MicroscopeNet's V434B stereomicroscope for an example of the application of this method.

Version history

2010-Dec: First issue
2016-Aug: HTML5, minor edits