Matlab Expanding Square Image Segmentation