Trinocular camera self-calibration based on spatio-temporal multi-layer optimization