Learning switching dynamic models for objects tracking