2
A
回答
5
您可以使用下面的代码使一个应用程序捕获和显示视频流:
public class CameraCapture
{
private Capture capture; //takes images from camera as image frames
private bool captureInProgress;
private void ProcessFrame(object sender, EventArgs arg)
{
Image<Bgr, Byte> ImageFrame = capture.QueryFrame(); //line 1
CamImageBox.Image = ImageFrame; //line 2
}
private void Form1_Load(object sender, EventArgs e)
{
if (capture == null)
{
try
{
capture = new Capture();
}
catch (NullReferenceException excpt)
{
MessageBox.Show(excpt.Message);
}
}
if (capture != null)
{
if (captureInProgress)
{ //if camera is getting frames then stop the capture and set button Text
// "Start" for resuming capture
btnStart.Text = "Start!"; //
Application.Idle -= ProcessFrame;
}
else
{
//if camera is NOT getting frames then start the capture and set button
// Text to "Stop" for pausing capture
btnStart.Text = "Stop";
Application.Idle += ProcessFrame;
}
captureInProgress = !captureInProgress;
}
}
}
2
不知道你想要什么用数据来做,但是这将让你从相机的单个帧(和在PictureBox显示它在一个WinForm)
private void Form1_Load(object sender, EventArgs e)
{
var capture = new Emgu.CV.Capture();
using (var nextFrame = capture.QueryFrame())
{
if (nextFrame != null)
{
pictureBox1.Image = nextFrame.ToBitmap();
}
}
}
相关问题
- 1. EMGU CV摄像头捕获WPF?
- 2. 如何以角度从网络摄像头获取视频流
- 3. Emgu cv显示摄像头流作为翻转图像
- 4. 如何提高摄像头视频输入的帧速率? Emgu CV
- 5. Emgu摄像头
- 6. 如何在C++中获取摄像头视频流字节
- 7. 从摄像头流到iPhone的视频
- 8. 如何从IP摄像头使用emgucv获取视频
- 9. Emgu CV从视频文件中获取所有帧
- 10. 从Safari摄像头捕获视频
- 11. 从IP摄像头捕获视频
- 12. 摄像头视频流处理
- 13. 从IP摄像头获取流
- 14. 如何流从摄像头的视频到<Image>
- 15. 如何使用vlc从IP摄像头流式传输视频
- 16. 如何从AXIS网络摄像头代理视频流?
- 17. CAOpenGLLayer中的摄像头视频流
- 18. 如何记录多个源摄像头/ IP摄像头视频流?
- 19. 从我的摄像头在WPF中显示一个视频流?
- 20. 如何拍摄有声emgu CV
- 21. Emgu CV检查网络摄像头连接
- 22. 如何通过HTTP从RTSP摄像头获取图像流?
- 23. 如何获取directshow网络摄像头视频流的宽度和高度
- 24. 如何使用Java从网络摄像机获取视频和音频流?
- 25. 如何使用applet从java摄像头捕获视频?
- 26. 如何从avfoundation摄像头获得视频输出
- 27. 如何使用OpenCV从网络摄像头读取视频?
- 28. Python:从交通摄像头获取10分钟视频
- 29. 如何显示用Emgu拍摄的摄像头图像?
- 30. 如何使用emgu CV
出于兴趣。请使用Google或至少访问图书馆的官方网站:http://www.emgu.com/wiki/index.php/Camera_Capture_in_7_lines_of_code –