将ARToolkit标记跟踪添加到Tango中 [英] Adding ARToolkit Marker tracking into Tango

查看:113
本文介绍了将ARToolkit标记跟踪添加到Tango中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试将 ARToolkit 标记对象跟踪集成到 Tango应用程序中。

I have been trying to integrate ARToolkit Marker Object tracking into a Tango Application.

到目前为止,我已经创建了一个构建,以便探戈应用可以访问和使用ARToolkit本机库或ARToolkit Unity包装器。
但是,它们似乎都需要在默认配置下才能独占访问摄像机。

So far I have created a build so that a tango app can access and use the ARToolkit Native Library or the ARToolkit Unity wrappers. However, they both seem to require exclusive access to the camera in their default configurations.

如何将相同的Android视频供稿提供给两个库?


  • 您能否创建一个虚拟摄像头设备,将馈送翻倍?

  • 您是否可以像往常一样使用探戈feed,然后使用特殊的 VideoConf

  • Could you create a dummy camera device which doubles out the feed?
  • Could you take the tango feed as normal, and then resend it into ARToolkit with a special VideoConf

[edit]

ARToolkit使用较旧的Camera1 API,接受onPreviewFrame()回调并将该byte []数据传递给它自己的本机库调用,该调用可以完成实际工作。

[edit]
ARToolkit uses the older Camera1 API, takes a onPreviewFrame() callback and passes that byte[] data to it's own Native Library call, which does the actual work.

第二个要点的线条,Tango可以使用 iTangoVideoOverlay

(ARToolkits NDK功能似乎需要NV21,但也可以接受其他格式

Along the lines of the second bullet point, could Tango provide a copy of each frames raw camera data using something like iTangoVideoOverlay .
(ARToolkits NDK functionality seems to expect NV21, but can also accept other formats)

如果该数据可从探戈中提取,我相信ARToolkit无需实际拥有照相机即可使用NDK功能。

If that data was extractable from tango, I believe the ARToolkit NDK functionality can be used without actually owning the camera.

推荐答案

博客显示了将两者整合的示例。

This blog shows an example integrating the two.

它也链接到示例源代码,但是经过测试,我还没有整理过所有内容-请谨慎操作!

It also links to example source code, but I haven't tidied it up at all after testing - proceed with caution!

您不能将相同的相机源提供给两个库(第一个要点),但是可以从Tango转发相机源( ITangoVideoOverlay 放入ARToolkit([AcceptVideoImage] [2])(第二个要点)。

这不是理想的,因为从C#向Java发送数据效率很低。 Phab 2 Pro必须对视频X4进行下采样才能获得不错的帧率。

更好的答案是用管道/套接字代替AndroidJavaClass调用。
还有很多小问题-这是一个非常棘手的解决方法。

You cannot feed the same camera source to both libraries (first bullet point), but you can forward the camera feed from Tango (ITangoVideoOverlay) into ARToolkit ([AcceptVideoImage][2]) (second bullet point).
This is not ideal, because it is fairly inefficient to send the data to Java from C#. The Phab 2 Pro has to downsample the video X4 to achieve a decent framerate.
A better answer would replace the AndroidJavaClass calls with pipes/sockets. Also there are many little problems - it's a pretty hacky workaround.

这篇关于将ARToolkit标记跟踪添加到Tango中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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