An integrated framework for video surveillance in complex environments