Method and Apparatus for Scale Calibration and Optimization of a Monocular Visual-Inertial Localization System