Project 1: Seam CarvingΒΆ

For this project, I reimplemented the algorithm mentioned in the paper written by Shai Avidan and Ariel Shamir. The algorithm is an example of dynamic programming that first maps out the values in an image and then finds the least important seam in that image which can be removed from it in order to shrink the image either vertically or horizontally. After running the algorithm on multiple images from the internet, I noticed that landscapes usually tend to have a good transformation while images with prominent objects had something either deformed or out of its original proportion. It was amazing to see some of the flawless outputs!!

Success CasesΒΆ

Input (left), Output (right)

InΒ [32]:
 
InΒ [31]:
 
InΒ [30]:
 
InΒ [33]:
 
InΒ [35]:
 
InΒ [36]:
 
InΒ [37]:
 
InΒ [38]:
 

FailuresΒΆ

Both the dolphins are somewhat deformed

Input (left), Output (right)

InΒ [39]:
 

The roof is clearly deformed

InΒ [42]:
 

The bed frame on the right side is out of shape

InΒ [44]:
 

Bells & WhistleΒΆ

For bells and whistles, I implemented a resize function that I ran before running seam curving, thereby the inputs for seam curving became smaller and allowed it to produce a resized version of an image very quickly. If the input image's dimensions were greater than 500 as mentioned in the project spec, the resize function would be run to fix that while maintaining image integrity and the new dimensions would be used for the input for seam carving.

ConclusionΒΆ

I thoroughly enjoyed working on this project. It was definitely the most interesting and fun project for me and it also helped me understand how dynamic programming works in images.

Project 2: Lightfield CameraΒΆ

For this project, I implemented Depth Refocusing and Aperature Adjustment from the paper Light Field Photography with a Hand-help Plenoptic Camera by Ren Ng et al. and used the rectified dataset of 289 different views of a chess board on a 17 by 17 grid from the Stanford Light Field Archive.

Depth RefocusingΒΆ

For depth refocusing, when we add and average all the images, we see that images closer to the camera are out of focus, while images further away will appear in focus.

Image with scale = 1

InΒ [8]:
 

Image with scale = 4

InΒ [9]:
 

Link to the video:

Aperture AdjustmentΒΆ

The aperture is the hole through which light enters the camera and can be made large or small. A large radius from the center would give us a larger aperture, while a smaller radius from the center would give us a smaller aperture.

Image with radius = 0

InΒ [18]:
 

Image with radius = 4

InΒ [19]:
 

Image with radius = 8

InΒ [20]:
 

Link to the video:

ConclusionΒΆ

This project definitely helped me understand depth and aperture and get a better sense of how a camera works as well as how to click great pictures.