Created
December 3, 2019 17:07
-
-
Save kaushil24/cf0893692125dc1cc329dcaeee5de492 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getEyelinerPoints(eye_landmark_points): | |
''' | |
Takes an array of eye coordinates and interpolates them: | |
''' | |
L_eye_top, L_eye_bottom, R_eye_top, R_eye_bottom = eye_landmark_points | |
L_interp_x = np.arange(L_eye_top[0][0], L_eye_top[-1][0], 1) | |
R_interp_x = np.arange(R_eye_top[0][0], R_eye_top[-1][0], 1) | |
L_interp_top_y = interpolateCoordinates(L_eye_top, L_interp_x) | |
L_interp_bottom_y = interpolateCoordinates(L_eye_bottom, L_interp_x) | |
R_interp_top_y = interpolateCoordinates(R_eye_top, R_interp_x) | |
R_interp_bottom_y = interpolateCoordinates(R_eye_bottom, R_interp_x) | |
return [(L_interp_x, L_interp_top_y, L_interp_bottom_y), (R_interp_x, R_interp_top_y, R_interp_bottom_y)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment