【问题标题】:How to normalize facial landmark coordinates for reconstruction如何标准化面部地标坐标以进行重建
【发布时间】:2020-05-11 05:30:37
【问题描述】:

我正在使用 dlib 来检测多个视频帧中的面部地标坐标。如何标准化这些坐标,以便轻松转换回其原始坐标,而无需保存任何额外数据?

这是一个使用 python 和 numpy 的示例:

def process_keypoints(keypoints):
    # Need to save center variable to correctly go from normalized keypoints to original keypoints
    center = np.mean(keypoints, axis=0)
    keypoints_norm = keypoints - center
    return keypoints_norm

【问题讨论】:

    标签: python numpy dlib


    【解决方案1】:

    如果您不想保存额外的数据,但之后可以尝试一些额外的计算,请尝试

    #replace the first point with the center
    keypoints_norm[0] = center
    return key_points_norm
    
    #reconstruct
    center = keypoints_norm[0]
    keyporints_norm[0]=-np.sum(keypoints_norm[1:])
    

    【讨论】:

      猜你喜欢
      • 2019-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-12
      • 2021-03-17
      • 2013-08-08
      • 2012-08-09
      • 2020-09-21
      相关资源
      最近更新 更多