Dynamic Foreground/Background Extraction from Images and Videos using Random Patches