expected_eye_positions(bounding_box, padding) -> eyes

  Computes the expected eye positions based on the relative coordinates of the bounding box.

  This function can be used to translate between bounding-box-based image cropping and eye-location-based alignment.
  The returned eye locations return the **average** eye locations, no landmark detection is performed.

  **Parameters:**

  ``bounding_box`` : :py:class:`BoundingBox`
    The face bounding box as detected by one of the functions in ``bob.ip.facedetect``.

  ``padding`` : {'top':float, 'bottom':float, 'left':float, 'right':float}
    The padding that was used for the ``eyes`` source in :py:func:`bounding_box_from_annotation`, has a proper default.

  **Returns:**

  ``eyes`` : {'reye' : (rey, rex), 'leye' : (ley, lex)}
    A dictionary containing the average left and right eye annotation.

def expected_eye_positions(bounding_box, padding = None):
  """expected_eye_positions(bounding_box, padding) -> eyes

  Computes the expected eye positions based on the relative coordinates of the bounding box.

  This function can be used to translate between bounding-box-based image cropping and eye-location-based alignment.
  The returned eye locations return the **average** eye locations, no landmark detection is performed.

  **Parameters:**

  ``bounding_box`` : :py:class:`BoundingBox`
    The face bounding box as detected by one of the functions in ``bob.ip.facedetect``.

  ``padding`` : {'top':float, 'bottom':float, 'left':float, 'right':float}
    The padding that was used for the ``eyes`` source in :py:func:`bounding_box_from_annotation`, has a proper default.

  **Returns:**

  ``eyes`` : {'reye' : (rey, rex), 'leye' : (ley, lex)}
    A dictionary containing the average left and right eye annotation.
  """
  if padding is None:
    padding = default_paddings['eyes']
  top, left, right = padding['top'], padding['left'], padding['right']
  inter_eye_distance = (bounding_box.size[1]) / (right - left)
  return {
    'reye':(bounding_box.top_f - top*inter_eye_distance, bounding_box.left_f - left/2.*inter_eye_distance),
    'leye':(bounding_box.top_f - top*inter_eye_distance, bounding_box.right_f - right/2.*inter_eye_distance)
  }