First I convolved my image with the finite difference operators Dx = [[1, -1]] Dy = [[1], [-1]]. The results of this are shown below.
I then combined these two images to get the gradient magnitude. I also obtained the binarized gradient magnitude where everything above a certain threshold was set to 1, and everything below that threshold became 0. While not perfect the images reasonably show the significant edges of the image.
I then smoothed the image with a gaussian filter, resulting in a blurred camera man.
As per the instructions I first appl;iad the guassian filter on the original image and then took the x and y gradiant. I then took the x and y gradients, followeing that then applied the guassian. These two procedures as expected obstasined the same result.
For straightening photos I used the followig method. I tested rotatiom angles from -10 degrees to 10 dregrees. At each rotation computed the edges of the images by blurring it and then using the finite difference operators to find the true edges. One case that struggles was the chess pieces. Here there is a mix of l;ines in differetn direction so there is no clear optimal way to rotate the image in a range of -10 to 10 degrees. One improvement may be to increase the range of search.
In Fouier domain a verticle line shows up as a horizontal line and vice versa. I used a similar technique to the reqular part of the question except I tranformed the image in the forier domain. This seemed to acheive decent results somewhat mirroring the rotations in the original implementation.
Below are the original, sharpened, and blurred images.
While I had sucess matching up faces, one case that failed was when I tried to match fruits up. This is because thier shapes are different so the high frequency of the rqasberry can be seen from a distrance away. While the result is ok this could be better improved by picking photos that closly match up in features.
I used color to enhance the effect of the blend. I found the having both colors worked well. However, I also tried having the low frequency color and high frequency not color that way the effect of walking back would show the low frequency more. I found having high freuency color and low frequency not color did not work as well as i anticipated.
This last one struggled a bit due to a mismatching in background colors. One solution would be to edit the mask so less of the shark background would show, but then it would end up hurting the idea of bleanding the backgrounds.