核心代码
Mat src = new Mat();
FrameSource frame = Cv2.CreateFrameSource_Camera(0);
while (_IsPlay)
{
frame.NextFrame(src);
if (src.Empty())
{
break;
}
this.pictureBox_show.Invoke(new Action(() =>
{
pictureBox_show.Image = BitmapConverter.ToBitmap(src);
}));
Thread.Sleep(10);
}
效果
具体代码进以下网址进行查看: