private static void Debug() { Stopwatch stop = new Stopwatch(); Console.WriteLine("Running System Debug..."); Console.WriteLine("Press any key to capture background image"); Console.ReadKey(); ImageHandler.CaptureImage("background.bmp"); if (File.Exists("background.bmp")) { Console.WriteLine("Background Image set"); } Console.WriteLine("Press any key to capture foreground image"); Console.ReadKey(); ImageHandler.CaptureImage("foreground.bmp"); if (File.Exists("foreground.bmp")) { Console.WriteLine("Foreground image set, ready to process"); } else { Console.WriteLine("Foreground image not found, terminating debug sequence"); return; } Console.WriteLine("Press any key to start image processing sequence"); Console.ReadKey(); stop.Start(); Program.StartProgram("background.bmp", "foreground.bmp", "debugOutput.bmp", minBlobSize); stop.Stop(); Console.WriteLine(" Debugging time: " + stop.ElapsedMilliseconds + " Milliseconds"); Console.WriteLine("\nDebugging complete.."); }
private static void SetBackground() { Console.WriteLine("Press any key to take a picture"); var input = Console.ReadLine(); if (File.Exists("background.bmp")) { File.Delete("background.bmp"); } ImageHandler.CaptureImage("background.bmp"); Program.backgroundImage = ImageHandler.LoadImage("background.bmp"); Console.WriteLine("Background Set"); }