首先,进入中控易动—提供APP一站式SaaS服务,创建一个应用,创建完成进入应用,然后添加ArcSoftFace插件。ArcSoftFace插件:提供人脸识别功能·插件的所有接口在 deviceready 事件后生效;·虹软创建应用后,需要提供APPID、SDKKEY、Sdk的zip文件(与当前APPID匹配的SDK的压缩包);(参考·ArcSoftFace插件配置)·当前iOS使用ArcSoftFaceEngine.framework版本是3.0;当前Android使用ArcSoftFace版本是3.0;图片模式检测navigator.arcSoftFace.imageModeCheck(imagePath,success,error)支持平台:AndroidiOS参数说明
// 监听’deviceready‘事件document.addEventListener('deviceready', onDeviceReady, false)function onDeviceReady(){ navigator.arcSoftFace.imageModeCheck('https://www.yd-mobile.cn/www/photo.jpg', function (successCallback) { alert(JSON.stringify(successCallback)); },function (errorCallback) { alert(JSON.stringify(errorCallback)); });}
响应示例代码:{ "allFaceData": [ { "age": "25", "gender": "女", "3DAngle": { "yaw": 7.7150774002075195, "status": 0, "pitch": -14.829463958740234, "roll": -6.1180949211120605 }, "rect": { "bottom": 228, "top": 61, "left": 349, "right": 516 } } ], "num": 1, "beforeImgPath": "cdvfile://localhost/cache/ArcSoftFace/CacheFace/1583202043544.png", "afterImgPath": "cdvfile://localhost/cache/ArcSoftFace/CacheFace/1583202043475.png"}
图片模式人脸特征对比navigator.arcSoftFace.faceFeatureComparison(mainImage,contrastImage,success,error)支持平台:AndroidiOS参数说明// 监听’deviceready‘事件document.addEventListener('deviceready', onDeviceReady, false)function onDeviceReady(){ navigator.arcSoftFace.faceFeatureComparison('https://www.yd-mobile.cn/www/photo.jpg','https://www.yd-mobile.cn/www/photo.jpg', function (success) { alert(JSON.stringify(success)); }, function (error) { alert(JSON.stringify(error)); } );}
响应示例代码:'1.000000'
视频模式检测navigator.arcSoftFace.videoModeCheck(options,success,error)支持平台:AndroidiOS参数说明// 监听’deviceready‘事件document.addEventListener('deviceready', onDeviceReady, false)function onDeviceReady(){ var options = {'mainImage':'https://www.yd-mobile.cn/www/photo.jpg','imgPath':'1'}; navigator.arcSoftFace.videoModeCheck(options, function (success) { alert(JSON.stringify(success)); }, function (error) { alert(JSON.stringify(error)); } );</script>
响应示例代码:{ "allFaceData": [ { "age": "24", "gender": "女", "3DAngle": { "yaw": -0.19426307082176208, "status": 0, "pitch": -7.769935607910156, "roll": 7.534030437469482 }, "rect": { "bottom": 1128, "top": 355, "left": -7, "right": 765 } } ], "num": 1, "similar": 0.011990511789917946, "imagePath": "cdvfile://localhost/cache/ArcSoftFace/1583202179458.png"}
0 评论