从CaptureElement&进行实时视频流处理MediaCapture [英] Perform live video stream processing from CaptureElement & MediaCapture
问题描述
在Windows 8 Store Application中,我倾向于执行实时视频流处理(例如,面部检测).
In my Windows 8 Store Application, I tend to perform live video stream processing (Face detection for example).
In my previous Windows 7 application, I was able to use the following technique (Camera Face Detection in C# Using Emgu CV (OpenCV in .NET) and WPF) to perform live video processing. The technique was, having a fixed period timer callback, to actively query image buffer from camera object.
void timer_Tick(object sender, EventArgs e)
{
Image<Bgr,Byte> currentFrame = capture.QueryFrame();
// Perform image processing based on currentFrame
技术2
我以前在 Android 中使用的另一种技术是,我将在相机本身上安装相机缓冲区预览回调.摄像机会通过传递捕获的摄像机缓冲区来定期触发回调.从那里,我可以执行图像处理.
Technique 2
Another technique I had used before in Android is that, I will install a camera buffer preview callback on camera itself. The camera will periodically trigger the callback, by passing along the captured camera buffer. From there, I can perform image processing.
public abstract void onPreviewFrame (byte[] data, Camera camera)
{
// Perform image processing based on data
但是,在有关 Windows 8 Store Application 的视频处理的文章中,它们大多使用内置的处理功能
However, in articles which talks about video processing for Windows 8 Store Application, they are mostly using built-in processing functions
他们都没有演示如何访问原始相机捕获的缓冲区,如何逐像素迭代缓冲区.
我认为我需要利用 CaptureElement&根据
I believe I need to make use of CaptureElement & MediaCapture
according to