资讯 社区 文档
技术能力
语音技术
文字识别
人脸与人体
图像技术
语言与知识
视频技术

ARKit能力集成

ARKit能力集成

简介

ARKit是苹果在2017年WWDC推出的AR技术,DuMix SDK 集成了ARKit中的大部分能力,供开发者使用,目前仅iOS设备可用。

Sample case :代码下载

logo识别

API接口

开启平面检测接口:ARKit.start_plane_detect()

设置平面检测类型接口:ARKit.set_plane_detection_type(type)

重新检测平面接口:ARKit.redetect_plane()

设置特征点是否开启接口:ARKit.set_plane_feature_info_enabled(1)

平面检测类型:

  • DetectionType.Horizontal 检测水平面
  • DetectionType.Vertical 检测竖直平面
  • DetectionType.VerticalAndHorizontal 同时检测水平面和竖直平面

能力使用

一、在内容平台中选择arkit类型模板

二、在lua中调用相关接口

 --示例代码
 app.on_loading_finish = function()
     -- 设置平面检测类型
     ARKit.set_plane_detection_type(DetectionType.VerticalAndHorizontal)
     -- 开始检测平面 
     ARKit.start_plane_detect()
 end

三、Lua里获取logo识别状态及结果

 --示例代码
 app.on_loading_finish = function()
     
    -- 设置平面检测类型
    ARKit.set_plane_detection_type(DetectionType.VerticalAndHorizontal)
    -- 开始检测平面 
    ARKit.start_plane_detect()
     
    -- 增加各种事件的监听
    Event:addEventListener("plane_feature_info", plane_info)
    Event:addEventListener("plane_anchor_added", plane_anchor_added)
    Event:addEventListener("plane_anchor_updated", plane_anchor_updated)
    Event:addEventListener("plane_anchor_removed", plane_anchor_removed)
        
 end
 
--- 平面特征点信息回调 -- 
function plane_info(event)

end

--- 找到平面的锚点的回调 -- 
function plane_anchor_added(event)

end

--- 平面锚点信息更新的回调 -- 
function plane_anchor_updated(event)

en

--- 平面锚点被删除的回调 -- 
function plane_anchor_removed(event)

end

注意

  • ARKit的能力仅支持 iOS11 以上的设备,部分功能需要 iOS 11.3以上的设备
上一篇
在线视频(音频)播放
下一篇
游戏摇杆