Computational Photography Assignment 2

Alyssa Reuter - Spring 2010

Description

To simulate the effect of a selective focus camera, I devised a three step algorithm:

First, the application allows the user to define the focus plane with a polygon by clicking with the mouse to place the vertices.

Next, a copy of the input image is slightly blurred to simulate depth of field. The focus plane is then pasted on top of the blurred image using the polygonal mask defined by the user in the previous step. This process is then repeated three more times while expanding the mask, which creates the effect of increasing blur away from the focus plane. One trick I used was to use a small amount of blur on the first iteration to create a smooth transition between the regions that are in and out of focus. For each of the following iterations, I increased the strength of the filter to emphasize the depth of field (applying the same filter successively worked too, but not quite as noticeably).

Finally, I convert the image to HSV to increase the saturation of the image, which makes the subject look more like a toy-like miniature.

Results

My implementation turned out very well—it yield convincing results and allows an artist a good degree of flexibility in defining the focus plane. Both horizontal and vertical regions can be specified, as well as irregular regions (such as in the NYC street scene below). The one small detail that still isn’t perfect is the transitions between the blur levels, but at this point it’s barely noticeable. If I were to continue working on this, I’d add more features such as adjustable regions and feathering between the blurs.

My Images


Images from Web: Declan McCullagh


New York Soho City Street

Bay Bridge at Night