Part 1: Fun with Filters
1.1: Finite Difference Operator
To form the edge image, I first calculated the partial derivative of the image in x and in y, then calculated the magnitude by doing np.sqrt(grad_x**2+grad_y**2), finally used the threshold 0.00075 to supress the noise.
1.2: Derivative of Gaussian (DoG) Filter
Use a low pass filter--the Gaussian filter before calclating the partial derivative will remove some noise and provide a more defined and smooth edge.
1.3: Image Straightening
Failture Case
We can see from the figure that my algorithm thinks the more negative the rotation angle is, the greater percentage of horizontal and vertical edges there are. This is due to the fact that my algorithm crops more chunk of the image as the rotation angle gets bigger. Therefore, when the angle is very big, with a smaller amount of horizontal and vertical edges, the percentage can be a lot higher.
Part 2: Fun with Frequencies!
2.1: Image "Sharpening"
2.2: Hybrid Image
I used color to enhance the effect. I used color for the low-frequency component, and gray scale for the high-frequency component.
Example Image
Self Select Image
Failture Case
Apprantly, you cannot have two cuties at one place togeher.