diff --git a/Dockerfile b/Dockerfile index 3055262..3192164 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,8 @@ RUN poetry build ################# FROM base +COPY camera_tunning /camera_tuning + RUN mkdir /models COPY --from=model-builder /models/mobile_object_localizer_192x192_openvino_2021.4_6shave.blob /models/mobile_object_localizer_192x192_openvino_2021.4_6shave.blob diff --git a/camera/cli.py b/camera/cli.py index e7ec599..7931823 100644 --- a/camera/cli.py +++ b/camera/cli.py @@ -12,6 +12,10 @@ import paho.mqtt.client as mqtt from camera import oak_pipeline as cam +CAMERA_EXPOSITION_DEFAULT = "default" +CAMERA_EXPOSITION_8300US = "8300us" +CAMERA_EXPOSITION_500US = "500us" + logger = logging.getLogger(__name__) _DEFAULT_CLIENT_ID = "robocar-depthai" @@ -49,6 +53,10 @@ def _parse_args_cli() -> argparse.Namespace: help="set rate at which camera should produce frames", type=int, default=30) + parser.add_argument("--camera-tuning-exposition", type=str, + default=CAMERA_EXPOSITION_DEFAULT, + help="override camera exposition configuration", + choices=[CAMERA_EXPOSITION_DEFAULT, CAMERA_EXPOSITION_500US, CAMERA_EXPOSITION_8300US]) parser.add_argument("-H", "--image-height", help="image height", type=int, default=_get_env_int_value("IMAGE_HEIGHT", 120)) @@ -98,6 +106,12 @@ def execute_from_command_line() -> None: objects_threshold=args.objects_threshold) pipeline = dai.Pipeline() + if args.camera_tuning_exposition == CAMERA_EXPOSITION_500US: + pipeline.setCameraTuningBlobPath('/camera_tuning/tuning_exp_limit_500us.bin') + elif args.camera_tuning_exposition == CAMERA_EXPOSITION_8300US: + pipeline.setCameraTuningBlobPath('/camera_tuning/tuning_exp_limit_8300us.bin') + + pipeline_controller = cam.PipelineController(pipeline=pipeline, frame_processor=frame_processor, object_processor=object_processor, diff --git a/camera/oak_pipeline.py b/camera/oak_pipeline.py index 614229f..c13375f 100644 --- a/camera/oak_pipeline.py +++ b/camera/oak_pipeline.py @@ -390,6 +390,7 @@ class PipelineController: self._object_processor.process(in_nn, frame_ref) logger.debug("objects processed") + def stop(self) -> None: """ Stop event loop, if loop is not running, do nothing diff --git a/camera_tunning/tuning_exp_limit_500us.bin b/camera_tunning/tuning_exp_limit_500us.bin new file mode 100644 index 0000000..4caf513 Binary files /dev/null and b/camera_tunning/tuning_exp_limit_500us.bin differ diff --git a/camera_tunning/tuning_exp_limit_8300us.bin b/camera_tunning/tuning_exp_limit_8300us.bin new file mode 100644 index 0000000..acad4be Binary files /dev/null and b/camera_tunning/tuning_exp_limit_8300us.bin differ