We took this project as an opportunity to use filters and frequencies towards creating hybrid images, finding edges, and sharpening and blending images.
1. To find the partial derivatives, I convolved the image with Dx = [-1, 1] and Dy = [1, -1]^T using scipy.signal.convolve2d
.
Gradient x
Gradient y
2. Computed the gradient magnitude image: (np.sqrt(grad_x**2 + grad_y**2))
Gradient Magnitude
3. Threshold: np.max(grad_magnitude) * 0.36
4. Created Binary Edge Image using the threshold.
Edges
Approach 1:
1. Created a Gaussian filter with ( sigma = 2 ). Blurred the image by convolving it with the Gaussian filter using convolve2d
.
Blurred cameraman (sigma = 2 )
2. Convolved the blurred image with Dx and Dy to get the partial derivatives.
Gradient x (DoG)
Gradient y (DoG)
3. Computed gradient magnitude and created binary edge image:
Gradient Magnitude (DoG)
Edges (DoG)
Approach 2: The difference in this approach was first convolving the Gaussian filter with Dx and Dy and then applying it to the blurred image. The results were almost identical, with slightly wider edges.
Gradient x (DoG)
Gradient x (DoG)
Edges (DoG)
Blurred Version
Sharpened Version
Blurred Version
Sharpened Version
Basic example of hybrid images.
Riding Lions in Egypt!
Failure: Although you can see both images, the fireworks did not fit well enough to merge with the tree leaves.
My favorite hybrid!
Frequency Edna Moda
Frequency Linda Hunters
Frequency Low Pass
Frequency High Pass
Frequency Combined
Apple Progress
Orange Progress
Oraple Progress
Just like magic!
Avocado Progress
M&M Progress
Combined Progress