You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Set initial image source (optional, can be set in try_capture)
91
100
image.set_src(image_dsc)
92
101
102
+
# Variable to hold the current memoryview to prevent garbage collection
103
+
current_cam_buffer=None
104
+
93
105
deftry_capture():
106
+
globalcurrent_cam_buffer
94
107
ifcam.frame_available():
95
-
buffer[:] =bytes(cam.capture())
96
-
cam.free_buffer()
97
-
# Swap bytes for each 16-bit pixel
98
-
# This is no longer needed because the esp-camera driver does {FORMAT_CTRL00, 0x6F}, // RGB565 (RGB) instead of {FORMAT_CTRL00, 0x61}, // RGB565 (BGR) now
99
-
#img_swapped = bytearray(len(img))
100
-
#for i in range(0, len(img), 2):
101
-
# img_swapped[i] = img[i+1] # Swap high and low bytes
0 commit comments