用外部视频流替换Wikitude ArchitectView中的摄像头流 [英] Replace the camera stream in a Wikitude ArchitectView with an external video stream

查看:438
本文介绍了用外部视频流替换Wikitude ArchitectView中的摄像头流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个面向无人机摄像机视图实时增强可视化的Android移动应用程序(特别是我正在使用带有相对SDK的DJI Phantom 3 Professional).我在AR部分使用Wikitude框架.每个Wikitude样本都可以通过扩展智能手机的摄像头视图来工作,因此我需要重定向输入视频流.在这一阶段,通过使用DJI SDK功能,我有一个TextureView对象,其中包含来自无人机的正确解码的流. 以下是当前视图.xml文件顶部的相对说明:

I'm working on an Android mobile app oriented to the real time augmented visualization of a drone's camera view (specifically I'm working on a DJI Phantom 3 Professional with relative SDK). I'm using Wikitude framework for the AR part. Every Wikitude sample works by augmenting the smartphone's camera view, so I need to redirect the input video stream. At this stage, by using the DJI SDK features, I have a TextureView object containing the correctly decoded stream coming from the drone. The following are the relative instructions on the top of the current view's .xml file:

<TextureView
    android:id="@+id/video_previewer_surface"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:layout_centerHorizontal="true"
    android:layout_above="@+id/linearLayout" />

实际上,Wikitude Architect View由摄像机流的渲染和增强的渲染组成,如下图所示: 建筑师的视图组成

Actually, Wikitude Architect View is composed by the rendering of the camera stream and the rendering of the augmentation, as depicted in the following figure: Architect View Composition

sample_cam.xml文件:

sample_cam.xml file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal">

   <com.wikitude.architect.ArchitectView
      android:id="@+id/architectView"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/>
</LinearLayout>

是否可以用我的 TextureView 的内容替换Wikitude Architect View的当前相机流?

Is there a way to replace the current camera stream of the Wikitude Architect View with the content of my TextureView?

或者,是否有一种方法可以将ArchitectView的相机流设为透明背景,以使该层与 TextureView 层重叠?

Alternatively, is there a way to make the camera stream of the ArchitectView as a transparent background, in order to overlap this layer to the TextureView one?

以下可能是.xml最终文件代码的一部分:

The following could be a portion of the code of the .xml final file:

<TextureView
    android:id="@+id/video_previewer_surface"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:layout_centerHorizontal="true"
    android:layout_above="@+id/linearLayout" />
<com.wikitude.architect.ArchitectView  // with transparent background for camera
   android:id="@+id/architectView"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"/>

推荐答案

您可以实现自己的

You could implement your own Wikitude Input Plugin in combination with dji's Video Stream Decoding. So you get the raw video data from the dji sdk and pass it to the wikitude sdk. A sample code for the Input Plugin can be found in the wikitude sample app with the sample name "Custom Camera".

这篇关于用外部视频流替换Wikitude ArchitectView中的摄像头流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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