A .NET library for camera easy use via DirectShow
NOTE: There is an article on CodeProject.com about Camera Net library and some additional information. Take a look.
Features of the library:
- Select camera
- Select resolution
- Show camera's output
- Overlay image on the frame
- Take snapshots of the frame
- Change TV mode (PAL, NTSC, etc.)
- Display dialog windows of the camera (from drivers)
- Get a list of available cameras and resolutions
- Support WinForms and WPF applications
About the library
The library was created because I've failed to find a library among dozens of open source solutions that would support what I wanted: easy use of camera as a component, ability to change the camera resolution, take frame snapshots, show overlay images over the frame.
The main classes in the library are CameraControl and Camera. CameraControl is a UserControl-wrapper for Camera class, easy to use out of box. This approach is recommended. The library includes two samples of use in WinForms, in particular an example of a simple implementation of the component in your application, and more complicated example that shows almost all features of the library. Camera is an object for interaction with cameras.
Additionally there are several public classes: Resolution, VideoInput, camera selection class and etc. The library uses DirectShowLib (license LGPL 2.1 or later), which is a very thin wrapper of DirectX COM-interfaces, so that the losses of productivity from the use of managed code instead of the native one are minimal.
DirectShow is MS Windows only, so the library is also available only for Windows.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
While the Camera_Net library is covered by LGPL, the samples are released as PUBLIC DOMAIN. So, you can use code from these samples in your free or proprietary project without any limitations.
Links to related open source projects:
- DirectShow.NET – CodeProject
- DirectX.Capture Class Library – CodeProject
- Aforge.NET – Computer Vision, Artificial Intelligence, Robotics
- Touchless SDK – Codeplex
- Emgu CV: OpenCV in .NET
- OpenCV | OpenCV
- Image Processing Lab in C# – CodeProject
- Versatile WebCam C# library – CodeProject
- Camera Vision (video surveillance on C#) – CodeProject