From 71029e689c116af128ef016e513fd68614e85646 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 19 Jun 2024 14:07:44 +0200 Subject: Allowing to mute pipeline drawing with f key. --- src/argaze/__main__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/argaze/__main__.py b/src/argaze/__main__.py index cc83d1d..7cfeb09 100644 --- a/src/argaze/__main__.py +++ b/src/argaze/__main__.py @@ -88,6 +88,9 @@ def load_context(args): # Assess processing time start_time = time.time() + # Draw context pipeline by default + draw_pipeline = True + # Waiting for 'ctrl+C' interruption with contextlib.suppress(KeyboardInterrupt), os.fdopen(pipe_file) if args.pipe_path is not None else contextlib.nullcontext() as pipe: @@ -115,7 +118,7 @@ def load_context(args): if not args.no_window: # Display context - display(context.name, context.image(), 0.75) + display(context.name, context.image(draw_pipeline=draw_pipeline), 0.75) # Head-mounted eye tracker case: display environment frames image if issubclass(type(context.pipeline), ArCamera): @@ -126,6 +129,7 @@ def load_context(args): # Key interaction key_pressed = cv2.waitKey(40) + #print("key_pressed", key_pressed) # Esc: close window if key_pressed == 27: @@ -143,6 +147,11 @@ def load_context(args): context.pause() + # f: disable/enable pipeline drawing + if key_pressed == 102: + + draw_pipeline = not draw_pipeline + # Enter: start calibration if key_pressed == 13: -- cgit v1.1