Layered Graphical Models for Tracking Partially Occluded Objects