13

Does .NET have a native support for getting input from webcam?
If not, what is the best/recommended way to get input from webcam using C#/.NET?

codingbear
  • 14,773
  • 20
  • 48
  • 64

4 Answers4

5

.NET does not have a native support for webcams. You can use OpenCV library. Also a .NET wrapper exists for OpenCV - Emgu CV.

Centro
  • 3,892
  • 2
  • 25
  • 31
  • 1
    Just tried this. Seems to work except that it seems to require 1gb of additional files which is a non-solution for me. – teynon Apr 07 '14 at 19:09
2

This was also asked in How to get web cam images in C#? and you might find the following useful:

I've just released the complete sourcecode of my Windows app CamTimer (written in .NET/C#). Download/view the complete code (with working Webcam examples) at https://github.com/johanssonrobotics/CamTimer

Happy coding!

Community
  • 1
  • 1
Fredrik Johansson
  • 3,477
  • 23
  • 37
2

There is also an SDK called MetriCam. It is supposed for Kinect and Time-of-Flight cameras, but also supports webcams. You can download it for free at http://www.metricam.net

It includes samples and tutorials how to integrate a DirectShow webcam into C#/.NET The webcam tutorial can be watched here: http://www.youtube.com/watch?v=BvnRpby8mSE

2

You might like to look at the easywebcam codeplex project:

http://easywebcam.codeplex.com/

On the other hand, the "native" option is to develop this using DirectShow. However, there is no (as far as I know), official managed interface for DirectShow, so it can have a steep learning curve to develop with.

Tim Ebenezer
  • 2,714
  • 17
  • 23