CS194-26 (CS294-26): Project 2

Part 1.1

Gradient magnitude computation is a technique used in edge detection. In general, edges are areas of an image where high frequencies contact low frequencies. In other words, by convolving with the finite difference operator, the derivatives we are calculating (in whole, the "gradient") is where these edges occur. The derivative is greatest where the edges are. Therefore, this convolution as an image actually serves as a representation of where edges occur. Adding in x and y together gives a more or less complete map of edges of an image.

partial derivative x

png

partial derivative y

png

both x and y together to form gradient

png

binarized edge picture (thresholded)

png

part 1.2

gaussian blur on original picture

png

partial x derivative

png

partial y derivative

png

both x and y partials together

png

binarized edge picture

png

The biggest and most obvious difference is that the edges are more clearly outlined. This would occur because gaussian blurring removes noise in the image, places where the gradient could potentially be high, even though as humans we wouldn't consider that area of the image as an edge. Removing these areas allows us to threshold at a much lower value when binarizing without including noise in the edge image. Therefore, the edges that actually exist are much more pronounced.

Same as before but with a single convolution operation:

partial x derivative

png

partial y derivative

png

x and y partials

png

binarized edge picture

png

This demonstrates that convolution is an associative operation, instead of convolving (gaussian (image)) (finite difference operator), we did (gaussian finite difference operator) (image), meaning we operated on the image precisely once.

Part 1.3 image straightening

This is the original image:

png

The best angle is -3
This is the oriented image

png

This is the histogram for the original orientation

png

This is the histogram for the optimal orientation

png

This is the original image:

png

The best angle is -3
This is the oriented image

png

This is the histogram for the original orientation

png

This is the histogram for the optimal orientation

png

This is the original image:

png

The best angle is -43
This is the oriented image

png

This is the histogram for the original orientation

png

This is the histogram for the optimal orientation

png

We can see that this is obviously a failure case, this is due to the assumption we make that vertical and horizontal edges implies correct alignment of a picture. While that is true a lot of the time, diamond signs are one notable exception to that.

This is the original image:

png

The best angle is -2
This is the oriented image

png

This is the histogram for the original orientation

png

This is the histogram for the optimal orientation

png

Part 2.1

Unsharpened image

png

Sharpened image

png

Original image

png

Blurred image

png

(Re)sharpened image

png

The level of sharpness seems to be similar between the original image and the resharpened image in that the edges are very clearly defined. However, there is a clear loss of resolution in that areas of the image without clear edges still remain quite blurry.

Part 2.2 hybrid images

Sample: input image 1

png

Sample: input image 2

png

Result:

png

FFT diagram of input image 1

png

FFT diagram of input image 2

png

FFT diagram of input image 1 after going through low pass. As can be seen the high frequencies are no longer there.

png

FFT diagram of input image 2 after going through high pass. As can be seen the low frequencies were removed.

png

FFT diagram of final hybrid image.

png

Input image 1

png

Input image 2

png

Final hybrid image:

png

Input image 1:

png

Input image 2:

png

Final hybrid image:

png

I would consider this somewhat of a failure case in that I really see Mona Lisa no matter what distance I am at when viewing the image. I attribute this to the white of the eagle which might cause problems when overlapping different frequencies.

part 2.3 gaussian and laplacian stacks

Gaussian stack for lincoln picture:

png

Laplacian stack for lincoln picture:

png

Gaussian stack for hybrid image from previous section. As can be seen only the low pass image from before is clearly recognizable.

png

Laplacian stack for hybrid image from previous section. As can be seen, although faint, the high pass image from before is what is present in these images (carol christ)

png

Multiresolution blending for oraple picture.

png