## 8b. Enhancement in the Frequency Domain

Improving the quality of an image can often be done by manipulating the image’s frequency aspect. Here we demonstrate basic applications of eliminating unwanted signals and patterns by means of the Fourier Transform.

**Fingerprints: Ridge Enhancement**

Clarity of patterns are very important in fingerprint recognition, especially in forensic science. In cases when fingerprint data are unsatisfactorily represented, a filtering technique can be used to improve its ridges.

An enhancement of the elevations and edges can be achieved by creating a filtering mask on the Fourier Transform of the image that allows only the frequencies of the fingerprint to pass through (Figure 2).

Figure 2. Creation of a filter mask for ridge enhancement. A. original FT of the fingerprint; B. Gaussian masks; C. filtered FT of the image. |

The FT of the fingerprint is better viewed in the logarithmic scale, using Scilab’s log() function:

imshow(log(fftshift(abs(fingerprint_gray))), []);

The masking is performed by doing a bitwise multiplication on the FT of the fingerprint and the FT of the filter, and then calculating for product’s inverse Fourier Transform.

fingerprint = gray_imread('fingerprint.png'); filter = gray_imread('fft_fingerprint_filter.png'); newI = ifft(fftshift(filter).*fft2(fingerprint)); imshow(abs(newI), []);

The resulting image will be a fingerprint pattern composed of better defined ridges, with clearer elevations and improved contrast (Figure 6). We particularly used a smooth mask (similar to a 2D Gaussian) to filter the FFT, instead a hard-edged mask (e.g. a circle), in order to avoid the effect of diffraction patterns (an airy disk, in the case of the circle). This is part of considering the Fourier Transform of the circle, if we recall the properties of the 2D Fourier Transform.

Figure 3. Fingerprint ridge enhancement. A. a grayscale of the original fingerprint; B. an enhanced image of the fingerprint after filtering. |

Note that filtering does not at all times need to be done using Gaussian masks. The filter to be applied would depend on the initial Fourier Transform and is created by carefully identifying which of the frequencies belong to the desired parts of the image.

**Lunar Landing Scanned Pictures: Line Removal**

Pictures taken from space are sometimes developed on-board the spacecraft and then sent to Earth in their digitized form. An example is the following image captured by the Lunar and Planetary Institute (LPI) during the Apollo 11 Mission. The noticeable vertical and horizontal lines are said to have resulted from combining image “framelets” to form the composite image.

Figure 4. A composte image of the surface of the moon. Courtesy of USRA. |

We will expect the frequencies of these lines to appear on the FT of the image along the x- and y-axis of the Fourier plane. We can eliminate these unwanted patterns by creating a mask against these peaks.

Figure 5. Creation of filter mask for line removal. A. original FT of the image; B. small Gaussian masks on peaks along the frequency axes; C. filtered FT of the image. |

Note that this time we used black shaded patterns on a white canvas. This is to cancel to zero the occurrence of the lines and allowing only the frequencies of the desired parts of the image to pass through. The result is shown in Figure 6.

Figure 6. Line removal technique in the frequency domain. A. a grayscale of the original lunar landing photo; B. an enhanced image after filtering. |

Notice that the presence of the lines on the photo are now minimized (if not totally removed) in the resulting image. The quality of the output image can be further improved by greater accuracies in filtering.

**Canvas Weave Modeling and Removal**

The original beauty of a painting or artwork can sometimes be obstructed by patterns from the surface of the canvas. An example is the following image of the detail of an oil painting obtained from the UP Vargas Museum Collection [1].

Figure 7. Detail of an oil painting. Courtesy of the UP Vargas Museum. |

The underlying weave patterns are characterized by diagonally-oriented lines, as shown in its Fourier Transform in Figure 8A. We remove these lines by blocking their frequency peaks with our mask filter.

Figure 8. Creation of filter mask for weave removal. A. original FT of the image; B. small Gaussian masks on diagonal peaks; C. filtered FT of the image. |

This process will result to the reduction of weave patterns from the canvas. Better results can achieved by creating the mask such that it more accurately blocks the unwanted artifacts.

Figure 9. Weave pattern removal technique in the frequency domain. A. a grayscale of the original oil painting photo; B. an enhanced image after filtering. |

The filters used for this case are made large enough in order to securely mask against the frequency peaks of the weave. The ideal filter would most closely resemble smaller masks with highly accurate placements over the Fourier plane. If we invert the color value of this mask filter and get its Fourier Transform, we will see the pattern of the canvas weave that we are trying to remove.

Figure 10. The weave pattern in the frequency domain. A. Color invert of the mask filter used; B. Fourier Transform of the filter. |

These are only some of the basic applications of enhancing images in the Fourier plane. Utilization of these methods does not limit to the examples presented above. Fourier enhancement may also be used in to achieve other goals such as image sharpening, which is achieved by bandpass filtering process.

For this set of activities (8A and 8B), I would rate my 10 for the accomplishment. I sincerely enjoyed this activity. 🙂

———————————————————————————————–—————–————————————

References:

[1] Soriano, 2010. Enhancement in the frequency domain. Applied Physics 186.

[2] Lie, 2010. Image enhancement in the frequency domain. CCU, Taiwan.

Hi, I am also preparing some posts for fingerprint recognition and image processing. Please check the link http://www.shirishgoyal.com/es/design-and-implementation-of-fingerprint-authentication-system-image-enhancement/ and send me your feedback.

Hi Shirish, I just read your webpost and I really appreciate the work you’re doing for a fingerprint auth system. I support your opinion in choosing the Gabor filter to do the automation. It convincingly produces better enhancements than the traditional methods. There are a few notions though that the algorithm takes some processing time and is more appropriate for prototyping than for a real fingerprint login system. Though this may be so, I believe the system will work just fine as long as it is backed up by good hardware. 😉

I tried with Fourier domain techniques and Spatial Transforms both but the DSP hardware I used was not fit for fourier transforms which required more power and memory to operate at desired levels. I will be posting the code for some of the initial stages soon. Image registration still seems a problematic point. Any good algorithms you can suggest for rotation invariant image registration for small images?

English version : http://www.shirishgoyal.com/en/design-and-implementation-of-fingerprint-authentication-system/

There’s a technique called SIFT (that’s Scale-Invariant Feature Transform) – works pretty well with rotations, translations and rescaling. With regards to storage, I think file formats and compression will do quite a trick.