SE-Projekt-LED-Detection / LED-Detection

LED-Detection is a tool for observing state leds on PCBs using a document camera.
MIT License
2 stars 2 forks source link

State Detection Brightness Exception #95

Closed olfarmer closed 2 years ago

olfarmer commented 2 years ago

On normal running, occurs most of the time:

ValueError: cannot convert float NaN to integer in Brightness/__init__.py line 15, in hist_avg: return int(s / e)

Better exception handling and investigation of this behaviour is needed because currently the whole state detector loop crashes.

Quick and dirty fix of the exception, change line to:

int(s / (e + 0.000001))