implement compact superpixel