Part 2: Fun with Frequencies!
Part 2.1: Image "Sharpening"
Taj Mahal
In this subpart, we start with the blurry image of Taj Mahal. By subtracting the blurred version from the original version, we repeatedly gain the high frequencies of the image.
Because an image often looks sharper if it has stronger high frequencies, we are able to "sharpen" the blurry image.
Blurred Taj Mahal image
|
Sharpened 0.5x
|
Sharpened 1x
|
Sharpened 1.5x
|
Sharpened 2x
|
Sharpened 2.5x
|
Mt. Tamalpais
We also explore the results using the following image, which I took on a hiking trip in the Berkeley Hills.
Mt. Tamalpais
|
Mt. Tamalpais (Blurred)
|
Now, to sharpen the image again:
Blurred Mt. Tam image
|
Sharpened 0.5x
|
Sharpened 1x
|
Sharpened 1.5x
|
Sharpened 2x
|
Sharpened 2.5x
|
Part 2.2: Hybrid Images
In this part, we create hybrid images using the approach described in the SIGGRAPH 2006 paper by Oliva et al. Hybrid images are static images that change in interpretation as a function of the viewing distance.
Sample images (of Derek and his former cat Nutmeg)
Derek Picture
|
Nutmeg Picture
|
Hybrid Picture
|
Nutmeg (the cat) is clearly visible in the hybrid picture. When we view the image from a distance, however, we should be able to (only) see Derek.
More examples - Ed Sheeran & Squirrel
I had a great time at Ed Sheeran's The Mathematics Tour, and I study at Berkeley, so I came up with the idea of mixing two things I like - Ed Sheeran and squirrels.
When you are close to the image, you should be able to see the squirrel. However, if you move further away from the screen, you should only be able to see Ed Sheeran.
If you don't see Ed, you are not far enough from the screen.
Ed Sheeran
|
Nutmeg Picture
|
Hybrid Picture
|
Fourier Frequency Analysis
This part displays the fourier frequency analysis results for the original images.
Input Image: Ed Sheeran
|
Input Image: Squirrel
|
Filtered Image: Ed Sheeran
|
Filtered Image: Squirrel
|
Hybrid Image
|
Bells & Whistles: Using Colors to Enhance the Effect
To enhance the effect of our hybrid image, we can retain the colors of the images
in either the low-pass or the high-pass filter. The results are displayed below:
Uncolored output
|
Colored low-pass filter
|
Colored high-pass filter
|
In this particular example, using colors yielded very promising results. When I am close to the image, I can discern even the slightest details of the squirrel.
This is especially evident in the second example, where we used color in the high-pass filter (i.e., high-frequency components). It renders the image more vivid and captivating.
Now, what if we used colors in both high-frequency and low-frequency components?
In this example, this is also a viable approach. However, I like the results that used colored high-pass filter better.
I think for different hybrid images, the visual output will be different each time you try different combinations of weights as well as choices of filters to retain color.
It's quite challenging to definitively say which approach will always work the best.
More examples - Porsche and Frog
Porsche 911
|
Frog
|
Hybrid Picture
|
Failed Example - Joker and Batman
There are several reasons this example doesn't work as intended. One of the most important reasons is that the Joker has very prominent facial features, including the markings on his face, which are easily visible even from a distance.
This does create a very interesting combination, though - the upper half of the image looks like the Joker, but the lower half reminds us of the Batman.
Joker
|
Frog
|
Hybrid Picture
|
Part 2.3: Gaussian and Laplacian Stacks
In this subpart, we implement Gaussian and Laplacian stacks, these are similar to pyramids but without the downsampling. This is a preparatory step for multi-resolution blending.
The Gaussian stack contains low-pass images, and the Laplacian stack contains sub-band images. To construct the Laplacian stack, we subtract the Gaussian low-pass image from the previous layer.
Apple
|
Orange
|
Apple (Masked)
|
Orange (Masked)
|
Blended
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Part 2.4: Multiresolution Blending (a.k.a. the oraple!)
Now, let's proceed to create the Oraple, a blended version of an apple and an orange, discussed in the 1983 paper by Burt and Adelson.
An image spline is a smooth seam joining two image together by gently distorting them.
Multiresolution blending computes a gentle seam between the two images seperately at each band of image frequencies, resulting in a much smoother seam.
To deliver the final result, we blend the corresponding levels of the Laplacian stacks of the two images using a Gaussian mask, and then collapse the final image.
Result
|
More examples - Venice Beach
The left side of the input image is from the popular video game, Grand Theft Auto 5, which is set in Los Santos—a locale inspired by the real-world city of Los Angeles. On the right side is the same location as in the game, Santa Monica Beach, but captured in real life. Through this composition, I aim to blend the two halves to explore the boundary between fiction and reality.
While the skies merge seamlessly, the grounds don't blend as effectively due to differences in texture. I think more advanced techniques might help the two halves blend better, but still I really enjoyed the output.
Input
|
Output
|
More examples - Irregular Mask
In this example, I attempted to depict a Corgi running through a baseball field.
It's uncommon to see a Corgi running across a baseball field, especially during a major game, so I thought this would be an intriguing scenario.
I created the mask for the Corgi using Meta AI's 'segment-anything' and employed the previously described approaches for the multi-resolution blending.
Input 1
|
Input 2
|
Irregular mask
|
Result
|