This function apply the affine transform to each point given by an affine matrix
(pt, t)
| 61 | |
| 62 | |
| 63 | def affine_transform(pt, t): |
| 64 | """ |
| 65 | This function apply the affine transform to each point given by an affine matrix |
| 66 | """ |
| 67 | new_pt = np.array([pt[0], pt[1], 1.]).T |
| 68 | new_pt = np.dot(t, new_pt) |
| 69 | return new_pt[:2] |
| 70 | |
| 71 | |
| 72 | def draw_landmarks(image, landmarks): |