Python implementation of seam carving image retargeting algorithm