An implementation of seam carving for content aware resizing from Avidan and Shamir 2007