如何使用 Mono 和 C# 从video-4-linux设备(例如:/dev/video0)捕获帧?操作系统是运行在BeagleBoard上的Angstrom Linux。
3 回答
I have done v4l2 capture using C. This is probably the only language I would chose to do it in as well. There are a lot of low level calls you need to make into the driver. You need to map kernel memory into your app and copy buffers. You also have to set a ton of configuration for the device. If you need to I would consider writing a C library and using Platform Invoke. Another alternative is to write two programs and send the data over to your C# app via some sort of IPC.
您可以为此使用 Emgu CV,它特别宣传它可以使用 Mono 编译。
主站点:http:
//www.emgu.com/wiki/index.php/Main_Page 在 Mono 中编译 : http
:
//www.emgu.com/wiki/index.php/Compiling_with_Monodevelop 用于捕获网络摄像头视频的示例代码:http: //www.emgu.com/wiki/index.php/Camera_Capture_in_7_lines_of_code
我不熟悉 linux 上的 Mono 或 C#,但您可能必须编写一个接口模块来公开潜水员 API,或者一个合理的抽象。我认为您可能能够在 C# 代码中导入模块。看起来 Mono 确实支持 DLLImport。