Ejemplo n.º 1
0
        private void ProcessTracks()
        {
            if (SourceTracks != null)
            {
                _trackProcessor.KalmanEnabled  = Filtering;
                _trackProcessor.StopsDetection = StopsDetection;
                _trackProcessor.SpikeDetection = SpikeDetection;
                Tracks.Clear();
                Tracks.AddRange(SourceTracks);

                FilterResult      = _trackProcessor.ProcessTracks(SourceTracks);
                FilterResult.Name = "Result";
                Tracks.Add(FilterResult);
            }
        }
Ejemplo n.º 2
0
        public void TestMeasuring()
        {
            var worker  = new TrackXmlWorker();
            var precise = worker.ReadTracks("../../../../../data/analysis/precise.xml");
            var actual  = worker.ReadTracks("../../../../../data/analysis/actual.xml");
            var filter  = new TrackProcessor()
            {
                StopsDetection = false, SpikeDetection = false
            };
            var result        = filter.ProcessTracks(actual);
            var analyzer      = new Analyzer();
            var analysis      = analyzer.Analyze(actual.First().Coordinates, result.Coordinates, precise.First().Coordinates);
            var sourceAverage = analysis.Average(a => a.SourceDerivation);
            var resultAverage = analysis.Average(a => a.ResultDerivation);
            var sourceMin     = analysis.Min(a => a.SourceDerivation);
            var resultMin     = analysis.Min(a => a.ResultDerivation);

            var sourceMax = analysis.Max(a => a.SourceDerivation);
            var resultMax = analysis.Max(a => a.ResultDerivation);
        }
Ejemplo n.º 3
0
        private void PerformAnalysis()
        {
            var result   = _trackProcessor.ProcessTrack(_actualTrack);
            var analysis = _analyzer.Analyze(_actualTrack.Coordinates, result.Coordinates, _referenceTrack.Coordinates);

            Tracks.Clear();
            _referenceTrack.Color = Colors.DarkBlue;
            _actualTrack.Color    = Colors.SeaGreen;
            result.Color          = Colors.Red;
            Tracks.Add(result);
            Tracks.Add(_referenceTrack);
            Tracks.Add(_actualTrack);

            var fullProcessor    = new TrackProcessor();
            var fullResult       = fullProcessor.ProcessTracks(_tracks);
            var trackDerivations =
                _tracks.Select(t => _analyzer.Derivations(t.Coordinates, _referenceTrack.Coordinates)).ToList();
            var fullResultDerivations =
                _analyzer.Derivations(fullResult.Coordinates, _referenceTrack.Coordinates).ToList();
            var sourceDerivations = new LineSeries();

            sourceDerivations.Points.AddRange(analysis.Select((a, i) => new DataPoint(i, a.SourceDerivation)));
            sourceDerivations.Color = _actualTrack.Color.ToOxyColor();
            var resultDerivations = new LineSeries();

            resultDerivations.Points.AddRange(analysis.Select((a, i) => new DataPoint(i, a.ResultDerivation)));
            resultDerivations.Color = result.Color.ToOxyColor();

            SourceAverage  = trackDerivations.SelectMany(s => s).Average() * ToMeters;
            SourceVariance = trackDerivations.SelectMany(s => s).StandardDeviation() * ToMeters;
            ResultAverage  = fullResultDerivations.Average() * ToMeters;
            ResultVariance = fullResultDerivations.StandardDeviation() * ToMeters;
            Plot.Series.Clear();
            Plot.Series.Add(sourceDerivations);
            Plot.Series.Add(resultDerivations);
        }