def rect_eye(eye_landmarks):
    """
    传入face_recognition.face_landmarks函数返回的眼部定位六坐标list,
    返回左上角和右下角的坐标, 构成眼部矩形
    :param eye_landmarks: 眼睛坐标,如[(193, 251), (205, 242), (223, 244), (235, 258), (220, 261), (203, 259)]
    :return: 一个含有四个键值对的dict, 分别为图片左上角的x,y坐标和图片右下角的x,y坐标
    """
    width = eye_landmarks[3][0] - eye_landmarks[0][0]
    height = int((eye_landmarks[4][1] + eye_landmarks[5][1] - eye_landmarks
        [1][1] - eye_landmarks[2][1]) / 2)
    x = eye_landmarks[0][0]
    y = int((eye_landmarks[1][1] + eye_landmarks[2][1]) / 2)
    return {'x1': x, 'y1': y, 'x2': x + width, 'y2': y + height}
