Statistics for Foreground discovery in streaming videos with dynamic construction of content graphs