从ZigJS访问Kinect的RGB图像数据 [英] Access Kinect RGB image data from ZigJS

查看:144
本文介绍了从ZigJS访问Kinect的RGB图像数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在浏览器中运行ZigJS,一切运作良好,但我想,以发挥他们回来为录制的视频录制的摄像头Kinect的图像。我已经通过的文​​件看 http://zigfu.com/apidoc/ 却找不到任何有关在RGB信息。

I have ZigJS running in the browser and everything is working well, but I want to record the Kinect webcam images in order to play them back as a recorded video. I've looked through the documentation at http://zigfu.com/apidoc/ but cannot find anything related to the RGB information.

不过,这SO回答让我相信这是可能的:

However, this SO answer leads me to believe this is possible:

我们也支持的深度和RGB图像转换为画布对象的序列化的浏览器

We also support serialization of the depth and RGB image into canvas objects in the browser

是否有可能从ZigJS捕捉RGB图像数据如果又如何?

Is it possible to capture the RGB image data from ZigJS and if so how?

推荐答案

假设你有插件版本0.9.7,沿着线的东西:

Assuming you have plugin version 0.9.7, something along the lines of:

var plugin = document.getElementById("ZigPlugin"); // the <object> element
plugin.requestStreams(false, true, false); // tell the plugin to update the RGB image
plugin.addEventListener("NewFrame", function() { // triggered every new kinect frame
    var rgbImage = Base64.decode(plugin.imageMap);
    // plugin.imageMapResolution stores the resolution, right now hard-coded
    // to QQVGA (160x120 for CPU-usage reasons)
    // do stuff with the image
}

另外,我建议您采取的base64德codeR我写的,比如说,从的http:// motionos。 COM / WebGL的,因为它是一个数量级比随机的JavaScript德codeRS我通过谷歌找到更快。

Also, I recommend you take the base64 decoder I wrote, from, say, http://motionos.com/webgl because it's an order of magnitude faster than the random javascript decoders I found via Google.

如果你有插件的版本0.9.8,有一个API的变化,所以你应该叫:

If you have version 0.9.8 of the plugin, there was an API change, so you should call:

plugin.requestStreams({updateImage:true});

这篇关于从ZigJS访问Kinect的RGB图像数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆