O'Reilly logo

Emgu CV Essentials by Shin Shi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Camera captures

In the previous chapters, we have learned how to load, process, and save images with Emgu CV and .NET controls in our project. In this section, we are going to use the video camera of our computer to capture an image.

Create a new project, add the using statement in the beginning, and insert the following lines of code in the Csharp file:

public partial class Form1 : Form { //Frame Image<Bgr, byte> current; //Webcam Capture webcam = new Capture(); public Form1() { InitializeComponent(); } //Start button private void button1_Click(object sender, EventArgs e) { //run until close Application.Idle += new EventHandler(processCamera); } private void processCamera(object sender, EventArgs e) { current = webcam.QueryFrame(); // Flip because ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required