diff --git a/depthai_sdk/src/depthai_sdk/components/camera_component.py b/depthai_sdk/src/depthai_sdk/components/camera_component.py index d84891df0..c910af6f4 100644 --- a/depthai_sdk/src/depthai_sdk/components/camera_component.py +++ b/depthai_sdk/src/depthai_sdk/components/camera_component.py @@ -248,15 +248,23 @@ def config_camera(self, if self._replay: self._replay.resize(self._source, size_tuple, resize_mode) - elif self.is_color(): + return + + if resize_mode != ResizeMode.CROP: + raise ValueError("Currently only ResizeMode.CROP is supported mode for specifying size!") + + if self.is_color(): self.node.setStillSize(*size_tuple) self.node.setVideoSize(*size_tuple) self.node.setPreviewSize(*size_tuple) - if resize_mode != ResizeMode.CROP: - raise ValueError("Currently only ResizeMode.CROP is supported mode for specifying size!") else: - # TODO: Use ImageManip to set mono frame size - raise NotImplementedError("Not yet implemented") + crop_manip = self._pipeline.create(dai.node.ImageManip) + crop_manip.initialConfig.setResize(*size_tuple) + crop_manip.initialConfig.setKeepAspectRatio(True) + self.node.out.link(crop_manip.inputImage) + self.node = crop_manip + self.stream = crop_manip.out + self.stream_size = size_tuple def _config_camera_args(self, args: Dict): if not isinstance(args, Dict):