Ejemplo n.º 1
0
        static void ParseTrackingFile()
        {
            TrackFileParser    tfParser = new TrackFileParser(trackFilepath);
            ICameraTrackSolver solver   = null;

            tfParser.Parse();

            switch (tfParser.TrackFileType)
            {
            case TrackFileParser.CameraTrackerType.RL_DEFAULT:
                solver = new RLCameraTrackSolver(tfParser, fps);
                break;

            case TrackFileParser.CameraTrackerType.GAM_DEFAULT:
            case TrackFileParser.CameraTrackerType.GAM_NATIVE:
                solver = new GAMCameraTrackSolver(tfParser, fps);
                break;

            default:
                throw new CameraTrackException("Unsupported tracker type");
            }

            solver.Solve();
            solver.WriteChanFile(chanFilepath);
#if DEBUG
            solver.WriteSensorDataFiles(chanFilepath);
#endif
        }
Ejemplo n.º 2
0
        public AbstractTrackSolver(TrackFileParser tfParser, double fps)
        {
            if (!tfParser.Parsed)
            {
                tfParser.Parse();
            }

            if (Array.IndexOf(this.GetSupportedTrackFileTypes(), tfParser.TrackFileType) == -1)
            {
                throw new CameraTrackException("Incompatible track file type");
            }

            this.sensorData     = tfParser.SensorData;
            this.solverData     = new Dictionary <ulong, SolverFrame>(tfParser.SensorData.Count / 2);
            this.chanFrames     = new HashSet <ChanFrame>();
            this.fps            = fps;
            this.nsPerFrame     = 1e9 / this.fps;
            this.firstTimestamp = this.sensorData.Values[0].Timestamp;
        }