Android手机支持深度API
创始人
2024-10-10 15:31:29
0

Android 手机支持深度 API,可以通过使用 CameraX 或者使用 Android Depth API 库实现。以下是使用 Android Depth API 库获得深度图像的示例代码:

// 检查设备是否支持深度 API
if(!SessionCompat.isDepthModeSupported(requireContext())){
    // 设备不支持深度 API
    return;
}

// 创建深度流会话,指定深度流分辨率和输出格式
mDepthSession = SessionCompat.createDepthSession(
        requireContext(), new SessionCompat.SurfaceConfig(
                depthView.getWidth(), depthView.getHeight(),
                ImageFormat.DEPTH16, Surface.SURFACE_TYPE_SURFACE_VIEW));

// 打开深度流
mDepthSession.open();

// 获取深度图像
mDepthSession.setDepthCallback(new SessionCompat.DepthDataCallback() {
    @Override
    public void onDepthDataAvailable(SessionCompat session, DepthData depthData) {
        Depth16 depth16 = depthData.getDepth16();
        if (depth16 == null) return;

        // 处理深度图像
        // ...
    }
});

相关内容

热门资讯

透视好友房"poke... 透视好友房"pokermaster辅助器"详细辅助攻略教程(辅助插件功能透明)是一款可以让一直输的玩...
透视模拟器"poke... 透视模拟器"pokeplus脚本"详细辅助实用技巧(好友助力码辅助);支持2-10人实时对战,虚拟庄...
透视线上"hhpok... 透视线上"hhpoker真能买到挂吗"详细辅助AI教程(透视脚本免费app软件),支持语音通讯、好友...
透视插件"wepok... 1、透视插件"wepoker怎么开辅助"详细辅助辅助教程(辅助器下载攻略);详细教程。2、wepok...
透视透视挂"菠萝德普... 1、透视透视挂"菠萝德普辅助器免费版在哪里"详细辅助科技教程(私人定制透视技巧)。2、菠萝德普辅助器...
透视总结"wepok... 透视总结"wepoker免费脚本咨询"详细辅助wepoke教程(辅助真的假的技巧)准备好在wepok...
透视app"poke... 透视app"pokernow辅助工具"详细辅助揭秘教程(辅助器技巧)关于pokernow辅助工具机制...
透视黑科技"hhpo... 透视黑科技"hhpoker辅助器"详细辅助系统教程(辅助器免费教程);hhpoker辅助器软件透明挂...
透视线上"hhpok... 透视线上"hhpoker透视方法"详细辅助揭秘攻略(俱乐部辅助透视)是一款可以让一直输的玩家,快速成...
透视存在"werpl... 透视存在"werplan辅助软件"详细辅助玩家教你(私人局外卦攻略),支持语音通讯、好友开房及战队组...