利用 mediapipe 進行處理
規劃
1.先把人臉辨識,然後取出框框
2.把框框內的人臉,進行美容
-高反差保留
(1)曝光度調整
(2)綠色與藍色,疊加
(3)YUCIHighPassSkinSmoothingMaskBoost
-調整圖像亮度
-混合
3.把人臉的嘴巴,進行塗紅
4.把人臉的眼睛塗黑
把人臉的眼睛塗上眼影,並用video看看效果。
frame_counter =0
LIPS=[ 61, 146, 91, 181, 84, 17, 314, 405, 321, 375,291, 308, 324, 318, 402, 317, 14, 87, 178, 88, 95,185, 40, 39, 37,0 ,267 ,269 ,270 ,409, 415, 310, 311, 312, 13, 82, 81, 42, 183, 78 ]
LEFT_EYE =[ 362, 382, 381, 380, 374, 373, 390, 249, 263, 466, 388, 387, 386, 385,384, 398 ]
RIGHT_EYE=[ 33, 7, 163, 144, 145, 153, 154, 155, 133, 173, 157, 158, 159, 160, 161 , 246 ]
RIGHT_EYE_U=[33,246, 161, 160, 159, 158, 157, 173, 133,190,56,28,27,29,30,247,130,226]
LEFT_EYE_U=[362, 398,384, 385, 386, 387, 388, 466, 263, 359,446,467,260,259,257,258,286,414]
RIGHT_EYE_L=[226,130,33,246, 161, 160, 159, 158, 157, 173, 133]
LEFT_EYE_L=[362, 398,384, 385, 386, 387, 388, 466, 263, 359,446]
img_o =utils.fillPolyTrans(img_o, [mesh_coords[p] for p in LEFT_EYE_U], utils.BLACK, opacity=0.3)
img_o =utils.fillPolyTrans(img_o, [mesh_coords[p] for p in RIGHT_EYE_U], utils.BLACK, opacity=0.3)
img_o =utils.fill_lineTrans(img_o, [mesh_coords[p] for p in LEFT_EYE_L], utils.BLACK, opacity=0.2)
img_o =utils.fill_lineTrans(img_o, [mesh_coords[p] for p in RIGHT_EYE_L], utils.BLACK, opacity=0.2)
FPS 26.2 看起來好像還可以。