fix visualzation and tune blob fallback

This commit is contained in:
Prohurtz 2022-08-21 14:52:14 -07:00
parent d0edbba3fd
commit 6dd14474fb
2 changed files with 8 additions and 2 deletions

View File

@ -311,6 +311,12 @@ class CameraWidget:
and not eye_info.blink
):
graph.update(background_color="white")
if eye_info.y < 0: # flip visualzation to be correct
eye_info.y = abs(eye_info.y)
elif eye_info.y >= 0:
eye_info.y = -abs(eye_info.y)
graph.draw_circle(
(eye_info.x * -100, eye_info.y * -100),
25,

View File

@ -258,7 +258,7 @@ class EyeProcessor:
# something to do blob tracking on.
_, larger_threshold = cv2.threshold(
self.current_image_gray,
int(self.config.threshold + 15),
int(self.config.threshold + 20),
255,
cv2.THRESH_BINARY,
)
@ -321,7 +321,7 @@ class EyeProcessor:
# if our blob width/height are within suitable (yet arbitrary) boundaries, call that good.
#
# TODO This should be scaled based on camera resolution.
if not 8 <= h <= 30 or not 8 <= w <= 30:
if not 6 <= h <= 25 or not 6 <= w <= 25:
continue
cx = x + int(w / 2)
cy = y + int(h / 2)