INNER CODE UNIT · Python
x_ratio
vardanagarwal/Proctoring-AI · eye_tracker.py:45
x_ratio = (end_points[0] - cx)/(cx - end_points[2])
y_ratio = (cy - end_points[1])/(end_points[3] - cy)
if x_ratio > 3:
return 1
elif x_ratio < 0.33:
return 2
elif y_ratio < 0.33:
return 3
else:
return 0
def contouring(thresh, mid, img, end_points, right=False):
"""
Find the largest contour on an image divided by a midpoint and subsequently the eye position
Parameters
----------