Pick your favorite blurry image and "sharpen" it using the unsharp masking technique we covered in class.
#
#
FFT
#Obama and Biden
#Hermione and Harry
#
#
This is a technique of taking two images, a source and a target, and blending them. A naive approach to blend the images would be to just copy and paste the pixels, however, no context information is taken into account. For instance, if merging a ball from one beach to a different beach, the differing colors of the sand creates issues for the human eye, which is able to tell the changing gradient very easily.
To counter this, we enforce the constraint that the gradients of the source image must be minimized (sum of squares) when inside the target's cut out region. At the border, we enforce that pixels not only maintain the gradient, but also have similar intensities to the pixels outside the border (inside the target image). This will produce a massive strike in the least squares error if the boundaries do not match in color -- and least squares will attempt to spread this error over the entire source image, changing its intensities to blend well within the target
show_images([s, v_shaped])
#
#
#
My understanding for why this did not work is because the boundaries mismatch by a lot, making the brightness too high for the corgi. In addition, the image is placed at the boundary of the sand and the water, which further confuses the gradients and ends up making the corgi look like a pig...
#
#
#
#