Human Machine Collaboration For Foreground Segmentation In Images And Videos