I subtracted a gaussian blur from the image to get the high frequency features.
I scaled the high frequency features by an arbitrary alpha. Here's a turtle:
Here is the fourier analysis. Let us first look at the 2 original images.
Note: Image was manually aligned
This part of the project concerns using Poisson blending to blend 2 images together in a smooth manner. We achieve this by first defining a source image portion that will be moved into the
image unmasked portion to try to get it to keep its gradient features while also trying to match the colors of the background along the edges of the source image portion.
Fortunately this optimization can be expressed as a least squares problem which we solve with a sparse least squares solver.
The point of this problem is to show that we can reconstruct an image from only its gradients and a single pixel of intensity (grayscale colour).
I chose the UFO to the right hand side. The way I did this was I first separated the colors channels. For each channel, I used the Poisson blending algorithm. I found that it was nice to think of the second summation in the HW assignment as (vi - (si - sj + tj)).
I also used a lil-matrix (a type of scipy sparse matrix), and I also wrote a few helper functions to help convert between a single variable represntation of a mask pixel, source image co-ordinate, and target image co-ordinate.
This failed sicne the darkness of Lord Vader's helmet kind of darkens Anakin's skin too much.
The sizing is off too, but the colour wouldn't have looked good anyways.
I used mixed gradients to improve the flying dutchman. With these mixed gradients, the clouds extend
through the dutchman's mask a lot more clearly
We see that in the laplace blending, a lot more of the background bleeds through to the mixed image
It doesn't work well since this bleeding is a gaussian blurred bleed, which just ends up
lightening our source image. Meanwhile poisson blending tries to keep the details sharp while
trading off the bleed between the images.
I beleive that laplace blending works better if you want more smooth bleeding between the images,
such as in the orple case. However if you want a more continous blend, mixed gradients or poisson
blending might be better