File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
com.example.camtestnew/assets
com.example.camtest/assets Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ def init_cam():
221221 except Exception as e :
222222 print (f"camtest.py: webcam exception: { e } " )
223223
224- time .sleep_ms (1000 )
224+ # time.sleep_ms(1000)
225225memview = webcam .capture_frame (cam ) # Returns memoryview
226226time .sleep_ms (1000 )
227227static_bytes_obj = bytes (memview )
Original file line number Diff line number Diff line change 1515th .disable ()
1616
1717cam = webcam .init ("/dev/video0" ) # Initialize webcam with device path
18- memview = None
19- # memview = webcam.capture_frame(cam) # Returns memoryview
18+ # memview = None
19+ memview = webcam .capture_frame (cam ) # Returns memoryview
2020#time.sleep_ms(1000)
2121#static_bytes_obj = bytes(memview)
2222
2323
2424image = lv .image (lv .screen_active ())
2525image .align (lv .ALIGN .LEFT_MID , 0 , 0 )
26- image .set_rotation (900 )
26+ # image.set_rotation(900)
2727# Create image descriptor once
2828image_dsc = lv .image_dsc_t ({
2929 "header" : {
3838})
3939image .set_src (image_dsc )
4040
41- memview = webcam .capture_frame (cam ) # Returns memoryview
41+ # memview = webcam.capture_frame(cam) # Returns memoryview
4242
4343for i in range (300 ):
4444 print (f"iteration { i } " )
4545 webcam .recapture_frame (cam ) #refresh memview
4646 #memview =
47- bytes_obj = bytes (memview )
47+ # bytes_obj = bytes(memview)
4848 #print(f"got bytes: {len(bytes_obj)}")
49- image_dsc .data = bytes_obj
49+ # image_dsc.data = bytes_obj
5050 #image_dsc.data = static_bytes_obj
5151 #image_dsc.data = webcam.capture_frame(cam) # Returns memoryview
5252 image .set_src (image_dsc )
You can’t perform that action at this time.
0 commit comments