Project 2

Fun with Filters and Frequencies!

Siyuan Zhai

Part 1: Fun with Filters

Part 1.1: Finite Difference Operator

Workflow

Results

Part 1.2: Derivative of Gaussian (DoG) Filter

Reason

From Part1.2, we see the difference operator results has a lot noise, to reduce it we have to find appropriate threshold and then binary it. Derivative of Gaussian filter is mush smoother

Workflow

Here is some of the resulte and blurred image:

Compare the image from Part 1.1 and Part 1.2, the noise is reduced in the DoG filter result. And edge is more clear and smooth in the DoG filter result.

To make the code faster, we can do the same thing as Part 1.2, but instead of convolving the image with the Gaussian filter and then convolving the result with the difference operator, we can first convolve the Gaussian filter with dx and dy, and then convolve the result with the image. This way, we only need to convolve the image once.
Below is the image of the result of this method:

The result of this method is the same as the result of the previous method becasue of the matrix commutative and associative , as showen in the above images.

Part 2: Fun with Frequencies

Part 2.1: Image "Sharpening"

Workflow

Results

However, if trying to sharpe a blurred image, it can not become the original image. Because part of the high frequency components are lost when the image is blurred.
It only sharpens the edges of the blurred image, but the details of the image are still lost. See the images below.

Part 2.2: Hybrid Images

Hybrid images combining the low frequency components of one image with the high frequency components of another image. The image looks like the low frequency image, when we are far away, but when viewed up close, the image looks like the high frequency image.

Workflow

Asked ChateGPT to make the webpage look nice,save subplot, and text edit https://chatgpt.com/share/66f1112c-db6c-8007-b156-05d7d1d9110c
Img from https://pixabay.com, and Abrobe Express