Пример #1
0
        private void RunHwProcess()
        {
            WaitWindow waitWindow = new WaitWindow("Running hardware process");

            waitWindow.Show();
            try
            {
                var hwArgs = CreateHwProcessArgs();
                var hwPath = GetHwAppPath();

                var hwProcessRunner = new ProcessRunner(hwPath, hwArgs, false, GetHwTimePath());

                // set time
                results.ResultHWTime = hwProcessRunner.RunProcess();
                HWTime.Text          = results.ResultHWTime.TotalTime.ToString("g");

                // set output image
                var hwImage = new BitmapImage(new Uri(results.ResultHWDepthMapPath));
                HWResult.Source = hwImage;

                var analyzer = new ResultAnalyzer(results.ResultHWDepthMapPath, results.InputGroundThruthPath);

                // compute rms
                SWBadMatches.Text = analyzer.GetBadMatchesPercentage(tolerance).ToString("F3");

                // compute bad matches
                results.ResultHWRms = analyzer.GetRmsError();
                HWRms.Text          = results.ResultHWRms.ToString("F3");

                results.ResultHWBadMatches = analyzer.GetBadMatchesPercentage(tolerance);
                HWBadMatches.Text          = results.ResultHWBadMatches.ToString("F3");

                // compute speedup
                results.ResultHWSpeedup = results.ResultSWTime.TotalTime.TotalMilliseconds / results.ResultHWTime.TotalTime.TotalMilliseconds;
                HWSpeedup.Text          = results.ResultHWSpeedup.ToString("F3");

                HwResultsGrid.Visibility = Visibility.Visible;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                waitWindow.Close();
            }
        }
Пример #2
0
        private void RunSwProcess()
        {
            WaitWindow waitWindow = new WaitWindow("Running software process");

            waitWindow.Show();
            try
            {
                var swArgs = CreateSwProcessArgs();
                var swPath = GetSwAppPath();

                var swProcessTimer = new ProcessRunner(swPath, swArgs, false, GetSwTimePath());

                // set time
                results.ResultSWTime = swProcessTimer.RunProcess();
                SWTime.Text          = results.ResultSWTime.TotalTime.ToString("g");

                // set output image
                var swImage = new BitmapImage(new Uri(results.ResultSWDepthMapPath));
                SWResult.Source = swImage;

                var analyzer = new ResultAnalyzer(results.ResultSWDepthMapPath, results.InputGroundThruthPath);

                // compute rms
                results.ResultSWRms = analyzer.GetRmsError();
                SWRms.Text          = results.ResultSWRms.ToString("F3");

                // compute bad matches
                results.ResultSWBadMatches = analyzer.GetBadMatchesPercentage(tolerance);
                SWBadMatches.Text          = results.ResultSWBadMatches.ToString("F3");

                SwResultsGrid.Visibility = Visibility.Visible;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                waitWindow.Close();
            }
        }