public override void ImageGrabbedHandler(object sender, EventArgs e) { using (var matCaptured = new Mat()) { CameraCapture.Retrieve(matCaptured); var input = new CascadeDetectorInput { Captured = matCaptured }; var result = _detector.Process(input); if (result.IsDetected) { Log.Info(m => m("{0}", result)); } } }
public override void ImageGrabbedHandler(object sender, EventArgs e) { using (var matCaptured = new Mat()) { CameraCapture.Retrieve(matCaptured); var input = new CascadeDetectorInput { Captured = matCaptured }; var result = _detector.Process(input); if (result.IsDetected) { Log.Info(m => m("{0}", result)); } } }
public override void ImageGrabbedHandler(object sender, EventArgs e) { using (var matCaptured = new Mat()) { CameraCapture.Retrieve(matCaptured); var input = new CascadeDetectorInput { Captured = matCaptured }; var result = _detector.Process(input); var image = matCaptured.ToImage <Bgr, byte>(); foreach (Rectangle item in result.Objects) { image.Draw(item, new Bgr(Color.Blue), 2); } imageBoxCaptured.Image = image; } }
public override void ImageGrabbedHandler(object sender, EventArgs e) { if (_detector == null) { return; } using (var matCaptured = new Mat()) { CameraCapture.Retrieve(matCaptured); var input = new CascadeDetectorInput {Captured = matCaptured}; input.ClassifierParams = _classiferParams; var result = _detector.Process(input); var image = matCaptured.ToImage<Bgr, byte>(); foreach (Rectangle item in result.Objects) { image.Draw(item, new Bgr(Color.Blue), 2); } imageBoxCaptured.Image = image; } }