Tracking and stabilizing motion