motion detection based on image segmentation