This is a simple implementation of seam carving. It is not optimized for performance and is not a real-time implementation. It is a proof of concept.
The algorithm is based on the paper Seam Carving for Content-Aware Image Resizing by Shai Avidan and Ariel Shamir.