-1

I'm trying to mask off the face of a person from a frame in the video, and i have the outline of the jaw as a set of 17 coordinates (from ibugs). I overlaid a line outlining the jaw using the function cv2.line, but it appears that the line only grows thicker in one direction, not the other.

thick = 20
for i in range(0,16):
    mask = cv2.line(mask,(int(landmarks[i][0]),int(landmarks[i][1])),(int(landmarks[i+1][0]),int(landmarks[i+1][1])),
                    (255,255,255), thick, 4)
mask = cv2.line(mask, (int(landmarks[16][0]), int(landmarks[16][1])), (int(landmarks[0][0]), int(landmarks[16][1])), 
                (255,255,255), thick)
mask = cv2.line(mask, (int(landmarks[0][0]), int(landmarks[0][1])), (int(landmarks[0][0]), int(landmarks[16][1])), 
                (255,255,255), thick)

an image of thickness 20

an image of thickness 20

an image of thickness 50

an image of thickness 50

thanks in advance!

nathancy
  • 42,661
  • 14
  • 115
  • 137

1 Answers1

0

Update: worked properly once jupyter notebook was restarted, not sure why