15463 Project 2
Minjae Lee (minjaele)
Instructions
Run dp.m (Filename), (Vertical or Horizontal), (Pixels) to seam-carve images
- Parameters: Filename indicates image file, Vertical or Horizontal flag determines whether to seam image vertically(1) or horizontally(0), Pixels indicates how many pixels to seam
Comments
Used dynamic programming, and slightly improved gradient function to compute energy table
Energy function calculates gradient of r, g, b separately and sum them up to have final energy table
Then, compute the dp according to our energy table
And after cropping a pixel for each r, g, b, merge them together to produce final image
dp.m : handles image loading, and case handling to differentiate vertical seam or horizontal seam
dp_c.m : actual dp happens here
energy_fun.m : allocates r, g, b to another energy helper
energy_fun_c.m : computes energy
minfinder.m : finds index with minimum energy
Bells & Whistles
N/A
Result
Classical Examples
Brilliant Outcomes
A masterpiece from takashi murakami!
Two beautiful, and artificial scenes from 5cm/s
A work from japanese cartoonist. I forgot his name
Just some imgs from net
Korean style of artwork. Pay attention to well-preserved chinese character
Brilliant Mistakes
Dogs and pan are damaged by the algorithm (Hands are pretty close though)
I think it is because dogs' size and scale is important as well as hand and chopstick, so program somewhat determines which part to suffer from seamcarving, and it is doggy.
The girl's head evaporates, and her facial expression becomes er... more intensive. I think the reason why seamcarving did not delete some portion of her legs is because of the letter.