我正在使用emgu CV & C#,并在捕获/显示网络摄像头视频时获得低FPS(约8fps)!到目前为止,这是我所尝试的: 我必须应用一些过滤器,我怎样才能让我的代码更有效率? 有什么办法来使用GPU来处理这些帧?如何提高摄像头视频输入的帧速率? Emgu CV
private Capture _capture;
private bool _captureInProgress;
private Image<Bgr, Byte> frame;
private void ProcessFrame(object sender, EventArgs arg)
{
frame = _capture.QueryFrame();
captureImageBox.Image = frame;
}
private void startToolStripMenuItem_Click(object sender, EventArgs e)
{
#region if capture is not created, create it now
if (_capture == null)
{
try
{
_capture = new Capture();
}
catch (NullReferenceException excpt)
{
MessageBox.Show(excpt.Message);
}
}
#endregion
Application.Idle += ProcessFrame;
if (_capture != null)
{
if (_captureInProgress)
{
//stop the capture
startToolStripMenuItem.Text = "Start";
Application.Idle -= ProcessFrame;
}
else
{
//start the capture
startToolStripMenuItem.Text = "Stop";
Application.Idle += ProcessFrame;
}
_captureInProgress = !_captureInProgress;
}
}
您是否检查过此网址:http://www.emgu.com/forum/viewtopic.php?f=7&t=2602? –
是的!但它不起作用! :/ – SparkWerk
@Umair是否仍然是一个问题?您发布的代码似乎什么都不做,只是从网络摄像头获取帧而不做任何进一步处理。你能发布更多的代码和你的摄像头的类型? – codingadventures