Skip to content

Commit 337d6b7

Browse files
committed
perf
1 parent bf9e750 commit 337d6b7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/arduino/app_utils/image/adjustments.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def letterbox(
5757
new_w = int(orig_w * scale)
5858
new_h = int(orig_h * scale)
5959

60-
resized_frame = cv2.resize(frame, (new_w, new_h), interpolation=interpolation)
60+
if new_w == orig_w and new_h == orig_h:
61+
resized_frame = frame
62+
else:
63+
resized_frame = cv2.resize(frame, (new_w, new_h), interpolation=interpolation)
6164

6265
if frame.ndim == 2:
6366
# Greyscale

0 commit comments

Comments
 (0)