pupil-labs / pupil-detectors

GNU Lesser General Public License v3.0
24 stars 18 forks source link

Safeguard all calls to cv::fitEllipse() for size < 5 #4

Closed pfaion closed 4 years ago

pfaion commented 4 years ago

In very rare cases we run into a call to cv::fitEllipse() with < 5 points. This will crash unfortunately and we cannot recover from the python side.

I guarded all calls to cv::fitEllipse() with checks and tried to proceed in the best possible way for the respective context.

Tested on the eye video from @papr showing the crash: