Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
simpel blink detection norm #12
Browse files Browse the repository at this point in the history
  • Loading branch information
simonarvin committed Jul 14, 2020
1 parent 7be2282 commit f56f909
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eyeloop/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def arm(self, width, height, image) -> None:
self.norm_cr_artefact = int(6 * self.norm)

self.mean = np.mean(image)
self.blink_threshold = -0.046 * np.var(image) + 68.11

self.base_mean = -1
self.blink = 0

Expand All @@ -131,7 +133,7 @@ def check_blink(self, threshold=5) -> bool:
self.mean = mean

# print("delta", delta)
if abs(delta) > 1.1:
if abs(delta) > self.blink_threshold:
self.blink = 10
print("blink!")
return False
Expand Down

0 comments on commit f56f909

Please sign in to comment.