CompSci 194 - Final Project

"Pre-canned projects: Light field camera + A Neural Algorithm of Artistic Style"

Project 1. Light Field Camera

For this project, I used rectified photos from the Stanford Light Field Archive, which has datasets comprising of multiple images taken over a regularly spaced grid. I used the image of a chess board.

The first task is generating the effects of refocusing the camera at different depth. The nearby objects should be very clear, whereas the objects far away should look blurry in comparison.

The rectified images are sorted. To implement this, I loop through the dataset with respect to the center image, located at row 8, col 8, and readjusted necessary images with shifted focus. Then I average all the images in the grid to simulate focus at different depths.

To enhance the visual effects, i set the aperture to 6, which is pretty high.

Averaging a large number of images sampled over the grid (perpendicular to the optical axis) will produce a large aperture effects, whereas averaging over fewer images will generate the effects that mimics small aperture.

To implement this, I loop through all the image in the dataset, in a row by row, col by col order. (thereby labeling each image (i,j))I add image to my collection only if it meets the standard of having math.pow((i-8),2) + math.pow((j-8),2) smaller than math.pow(aperture,2). Then I average over my pool of selected photos that meets the criteria of given aperture.

Focus remains the same in the aperture adjustment section.

--- GIFs ---

"Refocusing.gif"

"Aperture_adjustment.gif"

Project 2. A Neural Algorithm of Artistic Style

This is a particularly fascinating project, where i am able to in a artistic way combine classic paintings with images of my daily life. The main goal of the project is separation of image content from image style, thus allowing to recast the content of one image in the style of any other image throught the means of artificial neural networks. In demonstration of the fascinating idea of style + content hybrid, I created my own "artistic images", combination of the style of well-known paintings with the content of my own phytography collections.

My first creation is the recast of my childhood playground in the style of The Starry Night by Dutch Post-Impressionist painter Vincent van Gogh, as shown below.

I used publicly accessible pretrained "VGG19" artificial network according to the paper, and run my training loop on the content and style images for 100 iterations. (I originally planned to run more, but google colab crashes easily some points after that)

I saved my recast results every 10th iteration. The result is shown below.

However, due to the limitation of my GPU engine, and the paper's lack of instruction on any specific CNN configuration and parameters, my results are not perfect. The recast effects is not as satisfying as the work attached in the paper (shown below), but the general color and style is already showing.

2nd case: I did a artistic style transfer from "The Scream" to my book shelf.

I'm more satisfied with my second creation compared to the first. The color and the style of the paintings is pretty obvious recasted on my bookshelf, even the strokes are showing.

Attached is an amazing work from the paper.