'@brief æ ¹æ®ïŒäž€äžªçŒè§ïŒäž€äžªåŽè§ïŒäžäžªéŒ»å­è¿äºç¹è¿è¡å¯¹éœ,å¶å®äžalign_dlib_cppä¿æäžèŽã
@param five_points: äžäžªshape äžº10 çäººèžå³é®ç¹åæ äœçœ®ã
@attention è¿äžªçæ¬éåäºäž€äžªçŒè§åéŒ»å­ïŒåŽè§'

def align_5_points(self, imgDim, rgbImg, five_points):

    assert (imgDim is not None)
    assert (rgbImg is not None)
    from_points = []
    for i in range(0, 10, 2):
        from_points.append((five_points[i], five_points[(i + 1)]))
    to_points = []
    for i in [(36 - 17), (45 - 17), (33 - 17), (48 - 17), (54 - 17)]:
        new_ref_x = ((self.padding + self.mean_shape_x[i]) / ((2 * self.padding) + 1))
        new_ref_y = ((self.padding + self.mean_shape_y[i]) / ((2 * self.padding) + 1))
        to_points.append(((imgDim * new_ref_x), (imgDim * new_ref_y)))
    source = np.array(from_points).astype(np.int)
    target = np.array(to_points).astype(np.int)
    source = np.reshape(source, (1, 5, 2))
    target = np.reshape(target, (1, 5, 2))
    H = cv2.estimateRigidTransform(source, target, False)
    if (H is None):
        return
    else:
        aligned_face = cv2.warpAffine(rgbImg, H, (imgDim, imgDim))
        return aligned_face
