public static void init() { capt = new ModelImageCapture(1000, 2000); capt.CreateImagesForStepMethod(1, 4); while (PhaseImageFactory.phaseImages.Count < 1) { PhaseImageFactory.AddImage(capt.GetImage()); } BufferPhaseImage = PhaseImageFactory.phaseImages.Dequeue(); reserve = (double[, ])BufferPhaseImage.Image.Clone(); }
public void FPS_test2() { count = 0; capt = new ModelImageCapture(5, 5); capt.CreateImagesForStepMethod(1, 4); capt.imageReciever += testReciever1; double FPS = 5; capt.SetMaxFPS(FPS); capt.Start(); DateTime dt1 = DateTime.UtcNow; Thread.Sleep(6000); capt.Stop(); double sec = DateTime.UtcNow.Subtract(dt1).TotalSeconds; double d = count / sec; capt.imageReciever -= testReciever1; Assert.IsTrue(Math.Abs(d - FPS) / FPS < 0.1); count = 0; }