用户询问 OpenMV Cam H7 是否支持手动设置曝光时间(exposure time)和增益(gain)参数。
OpenMV 系列摄像头基于 MicroPython,提供丰富的图像控制 API。H7 型号搭载 STM32H743VI 处理器和 OV7725/OV9650/OV2640 等可选传感器(具体取决于硬件版本),其图像控制能力因传感器型号和固件版本而异。
执行“sensor.set_auto_gain(false,gain_db=10)、sensor.set_auto_exposure(false,exposure_us=40000)”时,我发现摄像头仅仅是执行了false,但并不会按我设置的曝光时间和增益去调整,我的传感器型号是MT9M114
支持手动
import sensor,time
# 初始化摄像头
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # 或 sensor.GRAYSCALE
sensor.set_framesize(sensor.VGA) # 设置图像分辨率
sensor.set_auto_exposure(False, exposure_us=10000)
sensor.set_auto_gain(False, gain_db=10)
clock = time.clock() # Create a clock object to track the FPS.
while True:
clock.tick() # Update the FPS clock.
img = sensor.snapshot() # Take a picture and return the image.
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
# to the IDE. The FPS should increase once disconnected.