Project 2
Part 1: Edge detection
Gradient Magnitude Computation
Gradient Magnitude Computation is a tool used to detect edges in an image. It works by taking the horizontal and vertical partial derivatives, and calculating the Euclidean norm of these derivatives. The idea is that an edge will occur in parts of the image where values change at a high rate, so thus a derivative/gradient magnitude would be used to measure this.
Demo
1.2: Derivative of Gaussian (DoG)
While the results above are able to capture edges, there’s still a lot of artifacts. One trick to solve this is to smooth out the original image first with a gaussian kernel before we run it through our Gradient Magnitude edge detection. Here are the results:
Main differences when using DoG vs Finite Difference Operator:
- The edges are much smoother and uniform; no jagged edges
- There are much less artifacts, both in the grass and also in the edges themselves
Part 2: Fun with Frequencies!
Image Sharpening
Below are some examples of images that were sharpened by simply subtracting a little bit of the low frequencies and normalizing back up (this essentially boosts the higher frequencies of the image).
Original
Sharpened
Changing the amounts of sharpness (for fun)
Hybrid images
Another cool thing you can do with frequencies is combine two images; when combining the high frequencies of an image image1
with the low frequencies of another image image2
, you can get an image that looks like image1
up close, and image2
from afar. Here’s some examples:
From a far, the image looks like Derick, but up close the image looks like nutmeg.
Multiresolution Blending
One really cool trick that can be done is blending two photos together. Essentially, you can take a mask
, img1
, img2
, and take the laplacian stack of all the two images, and the gaussian stack of the mask. Then, you can combine the images on each of the layers of the stacks, and collapse the resulting stack into a single image.