In this activity, we are tasked to enhance images by removing certain parts which are not desired in the images.
We are given three situations: fingerprint ridge enhancement, line removal in scanned images, and canvas weave removal. To enhance the images, we take its Fourier Transform (FT), make a filter that will remove the frequencies of the unwanted details, and multiply the filter to the FT of the image. The filter is binary, so the unwanted frequencies will be multiplied to 0 and the frequencies that we want will be multiplied to 1. Since we are still in the frequency domain, we take the FT of the product to get the enhanced image.
Important note: the FT of the original image should be fftshifted first before multiplying to the filter. This is to make sure that the quadrants match before we multiply.
Fingerprint Ridge Enhancement
Initially, I downloaded a fingerprint image from (link here). I cropped and resized the image so that the program can handle the image processing faster. It was converted to grayscale in Scilab (see figure below).
Taking its Fourier Transform (FT) will give us the frequencies that exist in the image. The image below is the logarithm of the FT. This is just to emphasize the peaks in the FT. However, in the image processing procedure, the original FT of the image was used.
We can see that there are two crescents and one bright spot prominent in the image. This probably corresponds to the frequency of the fingerprint ridges, so this is the region that we want. To make the mask, we should design a binary array such that the regions we want are 1, and the unwanted regions are 0. This mask can be made in Paint by pasting the image of the log of FT, painting the desired regions white, and painting the other regions black. The mask I made looks like this:
Multiplying this mask to the FT of the image and taking the inverse FT resulted in this "enhanced" image of the fingerprint.
In this enhancement, good things and bad things came out. First, the good things. The ridges are now of uniform thickness, and the noisy background was removed. However, this is a fingerprint, and certain parts of fingerprints are important. In the reconstructed image, the important details, such as ridge bifurcation and whorl details were compromised.
Next, I tried to use my fingerprint as the subject for this image processing. (Short story on how I scanned my fingerprint: Since we don't have a stamp pad at home, I shaded a glass surface with a whiteboard marker, imprinted my fingerprint on the wet marker ink, and lifted the prints using a tape. Parang CSI lang, hehe. Then I scanned the tape after sticking it on to a bond paper.) Here is the scanned image of my fingerprint (left) and the grayscale version (right).
The original image is pink, because of the color of the whiteboard marker. The white spots are probably bubbles from the tape. Taking its FT gives us the frequencies:
The prominent frequencies which probably defines the fingerprint are found in the middle, the ring, the cross, and the diagonal line. This is the region I want to preserve, so the mask or filter I made follows that description. I made three masks (in Gimp) and had three reconstructed images for comparison.
Set 1
Set 2
Set 3
I find that the best mask among these three is the last one, because the fingerprint details are not lost. The first two ones were more blurred than the third. Note that the reconstructed images are inverted.
In this part of the activity, I learned that in fingerprints, it is difficult to enhance some features without losing some features. The best enhancement may be made with a carefully tuned filter, which I have yet to try. :)
Line Removal In Scanned Images
A scanned image of a lunar landing was to be enhanced by removing the vertical lines in the background. Below is the original lunar landing image.
We can see that there are vertical lines in the background of image which are not related to the lunar landing. To remove this, we take the FT of the image and make a mask to remove the unwanted frequencies. We know that vertical lines in the image are sinusoids, whose FT are dots in the x-axis of the FT image, so we know that we want to remove such dots in the FT image. By multiplying the mask or filter that cancels out these unwanted frequencies, we recover the original image without the vertical lines.
Shown below are the grayscale lunar landing image (1), its FT (2), the mask to remove the unwanted frequencies (3), and the resulting image (4). Note that the reconstructed image is inverted.
Canvas Weave Removal
Canvas weave removal through frequency filtering is used in studies about painting and art conservation, such as the ones done in the IPL laboratory. Shown below is a sample image of a section of a painting.
We can see the canvas as the recurring white dots on the painting. We can remove this by taking the FT of the grayscale of this image and filtering out the frequencies that correspond to the canvas weave. Shown below is the log of the FT of the image (1), the mask to remove the frequencies corresponding to the canvas weave (2), the grayscale image (3), and the reconstructed image (4). We can see that the canvas weaves were removed, resulting in enhancement of the brushstrokes in the painting.
Taking the inverse FT of the mask results in the reconstruction of the canvas weave, shown below. This is the weave that was removed from the original image.
I give myself 9 points for this activity. I was satisfied with the achieved image enhancements by manipulating in the frequency domain.


















0 comments:
Post a Comment