pts = np.array([[landmarks_mouthl[0], landmarks_mouthl[1]-5], [landmarks_mouthr[0]+3, landmarks_mouthl[1]-5], [landmarks_mouthr[0]+3, landmarks_mouthr[1]+13],[landmarks_mouthl[0], landmarks_mouthr[1]+13]],np.int32)
# -1表示该纬度靠后面的纬度自动计算出来,实际上是4
pts = pts.reshape((-1, 1, 2,))
cv2.fillPoly(img, [pts], (rand_number1, rand_number2, rand_number3))
其中,四个顶点pts是有顺序的,从最左边第一个顶点顺时针写完四个顶点的坐标,是正确的,否则会生成漏斗形的填充。