Camera Capture Using Emgu CV And C#

Accessing the camera is one of the fun parts of C# programming. Well there are various ways of accessing camera of your system, using C#. One of the best way is to use Emgu CV library. Emgu CV is a wrapper of the very popular library openCV. Basically openCV is a library for image processing but this library is available for C/C++. Emgu CV is a wrapper to this OpenCV library. With Emgu CV, all the functions of OpenCV are avalable to C#. Since Emgu CV is an image processing library, one of the basic functionality that this library provides is accessing the camera. 
 
You can access the camera of your system using VideoCapture class available in the library. You can code it, as shown below.

VideoCapture capture = new VideoCapture 

Obiviously the code statement should be under try - catch block. The class constructor throws NullReferenceException, if it is unable to access the camera due to some reason. Afterwards, all you have to do is to get the video feed in a frame and direct it towards the image box. 

I have developed a program to access the camera as well as converting the video feed into Gray scale mode (Black and White mode). Please feel free to comment. If you are interested in the code, please follow the link Camera Capture using Emgu CV and C#