File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
internal_filesystem/apps/com.example.camtest/assets Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1+ # This code grabs images from the camera in RGB565 format (2 bytes per pixel)
2+ # and sends that to the QR decoder if QR decoding is enabled.
3+ # The QR decoder then converts the RGB565 to grayscale, as that's what quirc operates on.
4+ # It would be slightly more efficient to capture the images from the camera in L8/grayscale format,
5+ # or in YUV format and discarding the U and V planes, but then the image will be gray (not great UX)
6+ # and the performance impact of converting RGB565 to grayscale is probably minimal anyway.
7+
18import time
29
310appscreen = lv .screen_active ()
@@ -101,7 +108,7 @@ def try_capture():
101108 if use_webcam :
102109 current_cam_buffer = webcam .capture_frame (cam , "rgb565" )
103110 elif cam .frame_available ():
104- current_cam_buffer = cam .capture () # Returns memoryview
111+ current_cam_buffer = cam .capture ()
105112 if current_cam_buffer and len (current_cam_buffer ):
106113 image_dsc .data = current_cam_buffer
107114 #image.invalidate() # does not work so do this:
You can’t perform that action at this time.
0 commit comments