Before | After |
---|---|
|
|
|
|
|
|
|
|
Horizontal seam removal: 90 rows
|
|
|
|
And here are some failures... I classified these as failures because I did not consider the resizing to be that content aware. For example, faces were either disproportional, vertical/horizontal lines in the image were not maintained properly, or there were noticable artifacts that would make your head scratch if you saw the image for the first time.
Vertical seam removal: 150 columns
Before | After |
---|---|
|
|
|
|
|
|
|
|
Horizontal seam removal: 90 rows
|
|
|
|
The most important thing I learned in this project was how innovative even simple ideas are. The dynamic programming algorithm is very intuitive and therefore makes sense why it is a good approach at solving this resizing issue. While the algorithm I implemented was the naive version and could use improvements and optimizations, it's great that it could already provide me some successful results.
The goal of this section is to refous at different depths afer taking the photos. I used the image set from
the Stanford Lightfield Archive where images were taken from a 17x17 camera grid setup. Thus, each camera would
produce images of the object from various angels.
The overarching idea of implementing depth refocusing is to first
fix the coordinate location of a center image (in this case the coordinates of the middle camera at position (8,8), shift all other images to the
center coordinates, and finally average the photos all together. To simulate varied focal lengths, I used an alpha value 'c'
to adjust the shift offest. The equation I used to calculate the u,v shifts in the respective x,y directions was (u, v) = c * (cu - x, cv - y),
where x and y are the coordinates of the current image, cu and cv are the coordinates of the center image, and c is the alpha constant.
Here are some examples of depth refocusing at different values of c.
c = -0.6 |
c = -0.2 |
c = 0 |
Here's a gif of the chess image with c = [-0.6, 0].
Here's some more examples on images of a crystal ball.
c = -0.6 |
c = -0.2 |
c = 0.4 |
Here's a gif of the crystal ball image with c = [-0.6, 0.6].
This section plays around with simulating different aperture sizes. I used the implementation of shifting and averaging images in part 1 but this time with one limitation: radius. If sqrt(u**2 + v**2) < r, where u and v are the x,y offsets from the center image, and r is the aperture radius, then we include the current image in the subset of images to shift and average. With greater r, we can sample more images from different angles, letting more light enter the lens, simulating a greater aperture radius.
Here are some examples of aperture adjustment at different values of r.
r = 1 |
r = 5 |
r = 10 |
Here's a gif of the chess image with r = [1, 10].
Here's some more examples on images of a crystal ball.
r = 1 |
r = 5 |
r = 10 |
Here's a gif of the crystal ball image with r = [1, 10].