Matlab implementation of SeamCarving