Optimization and Filtering for Human Motion Capture A Multi-Layer Framework