This project covers two parts: Frequency Domain and Gradient Domain Fushion. I will be applying concepts such as convolution, Gaussian, Laplacian, blending, and more.
For sharpening an image, I used the algorithm learned in lecture where the original image is convolved with a single filter. The equation I used for this is: f + α(f − f * g) which is the equivalent to f ∗((1+α)e−αg). I selected my α to be 1. I selected this image, though not blurry, I felt had multiple edges to enhance.
I selected my favorite image of my apartment balcony.
As you can see, the many edges of this image have sharpened.
For creating hybrid images, I used the technique discussed by blending the high frequency portion of one image with the low-frequency portion of another. In doing so, I created a filter for both the high and low frequencies and stacked the two together. I followed the same 2D Gaussian and convolution techniques for creating the filter as described in the project. I also computed the 2D Fourier transform images using the method described in the project spec: plt.imshow(np.log(np.abs(np.fft.fftshift(np.fft.fft2(gray_image))))).
Original Image
Original Image
Hybrid Image
For the second set of images, I used similar photos of dogs. This output was not as clear and differentiatable. Thus, when they are stacked on top of one another, it is not that clear since they line up very similarly.
Original Image
Original Image
Hybrid Image
For the last set of images, I used Audrey Hepburn and an owl. This output better at differntiating between distances since they were disimilar enough. Also, the owl hand many sharp edges to be picked out which made this hybrid image have a better output.
Original Image
Original Image
Hybrid Image. Close up you see an owl, but afar you see Audrey.
Like the project description, I implemented Gaussian and a Laplacian stacks by applying Gaussian at each level. These two combined creates an image that blurs and it progresses, and reduces the sharpness of the edges.
In this part of the project, I blended two images seamlessly using a multi resolution blending. This creates a smooth image spline. This is done by creating a mask and blur the image. I applied this to a few examples, including the oraple.
Original Image
Original Image
Blended Image
This second set of images, my personal favorite, was combining two different humans. The images were similar enough that the image spline has a very gentle seam.
Original Image
Original Image
Blended Image
The last set of images uses an irregular mask to put a lion on the beach. In order to make the mask blend, I had to add some blur. However, this reduces the overall sharpness of the image which can be a limitation.
Blended Image
This project explores gradient-domain processing, focusing on "Poisson Blending."
The primary goal of this assignment is to seamlessly blend an object or texture from a source image into a target image. We formulate this goal as a least squares problem. Given the pixel intensities of the source image "s" and of the target image "t", we want to solve for new intensity values "v" within the source region "S":
Here, Poisson works with the gradient domain instead of the spatial, frequency, etc. domain other techniques use. However, in focusing on the gradient, the tradeoff is made in the intensity.
In this example we compute the x and y gradients from this toy image, then use all the gradients, plus one pixel intensity, to reconstruct the original image. First we write the objective function as a set of least squares constraints in the standard matrix form. After writing the minimizing objectives, we solve for v and copy the value into the appropriate pixel in the output image.
For this blending technique, the goal is to transform the pixels in the source and target regions that correspond so that the boundary of the mask matches in the reconstructed image. This was done from the blending constraints summation equation in the project spec:
For my favorite image, I used the algoirthm described in the project spec and elaborated above. I selected these images because sky diving is fun and fascinating, and the forewarning collision with the bird seems fitting.
Blended Image
Blended Image
In this result, we can see that the image color is distored. This is because Poisson blending disregards the intensity. Thus, the color is not preserved when putting the source image onto the target. In this example, the water was intensely green, and the car intensely bright blue. When the car is put onto the water, some of the blue color is lost and appears almost green-ish.
Blended Image
In this example of the lion on the beach, poison blending turned out to be the more successful. This is because of the gradient and having the source image background similar to the color of the target image landscape. This allowed for smoother edges when blending. However, like in the bad example above, Poisson would not be ideal if you want to preserve the color of the source image. If intensity matters more, Laplacian blending would be more ideal.