In this activity, we did image enhancements in the frequency domain. In particular, we tried to eliminate repetitive patterns in an image by filtering out the frequencies associated with them via masking techniques in the frequency domain.
2. Two circles along the x-axis symmetric about the center
Figure 8 shows an image of the painting "Detail of the Frederiksborg." Our goal is to remove the weave pattern so that we can see the painting as we would if the canvass were completely flat. This way, the brushstrokes will be more distinguished.
The weave patterns may be obtained by inverting the masks and multiplying it with the FT of the image then taking the inverse FT. The weave pattern for each mask is shown in Figure 11.
A. Convolution
To begin, we first did some exercises in Fourier transformations. Using Scilab, we generated several patterns and took their Fourier transforms (FT). These patterns include:
1. Two dots along the x-axis symmetric about the center
2. Two circles along the x-axis symmetric about the center
3. Two squares along the x-axis symmetric about the center
4. Two Gaussian functions along the x-axis symmetric about the center
There are several ways to produce these pattern. One is by finding the corresponding positions on the image that you want to assign a value of zero or one (depending on whether you want a white shape in a black background or vice-versa.) Another way is by convolving the shape with Dirac delta functions at the points where you want your shapes to be located.
The convolution theorem is a very important tool when operating in the frequency domain. It is useful to remember that:
1. The FT of a convolution of two functions in space is the product of the two functions' FT:
FT [ f ∗g ]=FG.
2. The convolution of a dirac delta and a function f(t) results in a replication of f(t) in the location of the dirac delta
Fourier transforms of diffferent patterns
Below are the generated patterns and their respective Fourier transforms.
Below are the generated patterns and their respective Fourier transforms.
1. Two dots (Dirac delta functions) along the x-axis symmetric about the center
(a) (b)
Figure 1. (a) Two dots, 1 pixel each, located at x = -1 and x = 1 along the x-axisand its (b) FT |
(b) radius = 0.1 units
(c) radius = 0.2 units
(d) radius = 0.5 units
Figure 2. Two circles along the x-axis and their FFT for different radii
3. Two squares along the x-axis symmetric about the center
(a) side = 0.05 units
(b) side = 0.1 units
(c) side = 0.2 units
(d) side = 0.5 units
Figure 2. Two squares along the x-axis and their FFT for different length of sides
4. Two Gaussian functions along the x-axis symmetric about the center
(a) variance = 0.05 units
(b) variance = 0.1 units
(c) variance = 0.2units
(d) variance = 0.5 units
Figure 4. Two Gaussians along the x-axis and their FFT for different values of variance
B. Lunar Landing Scanned Pictures: Line Removal
Figure 5 shows an image of one of the craters on the surface of the moon taken by the lunar orbiter. However, this is a composite image produced by combining individual framelets. Because of this,evenly spaced horizontal lines are overlaid on the image.
Figure 5. Composite image of one of the moon's craters taken by the Lunar Orbiter
The FT of the image is shown in Figure 6a. Due to the very bright zero order (center), the higher order frequencies are no longer easily observable. We want to see where the higher order frequencies lie since these are the ones that contribute to the noise in the image (i.e. the horizontal lines) and need to be masked. To make them more obvious, we want to eliminate the central part of the FT so we multiply it by a circular mask and we yield the image in Figure 6b.
(a) FT of the composite image of the moon's crater in Figure 5
(b) FT with masked zero order
From the masked FT, the frequencies with high amplitude are the ones that contribute to the horizontal lines in the image. A mask is created to block these frequencies. This mask is multiplied by the FT in Figure 6a and the inverse FT of the product is the reconstruction. The mask and the reconstructed image is shown in Figure 7. The horizontal lines on the image are visibly reduced.
MASK RECONSTRUCTED IMAGE
Figure 7. Masks used (column 1) and the corresponding reconstructed image (column 2)
C. Canvas Weave Modeling and Removal
(a)
(b)
Figure 8. (a) color and (b) greyscale image of the painting "Detail of the Frederiksborg"
The FT of the image is shown in Figure 9. We also got the FT with masked zero order
(b) FT of the painting with masked zero order
Figure 9. FT of the painting (a) without and (b) with masked zero order
From the FT, we made the masks in paint where the FT in Figure 9b is just "color-inverted" and thresholded for conversion to black and white image.
(a1) First mask used
(a2) Reconstructed image using mask in (a1)
(b1) Second mask used
(b2) Reconstructed image using mask in (b1)
(b1) Third mask used
(c2)Reconstructed image using mask in (c1)
Figure 10. Masks and reconstructed images for the painting
The weave patterns may be obtained by inverting the masks and multiplying it with the FT of the image then taking the inverse FT. The weave pattern for each mask is shown in Figure 11.
(a)
(b)
(c)
Figure 11. Weave patterns obtained for the (a) mask in Fig 10 (a1), (b) mask in Fig 10 (b1) and (c) mask in Fig 10 (c1)
I give myself a grade of 10 for this activity for being able to do the required tasks and for understanding the concepts well.
Also, I would like to thank Ms. Eloisa Ventura, Ms. Maria Isabel Saludares and Mr. Gino Borja for helpful discussions.
References:
1. M. Soriano, "Activity 6: Enhancement in the Frequency Domain, " AppPhy 186 Activity sheet, 2012
Comments
Post a Comment