logo

OpenMV Cam H7 是否支持手动设置曝光时间与增益?

2026-04-27 12:44
1
1odnikgyhtco

OpenMV Cam H7 是否支持手动设置曝光时间与增益?

问题描述

用户询问 OpenMV Cam H7 是否支持手动设置曝光时间(exposure time)和增益(gain)参数。

相关背景

OpenMV 系列摄像头基于 MicroPython,提供丰富的图像控制 API。H7 型号搭载 STM32H743VI 处理器和 OV7725/OV9650/OV2640 等可选传感器(具体取决于硬件版本),其图像控制能力因传感器型号和固件版本而异。

关键疑问点

  • 是否可通过 Python API(如 sensor.set_auto_gain()、sensor.set_auto_exposure() 或对应 manual 模式)直接控制?
  • 不同传感器(如 OV2640 vs OV7725)对曝光/增益的手动控制支持程度是否有差异?
  • 是否需要关闭自动模式后才能设置?有无典型代码示例?
  • 固件版本是否影响该功能可用性?(例如:v4.6.0+ 是否增强支持?)
2026-04-27 12:53
1
1odnikgyhtco

执行“sensor.set_auto_gain(false,gain_db=10)、sensor.set_auto_exposure(false,exposure_us=40000)”时,我发现摄像头仅仅是执行了false,但并不会按我设置的曝光时间和增益去调整,我的传感器型号是MT9M114

2026-04-27 13:23
Z
星小瞳xs

支持手动

Z
星小瞳xs
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.