简体   繁体   English

是否可以从 Android 上的 TOF(飞行时间)传感器读取数据?

[英]Is it possible to read data from TOF (time-of-flight) sensor on Android?

Recent models of Android phones (Honor View 20, Huawei P30 Pro, Samsung Galaxy 10 5g) have TOF (time-of-flight) sensor.最近的 Android 手机型号(Honor View 20、华为 P30 Pro、三星 Galaxy 10 5g)具有 TOF(飞行时间)传感器。 Is it possible to read it through some API or manufacturer SDK?是否可以通过某些 API 或制造商 SDK 读取它?

Possible for Huawei using AR Engine SDK华为可以使用 AR Engine SDK

https://developer.huawei.com/consumer/en/ar https://developer.huawei.com/consumer/en/ar

Excerpt of SDK Document AREnginesdk-sample-2.0.0.6\\HUAWEI AR Engine Function Manual.doc SDK文档摘录AREnginesdk-sample-2.0.0.6\\HUAWEI AR Engine Function Manual.doc

4.13 Scene mesh 4.13 场景网格
Huawei AR Engine provides real-time output scene mesh capability.华为AR Engine提供实时输出场景网格能力。 The output includes the pose of the mobile phone in space.输出包括手机在空间中的姿势。 The 3D mesh of the current camera view only supports the specified Huawei models(Honor V20、P30Pro) that can obtain depth information, and the supported scanning scene is static.当前摄像头视图的3D网格仅支持指定的可以获取深度信息的华为机型(荣耀V20、P30Pro),支持的扫描场景为静态。

Excerpt of SDK Document AREnginesdk-sample-2.0.0.6\\java\\HUAWEI AR Engine SDK Interface Manual.docx SDK文档摘录AREnginesdk-sample-2.0.0.6\\java\\HUAWEI AR Engine SDK Interface Manual.docx

2.2.1.18.   ARSceneMesh
•   Description: The class used to return the tracking result when the environment Mesh is tracked. The result includes the Mesh vertex coordinates, the triangle subscript, and so on.
•   Methods: 
public ShortBuffer getSceneDepth()
        // Get the depth image of current frame(optimized).
public int getSceneDepthHeight()
        // Get the height of the depth image.
public int getSceneDepthWidth()
        // Get the width of the depth image.


Possible on Huawei usinga camera2 API华为可能使用camera2 API

https://github.com/google-ar/arcore-android-sdk/issues/120#issuecomment-535413944 https://github.com/google-ar/arcore-android-sdk/issues/120#issuecomment-535413944

This issue in ARCore contains a lot of information! ARCore中的这个issue包含了很多信息!

Also seems to be possible on S10 5G, but currently not on Note 10+在 S10 5G 上似乎也有可能,但目前在 Note 10+ 上不可用

Excerpt of Night Vision / ToF Viewer app description : 夜视 / ToF 查看器应用程序说明摘录:

This app is currently working only on Huawei P30 Pro, Honor View 20 and Samsung S10 5G.此应用目前仅适用于华为 P30 Pro、Honor View 20 和三星 S10 5G。 More devices will start working by future device software updates.更多的设备将通过未来的设备软件更新开始工作。

New features新功能

  • compatibility for Samsung S10 5G added (and maybe for other devices)添加了对三星 S10 5G 的兼容性(也可能适用于其他设备)
  • resolution dialog removed分辨率对话框已删除
  • support for front facing removed移除正面支撑

Note: There was done a big research for Samsung Note10+ support, however this device does not seem to support ToF for 3rd party apps.注意:对三星 Note10+ 支持进行了大量研究,但是该设备似乎不支持第三方应用程序的 ToF。


Another interesting app:另一个有趣的应用程序:

3D scanner app using Huawei ToF sensors https://play.google.com/store/apps/details?id=com.lvonasek.arcore3dscannerpro使用华为 ToF 传感器的 3D 扫描仪应用https://play.google.com/store/apps/details?id=com.lvonasek.arcore3dscannerpro

Android does include OS level APIs to interact with non-traditional visual cameras. Android 确实包含操作系统级 API 来与非传统视觉相机进行交互。 For Samsung S10 5G for example, you can access the camera with the Camera2 API and get a DEPTH16 frame directly.以三星S10 5G为例,可以通过Camera2 API访问摄像头,直接获取DEPTH16帧。 Here is an example: https://medium.com/swlh/working-with-the-3d-camera-on-the-samsung-s10-5g-4782336783c This works with all the Samsung devices, though the example only uses the front-facing ToF camera on the S10 5G.这是一个示例: https : //medium.com/swlh/working-with-the-3d-camera-on-the-samsung-s10-5g-4782336783c这适用于所有三星设备,尽管该示例仅使用S10 5G 上的前置 ToF 摄像头。 Both S10 and Note 10+ 5G have back facing ToF cameras as well. S10 和 Note 10+ 5G 也都有背面 ToF 摄像头。

I don't know if Huawei or OnePlus conform to the same API (they theoretically should and other answers indicate that they do to some extent).我不知道华为或OnePlus是否符合相同的API(他们理论上应该和其他答案表明他们在某种程度上这样做)。

Not possible as of now.目前不可能。 As Android has not included any such APIs in official latest SDKs.由于 Android 尚未在官方最新 SDK 中包含任何此类 API。

Also those manufactures like Huawei, Samsung and OnePlus are using their customized OS sources and I don't think they have opened it out.华为、三星和一加等制造商也在使用他们定制的操作系统源,我认为他们没有公开。

I was searching for the same and i came across this thread on Samsung community, https://developer.samsung.com/forum/board/thread/view.do?boardName=SDK&messageId=371359&listLines=40&startId=zzzzz~&searchType=ALL&searchText=tof我正在寻找相同的内容,我在三星社区发现了这个帖子, https://developer.samsung.com/forum/board/thread/view.do?boardName=SDK&messageId=371359&listLines=40&startId=zzzzz~&searchType=ALL&searchText=到F

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM