I would like to find the line equation for the best approximation of a line passing as close as possible to 4 points which are almost forming a line.
The points are the left and right corners of each eye in a facial recognition software, so they are almost in line from a visual perspective, but they are not, obviously, on a line.
What I am looking for is the best approximation and the line does NOT need to pass through any of the points.
One idea I had was to make a line equation for each eye, using the corners, but this doesn't work since eyes may be slanted in random ways and also lighting dramatically affects the precision on the eye corners.
(bonus if you have a python solution :D)