A guide to use the SAVI package

Function crop_mouth_from_landmarks()

Function crop_mouth_from_landmarks() uses bob.ip.base.FaceEyesNorm to normalise an image crop of a mouth bounding box. It takes as input

  • mouth_size: the distance between the left and right part of the mouth
  • crop_size: the size of the output image
  • mouth_center: the coordinates of the center of the mouth in the output image.

Some examples:

alternate text

Fig. 1 Height of 128, distance of 65 pixels between left and right


alternate text

Fig. 2 Height of 64, distance of 65 pixels between left and right


alternate text

Fig. 3 Height of 64, distance of 100 pixels between left and right

The code to produce the last example is:

mouth_image = \
   crop_mouth_from_landmarks(frame,
                             landmarks,
                             mouth_size = 100,
                             crop_size = (64, 128),
                             mouth_center = (32, 64))