In part 1.1, I began with creating the finite difference operator. In order to do so, I began with instantiating dx as [[1,-1]] and dy as the same but transposed. From here, I was able to convolve the image with dx and dy which is shown below. From there, I was able to calculate the gradient magnitude, by squaring the convolved dx and dys, summing them, and taking their square root, which is just the basic formula for calculating gradient magnitude here. Lastly, I was able to turn this into an edge image, by binarizing the gradient magnitude image by using a threshold that would be able to suppress the noise in the image, but still keep the real edges.
Although, in 1.1 we see that we are able to trace over the edges of the camerman image, we can still do better. There is a lot of noise that we can still eliminate. As we learned in lecture, we can make use of the Gaussian filter to create a blurred version of the image by convolving with the image. From there, I was able to repeat what we did previously above to find an edge image with less noise and more real edges.
The difference is quite easy to see. The edge image that we created with the gaussian blur, has significantly reduced the noise, made the edges much smoother, and kept more real edges. This required two convolutions, however, we can do the same thing with a single convolution and expect to see the same results.
As we can see comparing the images from above to these, as expected, we have obtained the same images and results.
In order to sharpen images in 2.1, I derived the unsharp masking technique. As mentioned before, we can use the Gaussian filter to remove high-frequencies and blur the image. If we take our remaining low-frequency image and subtract that from the original image then we have the high-frequencies which we can use to sharpen an image, as an image looks sharper with stronger high-frequencies. So, I did exactly this as shown below with the Taj Mahal and a Ferrari.
Another objective of 2.1, was to take a sharp image, blur it and then try to sharpen it again. Thus, I used the already sharpened Ferrari, blurred it again, and tried to sharpen it again As we can see, the ferrari below that has been re-sharpened, has become very sharpened to a point in which you can tell it has been heavily edited. However, you can clearly see the progression of sharpening above and what happens if we even further sharpen it below.
In 2.2, the goal was to take two images and form a hybrid image of them. To create a hybrid image, I first aligned the two images, then low-pass filtered one image and high-pass filtered the other image Lastly, I added the two images together and displayed the final hybrid image. I did this for Derek and Nutmeg and another example with Will and Jaden Smith. Additionally, I showed how hybrid images can go wrong as well.
Another example of the hybrid image I created was Will and Jaden Smith.
Here if are close we are able to see Jaden Smith, stepping far back we are able to see Will Smith.
Failure Case : Lastly, I have an example for when hybrid images can go wrong. In this instance, I tried to make a hybrid image of a cheetah jumping and a motorcycle doing a wheelie. However, we see this does not work as well as the points used to align them are not as great as they have differing angles as well as sizes for the objects.
To blend two images, I used the gaussian and laplacian stacks with a mask to blend the selected images together. This multiresolution blending and use of various image frequencies created in the stacks allows for making a smoother blend between two images. The first image that I blended was the orange and the apple, to create the ORAPLE!! From there, I also provide an example below of blending a basketball and volleyball together. Lastly, as a different masking approach I used the horizontal seam to make the ultimate energy drink Rockster (combination of monster and rockstar).
Horizontal Seam Blend :