我正试着跟踪面部表情,如扬眉、微笑、眨眼等。在ARKit中,我可以用blendShapes (https://developer.apple.com/documentation/arkit/arfaceanchor/2928251-blendshapes)来检测面部不同部位的运动,但在ARCore中还不存在。
我试着访问网格顶点,它们相对于人脸的中心变换,但是随着人脸的旋转,这些顶点发生了显著的变化。
有没有一种方法可以将脸部地标/顶点从0规范化到1,其中0是中性的,1是最大的面部表情?它不需要像ARKit blendShapes那样准确。
发布于 2021-02-16 07:11:54
你的问题涉及两个不同的问题:-
我没有问题1的解决方案,但是对于问题2,你可以从地标点算出一个旋转矩阵。我有一个方法,准备做它的中介脸网格。希望这对你有用:-
def calc_rotation_matrix(self):
left_corner_right_eye = get_left_corner_right_eye()
right_corner_left_eye = get_right_corner_left_eye()
left_corner_face = get_left_corner_face()
right_corner_face = get_right_corner_face()
upper_nose = get_upper_pt_nose()
chin = get_chin()
rotation_matrix = np.zeros((3, 3))
rotation_matrix[0:] = (right_corner_face - left_corner_face) / np.linalg.norm(right_corner_face - left_corner_face)
rotation_matrix[1:] = (chin - upper_nose) / np.linalg.norm(chin - upper_nose)
rotation_matrix[2:] = np.cross(rotation_matrix[0, :], rotation_matrix[1, :])
return rotation_matrix显然,您必须编写方法,以便为您自己的应用程序获取相应的点数。一旦你有了这个旋转矩阵,你就可以用(俯仰,偏航,滚动)= (0,0,0),通过将地标乘以np.linalg.inv(rotation_matrix)来得到脸部。
AFAIK MediaKit (或ARCore)没有内置混合形状的特性。@Hardik在上面的评论中提到,OpenCV和Dlib可以在这方面有所帮助。但我不太确定。事实上,我正在寻找类似的东西。
https://stackoverflow.com/questions/58226299
复制相似问题