【问题标题】:How can I get the points in face mesh like eye ,eyebrow , lip, mouth ,nose using ARFaceTracking in Swift 4.2?如何在 Swift 4.2 中使用 ARFaceTracking 获得面部网格中的点,如眼睛、眉毛、嘴唇、嘴巴、鼻子?
【发布时间】:2018-12-26 06:04:53
【问题描述】:

目前我正在获取左右眼点,如何在 ios 的 swift 4 中使用 ARFaceTracking 或其他框架获取其他部分点。

请在问题上方给出反馈?

【问题讨论】:

  • 请任何人给我一个解决方案。
  • 请提供一些代码

标签: arkit swift4.2 arfacegeometry


【解决方案1】:

您可以使用 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 属性。

【讨论】:

【解决方案2】:

这里有一些神奇的数字给你:

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)

【讨论】:

    猜你喜欢
    • 2012-02-19
    • 1970-01-01
    • 2020-11-23
    • 1970-01-01
    • 2013-07-14
    • 1970-01-01
    • 2013-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多