gpt4 book ai didi

c# - 如何使用网络摄像头捕捉图像?

转载 作者:太空宇宙 更新时间:2023-11-03 16:20:56 25 4
gpt4 key购买 nike

我想用网络摄像头捕捉图像。

我使用 WebCam_Capture.dll。我在表单中添加了一个 WebCamCapture 控件。

当表单加载时:

private void Form1_Load(object sender, EventArgs e)
{
this.WebCamCapture.TimeToCapture_milliseconds = 1;
WebCamCapture.Start(0);
}

在 ImageCaptured 事件中:

private void WebCamCapture_ImageCaptured(object source, 
WebCam_Capture.WebcamEventArgs e)
{
this.pictureBox1.Image = e.WebCamImage;
}

但是当我运行时,出现错误:

An error ocurred while capturing the video image. The video capture will now be terminated.

Object reference not set to an instance of an object.

最佳答案

我建议您使用 OpenCV 库。它是intel开发的用于intel图像处理的开源库。但是,它有一个 .net 包装器,您可以从以下位置下载此包装器:this link

关于c# - 如何使用网络摄像头捕捉图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13909106/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com