更新sant 摄像头初始化跳帧操作

This commit is contained in:
dahanzimin
2025-10-27 18:51:28 +08:00
parent 629fdc958e
commit e4cf2e57f5
2 changed files with 4 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ class IMG:
self.format = "RGB565"
class Camera(Camera):
def __init__(self, frame_size=FrameSize.R240X240, pixel_format=PixelFormat.RGB565, hmirror=False, vflip=False, **kwargs):
def __init__(self, frame_size=FrameSize.R240X240, pixel_format=PixelFormat.RGB565, skip_frame=3, hmirror=False, vflip=False, **kwargs):
from mixgo_sant import onboard_bot
onboard_bot.cam_reset(1, 0)
onboard_bot.cam_en(1, 150)
@@ -29,6 +29,8 @@ class Camera(Camera):
self.set_vflip(not vflip)
time.sleep_ms(50)
SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000) # 恢复I2C
for _ in range(skip_frame):
super().capture()
def deinit(self):
super().deinit()

View File

@@ -9,7 +9,7 @@ from espdl import *
def analyze(results, keys=None, num=0):
if keys is None:
return results is not None
return True if results else False
if results:
if keys == "len":
return len(results)