I implement the dynamic programming algorithm described in the seam carving paper. The implementation follows the paper exactly. I do not implement the part where users can edit the energy field. Image enlarging seems to be glossed over in the paper. My algorithm enlarges an image by selecting k seams out of nk smallest seams (n = 1, 2, 3, etc). When tracing back the k seams, if any two of them “merge” at some stage, I push them further away from each other. This is to prevent the stretching effect when the k seams are very close to one another.

References:

Seam carving for content-aware image resizing
Shai Avidan, Ariel Shamir
ACM Transactions on Graphics (TOG) - Proceedings of ACM SIGGRAPH 2007, Volume 26 Issue 3, July 2007, Article No. 10 
