Segmentation-based spatially adaptive motion blur removal and its application to surveillance systems