Archive for August 12, 2010

Enhancement in the Frequency Domain

“Image enhancement” has come to specifically mean a process of smoothing irregularities or noise that has somehow corrupted the image, while modifying the original image information as little as possible. [1]

Convolution Theorem

To demonstrate, consider a binary image of two dots (one pixel each) along the x-axis symmetric about the center. Its Fourier transform is shown as follows.

Figure 1. Fourier Transform of two symmetric dots along the x-axis.

We now replace the dots with circles of varying radius, squares of varying width, and lastly Gaussians with varying variance and observe the effects on their Fourier transforms.

Figure 2. Fourier Transform of two circles with increasing radius. Notice the decrease in the size of the pattern.

Figure 3. Fourier Transform of two squares with increasing width. Similarly, the size of the pattern decreases.

Figure 4. FT of two Gaussians with increasing variance. Again, the pattern decreases in size.

Notice that the patterns produced for the Fourier transforms of the images are convolutions of the two dots with the shapes (circle, square, and Gaussian). For example, since the FT of the peaks is a sinusoid, the pattern produced for the two circles is a combination of this sinusoid with an Airy disk.

Now create a 200×200 array of zeros and put 10 random 1’s in it. Using imconv(), convolve it with an arbitrary 3×3 pattern [-1 -1 -1; 2 2 2; -1 -1 -1]. This demonstrates convolution of a dirac delta and a function f(t). The dirac deltas are approximated by the dots (1’s) and the arbitrary function f(t) is represented by the 3×3 pattern. The figure shows that their convolution results in a replication of f(t) in the location of the dirac delta.

Figure 5. Convolution of dirac delta and a function f(t). To demonstrate, an array with 10 random 1's was convolved with an arbitrary 3x3 pattern.

Now we consider an array with equally spaced 1’s along the x- and y-axis. As we can see, the spacing in the frequency domain decreases with increasing spacing in the spatial domain.

Figure 6. Fourier Transform of equally spaced 1's.

Fingerprints: Ridge Enhancement

The aim here is to enhance the appearance of a fingerprint’s ridges and remove its blotches. First, we must obtain the Fourier Transform of the fingerprint in grayscale to investigate where the frequencies of its ridges lie. Log scale was used because the range of values of the modulus of the FT image spans several orders of magnitude.

Figure 7. Fourier transform (log scale) of a fingerprint in grayscale. Image of fingerprint courtesy of http://www.theaviationnation.com/2008/02/19/dhs-10-fingerprints-from-foreigners-at-detroit-airport/

The Fourier transform obtained is useful in designing the mask for filtering frequencies. A filter suppresses certain frequencies in the transform while leaving others unchanged. The frequency of the ridges are shown in Figure 7 as the bright ring and the central spot. We design a filter such that only these frequencies remain.

Figure 8. Mask used for the fingerprint image.

To enhance the image, we apply the designed mask to the image in the frequency domain then obtain the inverse Fourier transform.

Figure 9. Enhanced fingerprint in grayscale (left) and binary (right).

Lunar Landing Scanned Pictures: Line removal

Here we want to remove vertical lines in an image. Again, a filter is necessary to remove the unwanted frequencies.

The vertical lines can be thought of as sinusoids, whose frequency correspond to the horizontal line in the FT image. Thus we design a mask to filter these frequencies out.

Figure 11. Fourier transform in log scale of the lunar landing image (left) and the mask used (right).

Figure 12. Original lunar landing image in grayscale (left) and filtered image (right).

Canvas Weave Modeling and Removal
Here we want to enhance the image by removing the canvas weave patterns.

Figure 13. A snapshot of an oil painting from the UP Vargas Museum.

Figure 14. Fourier transform in log scale of the image (left) and the mask used (right).

Figure 15. Original image in grayscale (left) and filtered image (right). Notice that the canvas weave patterns were filtered out and the brush strokes enhanced.

We now invert the grayscale of the filter mask and take its inverse Fourier transform to reconstruct the canvas weave pattern.

Figure 16. Inverse of the mask used (left) and its inverse Fourier Transform (right).

—————————————————————————————————————————————————

Reference:

[1] Bovik, Al. Handbook of Image and Video Processing. Academic Press. 2000.

—————————————————————————————————————————————————

I would like to thanks Joseph, Cindy, and Mean for the helpful discussions. 🙂

Self-evaluation: I give myself a score of 10 for this activity.



Design a site like this with WordPress.com
Get started