I was excited to be working with the Fourier transform again, so I enjoyed this activity. The difficult part for me was figuring out how to do the masking thing. I was caught in between trying to automating the process of making masks or just drawing them myself in Photoshop, which I used in this activity with scilab 5.5.2.
Anamorphism in Fourier Space
Fourier space demonstrates anamorphism, which is a property that makes it so something wide in one axis in regular space becomes thin in Fourier space, and vice versa. To observe this easily, we used a pair of rectangular apertures.
They look squished, as expected. But what happens if I try it with two dots? In the last activity, we showed the FT of two dots on the x-axis is a corrugated roof, based on a sinusoid.
Looks like spreading the dots further apart increases the frequency of the sinusoid. This makes sense, since these dots would represent the frequencies of the sinusoid, and spreading them further apart would have them correspond to a greater displacement from the origin, hence a greater frequency.
Rotation Property
“You spin me right round, baby, right round. Like a record, baby, right round, round, round.”
-Dead or Alive, 1984
Using these convenient sinusoids, we can demonstrate the rotation property of the Fourier transform.
Look at them go. The transforms essentially follow the rotation of the original signals.
While we’re rotating sinusoids, we can show how the FT handles superposition.
Now that’s interesting. Here it is again with one of the sinusoids having a different frequency.
When the signals are added, their transforms seem to be mirrored somehow. Let’s take this a step further and add some rotated sinusoids and see what happens.
Crazy, but still following some form of symmetry.
Convolution 2: Electric Boogaloo
So convolution was fun in the last activity. Time to do more.
First, we get that our slightly overused two-dot pattern produces a sinusoid, but what happens if we replace the dots with circles? How about Gaussians?
As you can see, the result shows the corrugated roof, but it’s constrained to the pattern you’d expect to see when you take the FT of a single circle or Gaussian, as shown in the previous activity.
This actually shows a part of what happens in convolution.
The two-dot pattern can be considered as two dirac delta functions, having a value of 1 at two points, and zero everywhere else. When you convolve two functions, you multiply them in Fourier space. Look at the FT’s. They’re the result of a multiplication between a sinusoid and the FT of the circle/Gaussian! This means that the original images we used are actually the result of a convolution of the two-spot pattern and a corresponding single circle or Gaussian pattern.
Now let’s prove this using the conv2 function in scilab. I’ll be convolving two dirac delta patterns with arbitrary patterns.
Aha, so I understood it right. Nice.
Mask Charge!!
With the words “transform” and “mask” being brought up, there’s no way I couldn’t reference this.
Last activity, we used convolution to do edge detection. This time, we’ll use it to do filtering.
Filtering is an important part of image processing, as it can be used to remove or enhance patterns. Here, we’re gonna clean up a picture of a fingerprint, just like how the Power Rangers cleaned Angel Grove of the evil of Rita Repulsa’s monsters.
Like the Power Rangers, we need masks to do the job. Our masks, however, don’t hide our faces while we perform martial arts moves, as much as I want them to. Instead, they hide unwanted frequencies in Fourier space.
In this case, I use a filtering mask in Fourier space to eliminate those nasty frequencies I don’t want showing up in my image so that I can get a clearer look at this fingerprint, generously contributed by my classmate, Roland.
After the filtering, it was much easier to binarize the image, so we can see all those lines and whorls in their curvaceous glory.
Mask Change I
Since we literally started small with fingerprints, let’s think big. Like really big. Like moon big.
Look at this picture of the moon.
How are the Power Rangers supposed to find Rita Repulsa’s moon palace with all these horizontal lines messing up the view? Well, we can help them out with our filtering powers!
I knew which frequencies to filter out by applying that anamorphic property we learned about earlier. And with this, we can get back to our fight against evil finishing this activity.
Mask Change II
Here’s something that I’d find challenging to sneak a Power Rangers reference into.
We can use filtering masks to remove the canvas from this image of a painting. This can be used to study the brush strokes or the pigmentation used by the artist. Not only that, but by studying the canvas pattern itself, we can determine what kind of canvas the painting was made on, which can help when dealing with art fraud and the like. Then we can toss them into a space dumpster where they will be trapped for 10,000 years. Ha, I did it.
While we’re disposing of evil people that seek to profit from lies and deceit, we should take another look at that filtering mask I made using Photoshop. I’ll admit it, I couldn’t automate this one.
The resulting pattern looks kinda like the canvas, which shouldn’t be surprising, since that’s the very pattern we were filtering out.
I know this time I didn’t do a lot of exploring out of the scope of the activity, but I was pressed for time. Maybe if I were a Power Ranger...
Anyway, I hope I did a good job explaining what the activity was about. I didn’t put any codes in this time, as they were similar if not identical to those used in the last one. I’ll give myself a 9 out of 10 for this one. I satisfied the requirements, but I think I could’ve done more. Again, maybe if I were a Power Ranger...
I’d like to acknowledge these people as my Power Rangers, arriving just in time to save me from not finishing my codes:
Joshua Abuel, for helping me eliminate the distracting noise and enhance the power of the fingerprint pattern
Louie Rubio, for guiding me in figuring out which frequencies to block in order to scan the moon for Rita Repulsa’s moon palace
Roland Romero, for lending me a hand, or finger, in the fight against evil
Dr. Maricor Soriano, for allowing me to post in this format in which I can reference the Power Rangers
I really like the Power Rangers. I hope the movie next year will be good.