【问题标题】:Obtain tango device main camera image in unityunity获取tango设备主摄像头图像
【发布时间】:2016-12-26 19:33:03
【问题描述】:
在我的项目中,我正在捕获点云,并在此基础上创建一个二进制掩码,我想将其应用于从 Tango 平板电脑主摄像头捕获的图像,以便最终图像是检测到的点云点的剪切.
我尝试使用探戈示例获取相机图像,以便进行进一步的后处理,但没有成功。 (临时 hack 包括一个用于渲染纹理的相机,然后将遮罩着色器应用于渲染)
在Unity中获取tango主摄像头图像最简单的方法是什么?
【问题讨论】:
标签:
camera
unity5
google-project-tango
tango
【解决方案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 相机帧