Filtering in Fourier Space
One good example of a repetitive patterns usually seen as part of the object is a very high resolution image of a painting on canvas. This high-resolution image would show the weave of the canvas itself already. This can easily be removed by masking their frequencies in frequency domain thus effectively removing its existence in the newly filtered image. In turn, you can also enhance specific frequencies as well.
Convolution theorem
Fourier transforms of different symmetric shapes are shown below
Two dots
The result of taking the FT of two dots symmetric in the x-axis (of image) gives an alternating black and white grating (fringes). The dots are now changed into circles with varying radius..
 |
2 dots: Aperture and FT |
2 Circles of varying radius
For symmetric circles with varying radii, the trend noticed was that increasing the radii of the circles result in the decreasing of the radii of the central circle in the FT pattern. It was also noticed that an increase in radii also result in the increase in the presence (number) of circular-like patterns.
 |
2 circles: Aperture (top) and FT (bottom) for varying radii |
2 Squares of varying width
Replacing the circles with squares of varying width as well, the general trend was that it was similar to the trend in the previous (2 circles) figure however it was noted that instead of circular patterns, square patterns were observed as it spreads into smaller sizes along the x and y direction (about the center only). This can be attributed to the theoretical equivalent of the pattern observed which is the sinc function which applies to square apertures.
 |
2 squares: Aperture (top) and FT (bottom) for varying widths |
2 Gaussians with varying sigma
The making the Gaussian dots, the Gaussian equation was used.
The variance was varied accordingly and the results is shown in the figure below. Note that the larger the variance, the smaller the creatted pattern becomes (FT).
 |
2 Gaussians: Aperture(top) and FT (bottom) for varying radii |
Applying FT on a different pattern, we consider 200 by 200 matrix with peaks at random positions. This was convovled to the formed image (of making).
 |
5 by 5 pattern |
The 5 by 5 pattern used is shown in the figure just above. The matrix with 10 peaks at random positions are shown on the figure below (left). Now we made a placed the 5 by 5 pattern at the middle of a separate 200 by 200 matrix as shown in the figure below(middle) as well. Convolving the two images, the result is shown below (right most). It was noted that through convolution, the single 5 by 5 pattern was repeated/replicated over the random peak positions.
 |
Pattern(middle) and 200 by 200 with 10 random 1s (left), and their convolution (right) |
Another 200 x 200 matrix of zeros was made, and 1's were placed at equal x and y spaces on it. In order to make the pattern, the function repmat() was useful. The FT was then obtained and the results are shown below, applying on varying spacing. It was noted from the results that as the spacing was increased, the number of frequencies from the FT increases. It was further observed that the number of frequencies in a column or row is equivalent to the spacing used.
 |
Patterns of varying spaced 1's in a 200 by 200 matrix (top), and its FTs (bottom) |
Lunar Landing Scanned Pictures: Line removal
Note that we have an image of the lunar landing that was scanned. Note the lines seen in the photograph. The image was initially converted to grayscale.
 |
Image of lunar landing |
The fourier transform of this image is shown below. Note the lines seen in the FT is attributed to the observed lines along the x and y direction of the image itself.
 |
FT modulus of image |
Thus, applying mask on the horizontal and vertical parts with high frequencies (white lines), the resulting images would no longer have the lines that were initially observed from it. The results are shown below. It was noted that as the width of the lines (removed) were increased, the less evident the lines were on the resulting image.
 |
Superimposed masks with FT modulus of figure (left), Masks (middle), and resulting image from filters (masks) |
Canvas Weave Modeling and Removal
The initial image is from a painting of Dr. Daria where the canvas weave is very apparent in the captured image of the painting.
 |
"Frederiksborg", Oil on canvas by Dr. Daria |
Now only a part of the image was used
 |
Part of painting |
Now, from the FT of the image, a filter mask was made to remove the canvas weave patterns. The FT modulus of the part of painting is shown below.
 |
FT modulus of the part of the painting |
The mask used was
 |
filter mask |
Now, the filtered image is shown in the figure below. Note that the weave pattern is gone. Now, the removal of the weave pattern leaves more detail on the brushstrokes made by the painter.
 |
Filtered image |
Inverting the grayscale of the filter mask, and taking its inverse FT, the generated modulus image is similar to that of the weave pattern. (This is really cool!)
 |
Generated weave pattern |
What I did also was that i varied the masks used, where I varied the size of mask, and the number of masks used. I have a total of 50 points that were considered for masking. Here, the first part of the activity was very useful I just varied the shape of small mask, and placed it on my 50 points (Using FT) which made everything a bit easier to modify.
 |
Canvas (left), filtered images (middle), and masks (left) for varying mask size. |
It was noted that the larger the mask, the less prominent the weave pattern was. I also varied the number of masks used. The results are below. It was noted that the more peaks were masked, the more successful the filtering of the weave was.
 |
Canvas (left), filtered images (middle), and masks (right) for varying number of masks |
For this activity, I give myself a 10 for successfully generating all the required results. It was very challenging at first but once I got the gist of it, it became a bit easier. I am quite happy with the results I got specially the 'reconstruction' of the weave canvas.
I give thanks to Aimee for hints. I finally found what was wrong! hehehe.. Thanks for the talks Eloi, and Tarcy.. :D
Comments
Post a Comment