High Depth of Field - Project 2

by @im_a_muppet on June 16, 2007

Project Description In this assignment, you will combine multiple pictures to create a high depth of field image. Optionally you will create special effects.

  • Change depth of field

  • Change orientation of slab of focus

  • Full Discription
    My Solution Taking the following images as input I calculated the variance in each pixel over each image. For each pixel I use the one from the image with the max variance for my final image.

    Input Images (given data set)
    Note: Right click on any image (ctrl-click on mac) to view its full size

    SimpleViewer requires Macromedia Flash.Get Macromedia Flash.
    If you have Flash installed,

    This is the resulting image where all the image is in focus. You will notice that it is not as crisp as the example given in the photomontage paper.

    result

    Here is the color map of the input images as they are used. The bar on the right shows the colors for image 1 through 13

    result

    Input Images (my data set)

    input 1

    input 2

    This is the resulting image where all the image is in focus. If you view the full size image you will notice many artifacts (noise like) in the image. This is because when the camera refocuses it also zooms a little, changing the location of the objects.

    result

    Here is the color map of the input images as they are used. The bar on the right shows the colors for image 1 through 13

    result

    Special Effect 1

    To create the effect of a larger depth of field than any input image (but shorter than the above result) I first created an image that was completely blurry. Then similar to the above solution I take the in focus pixels from the images that will be in the defined depth and the remaining from the blurry image. For example images 5, 6, 7, 8 and 9. This gives me a depth of field larger that any input image.

    The blurry image

    result

    The result

    result

    Special Effect 2
    To have a change of focus along an angel or slab I take a slice from each of the input image. So the right of the image will be in focus near the front and as you move from right to left the focus shifts from front to back.

    The result

    result

    I wrote this code in matlab to get the above results.

    blog comments powered by Disqus
    Tweet