统一获取探戈设备主摄像头图像

时间:2016-12-21 08:27:58

标签: camera unity5 google-project-tango tango

在我的项目中,我正在捕捉点云,并基于此我创建了一个二元模板,我想将其应用于Tango平板主摄像头拍摄的图像,以便最终图像是检测到的点云点的剪切

我尝试使用探戈示例来获取相机图像,以便进行进一步的后期处理,但我没有成功。 (临时黑客包括用于渲染纹理的相机,然后将蒙版着色器应用于渲染)

在Unity中获取探戈主相机图像的最简单方法是什么?

1 个答案:

答案 0 :(得分:1)

看看VideoOverlayProvider.cs文件,有两个静态方法SetCallback(..)听起来像你在寻找:

    /// Connect a callback to a camera for access to the pixels.
    /// 
    /// This is not recommended for display but for applications requiring access to the
    /// <code>HAL_PIXEL_FORMAT_YV12</code> pixel data.  The camera is selected via TangoCameraId.  Currently only 
    /// <code>TANGO_CAMERA_COLOR</code> and <code>TANGO_CAMERA_FISHEYE</code> are supported.
    /// 
    /// The <i>onImageAvailable</i> callback will be called when a new frame is available from the camera. The
    /// Enable Video Overlay option must be enabled for this to succeed.
    ///
    /// Note: The first scan-line of the color image is reserved for metadata instead of image pixels.

您可以访问TANGO_CAMERA_COLOR相机和TANGO_CAMERA_FISHEYE相机相框