Example #1
0
        private void OnPotentialIntegration(PotentialIntegrationFit fit)
        {
            if (m_RecordPixelFile)
            {
                m_PixDetFile.WriteFooter(fit.Interval, fit.StartingAtFrame, fit.Certainty, fit.AboveSigmaRatio);
                m_PixDetFile.Dispose();
            }

            if (m_ExpectedFit != null)
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine();
                Console.WriteLine("[Integration Detection] " + m_VideoFileName);

                Console.ForegroundColor = m_ExpectedFit.Interval == fit.Interval ? ConsoleColor.Green : ConsoleColor.Red;
                Console.WriteLine("[Detected Interval] Expected:{0} Actual:{1}", m_ExpectedFit.Interval, fit.Interval);

                Console.ForegroundColor = m_ExpectedFit.StartingAtFrame == fit.StartingAtFrame ? ConsoleColor.Green : ConsoleColor.Red;
                Console.WriteLine("[Starting At Frame] Expected:{0} Actual:{1}", m_ExpectedFit.StartingAtFrame, fit.StartingAtFrame);

                Console.ForegroundColor = Math.Abs(m_ExpectedFit.Certainty - fit.Certainty) < 0.1 ? ConsoleColor.Green : ConsoleColor.Red;
                Console.WriteLine("[Certainty] Expected:{0} Actual:{1}", m_ExpectedFit.Certainty, fit.Certainty);

                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine();
            }
            else
            {
                // TODO: Console.Write (green = detected; red = failed to detect)
            }

            m_RunFinished.Set();
        }