Skip to content

Commit c1c9cb9

Browse files
committed
perf
1 parent f5d35b7 commit c1c9cb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/arduino/app_bricks/camera_code_detection/detection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ def on_error(self, callback: Callable[[Exception], None] | None):
147147
def loop(self):
148148
"""Main loop to capture frames and detect codes."""
149149
try:
150-
frame = self._camera.capture()
150+
frame = self._camera.capture_bytes()
151151
if frame is None:
152152
return
153153
except Exception as e:
154154
self._on_error(e)
155155
return
156156

157157
# Use grayscale for barcode/QR code detection
158-
gs_frame = cv2.cvtColor(np.asarray(frame), cv2.COLOR_RGB2GRAY)
158+
gs_frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
159159

160160
self._on_frame(frame)
161161

0 commit comments

Comments
 (0)