【发布时间】:2018-12-26 06:04:53
【问题描述】:
目前我正在获取左右眼点,如何在 ios 的 swift 4 中使用 ARFaceTracking 或其他框架获取其他部分点。
请在问题上方给出反馈?
【问题讨论】:
-
请任何人给我一个解决方案。
-
请提供一些代码
标签: arkit swift4.2 arfacegeometry
目前我正在获取左右眼点,如何在 ios 的 swift 4 中使用 ARFaceTracking 或其他框架获取其他部分点。
请在问题上方给出反馈?
【问题讨论】:
标签: arkit swift4.2 arfacegeometry
您可以使用 ARFaceGeometry 顶点。这是一个神奇的数字。 ARFaceGeometry 中有 1220 个顶点,索引 9 在鼻子上。这行得通。
let vertices = [anchor.geometry.vertices[9]] // nose
// You can use Features Indexes with array
let features = ["nose", "leftEye", "rightEye", "mouth", "hat"]
let featureIndices = [[9], [1064], [42], [24, 25], [20]]
这里 features 是您为每个功能指定的节点名称的数组,而 featureIndices 是ARFaceGeometry 中与这些功能相对应的顶点索引。使用ARFaceAnchor 属性。
【讨论】:
这里有一些神奇的数字给你:
let mouthTopLeft = Array(250...256)
let mouthTopCenter = [24]
let mouthTopRight = Array(685...691).reversed()
let mouthRight = [684]
let mouthBottomRight = [682, 683,700,709,710,725]
let mouthBottomCenter = [25]
let mouthBottomLeft = [265,274,290,275,247,248]
let mouthLeft = [249]
let mouthClockwise : [Int] = mouthLeft +
mouthTopLeft + mouthTopCenter +
mouthTopRight + mouthRight +
mouthBottomRight + mouthBottomCenter +
mouthBottomLeft
let eyeTopLeft = Array(1090...1101)
let eyeBottomLeft = Array(1102...1108) + Array(1085...1089)
let eyeTopRight = Array(1069...1080)
let eyeBottomRight = Array(1081...1084) + Array(1061...1068)
【讨论】: