Background and foreground modeling using nonparametric kernel density estimation for visual surveillance