Webcam usage in C#

后端 未结 6 1787
孤城傲影
孤城傲影 2020-12-01 02:36

I am making a program in C# to connect to a webcam and do some image manipulation with it. I have a working application that uses win32 api (avicap32.dll) to connect to the

6条回答
  •  伪装坚强ぢ
    2020-12-01 02:51

    I've recently started doing some hobby work in this area.

    We settled on using the OpenCV library with the opencvdotnet wrapper. It supports capturing frames from a webcam:

    using (var cv = new OpenCVDotNet.CVCapture(0))
    {
        var image = cv.CreateCompatibleImage();
        // ...
        cv.Release();
    }
    

    And if you're doing image manipulation, OpenCV's image processing algorithms have been wrapped within the OpenCVDotNet.Algs assembly.

    If you decide to go this route be sure to install OpenCV version 1.0 (and install it to "c:\program files\opencv" if you are on Vista 64-bit, or "mklink OpenCV 'c:\program files (x86)\OpenCV`" from the correct directory or else opencvdotnet will not install).

提交回复
热议问题