如何使用openCV检测脸颊?

问题描述 投票:0回答:2

我正在使用 Python、openCV、dlib 进行虚拟化妆。目前,我可以获取嘴唇、鼻子、下巴等面部标志。但我不太确定是否获取脸颊的点。

他们有什么建议吗?

python opencv face-detection dlib
2个回答
2
投票

如果您使用 dlib 68 面部标志,以下是 2 个脸颊的 ROI:

from imutils import face_utils

#face detection part

#rect is the face detected
shape = predictor(gray_img, rect)
shape = face_utils.shape_to_np(shape)

img[shape[29][1]:shape[33][1], shape[54][0]:shape[12][0]] #right cheeks
img[shape[29][1]:shape[33][1], shape[4][0]:shape[48][0]] #left cheek


0
投票

我刚刚开始构建虚拟化妆。你完成了吗?

© www.soinside.com 2019 - 2024. All rights reserved.