Skip to content

Commit

Permalink
Move resize mode check out of conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
hexbabe committed Jul 17, 2024
1 parent 080871a commit be39d9c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions depthai_sdk/src/depthai_sdk/components/camera_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,15 @@ 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:
crop_manip = self._pipeline.create(dai.node.ImageManip)
crop_manip.initialConfig.setResize(*size_tuple)
Expand Down

0 comments on commit be39d9c

Please sign in to comment.