In this project I woked on 2D convolutions of images with specific filters. These included finite difference operator filters and derivative of gaussian filters. In the second half I worked on filtering, extracting and removing certain frequencies from images. This allowed me to write image sharpening algorithms, create hybrid images, create gaussian and laplacian stacks of images, and make multiresolution blendings of images.
For this part I took the partial derivative with respect to x and y of the cameraman image. Then computed the gradient magnitue image and binarized it to create an edge image. The gradiend magnitude is computed by taking the norm of the gradient with respect to x and the gradient with respect to y of every pixel on the image.
The threshold I found was only considering pixels with a gradient magnitude greater than 0.06
Original Cameraman Image
Gradient Magniute Finite Difference Operator Image
Binarized Gradient Magniute Finite Difference Operator Image
For this part I created a blurred version of the original image by convolving it with a guassian filter. Then repeated the procedure in Part 1.1. The images below show that by applying the gaussian filter to the original image we removed the high frequencies in it. This allowed us to remove some of the noise in the original edge image. As we can see, the edges in the edge images are much more clear and we have reduced the noise substantially.
Blurred Cameraman DoG Two Convolutions
Difference between original image and the blurred Cameraman
Gradient Magnitude DoG Two Convolutions
Binarized Gradient Magnitude DoG Two Convolutions
The results below are the same but they were generated using a single convolution by creating a derivative of gaussian filters.
Derivative of Gaussian Dx
Derivative of Gaussian Dy
Gradient Magnitude DoG One Convolution
Binarized Gradient Magnitude DoG One Convolution
I could not get my algorithm to work. It always returned that the 0th degree rotation was the best. Please look at my code for some partial credit. I made a lot of progress just could not get the final result to work.
In this part I implemented an image sharpening algorithm. It takes a blury image and sharpens it by subtracting the blurred version from the original image to get the high frequencies of the image. Then I added this high frequencies back to the original image which "sharpened" it. I did this using one convolution and two convolutions. The results below were generated using one convolution.
Original Taj Image
Sharpened Taj Image
Original Egypt Pyramid Image
Sharpened Egypt Pyramid Image
Original NYC Image
Sharpened NYC Image
Original Costa Rica Image
Sharpened Costa Rica Image
For this part, I selected a sharp image of a landscape. Then I blurred it and resharpened it. From the results, we can see that I was able to recover most of the details in the original image through the resharpening process. Nevertheless, some of the high frequencies were lost when we blurred the image and I was unable to recover them fully. Maybe I could try resharpening it twice.
Original Landscape Image
Blurred Landscape Image
Sharpened (blurred) Landscape Image
In this part I made hybrid images. The first image was passed through a low pass filter to only have low frequencies while the second image was passed through a high-pass filter to only contain high frequences. Then I added the two images. Below I also show the fourier analysis.
Original Derek Image
Original Nutmeg Image
Blurred Derek Image
Sharpened Nutmeg Image
Hybrid Nutmeg, Derek Image
Original Trump Image
Original Trump Image Fourier Analysis
Original Obama Image
Original Obama Image Fourier Analysis
Blurred Trump Image
Blurred Trump Image Fourier Analysis
Sharpened Obama Image
Sharpened Obama Fourier Analysis
Hybrid Trump Obama Image
Hybrid Trump Obama Image Fourier Analysis
Original Bear Image
Original Bear Image Fourier Analysis
Original Lion Image
Original Lion Image Fourier Analysis
Blurred Bear Image
Blurred Bear Image Fourier Analysis
Sharpened Lion Image
Sharpened Lione Fourier Analysis
Hybrid Bear Lion Image
Hybrid Bear Lion Image Fourier Analysis
In this part I implemented a Gaussian and Laplacian Stack. Here are the results of the laplacian and gaussian stacks on the Salvador Dali painting of Lincoln and Gala. Please note the the first image in the stack is the original image. I included it for comparing!
Original Salvador Dali Painting Image
Gaussian Stack of Salvador Dali Painting
Laplacian Stack of Salvador Dali Painting
Gaussian and Laplacian Stacks of Trump/Obamas Hybrid Image
Original Trump Obama Hybrid Image
Gaussian Stack of Trump Obama Hybrid Image
Laplacian Stack of Trump Obama Hybrid Image
This part of the project consisted on implementing Multiresolution Blending. For this, I selected two images. Then I computed the laplacian stack for each of the two images. Then I came up with a mask to unite the images. I took the gaussian stack of this mask. Finally, I blended the laplacian stacks of the images with the guassian stack of the mask to create the multiresolution blended image.
Original Apple Image
Original Orange Image
ImageLaplacian Stack of Apple Image
Laplacian Stack of Orange Image
Guassian Stack of Mask Image
Oraple Image
Original Earth Image
Original Mars Image
ImageLaplacian Stack of Earth Image
Laplacian Stack of Mars Image
Earthmars Image
Original Waterfire Image
Original Fire Image
ImageLaplacian Stack of Water Image
Laplacian Stack of Fire Image
Guassian Stack of Mask Image
Waterfire Image