# 高帧率FPS示例
#
# 此示例显示如何使全局快门相机的帧速率极高。
# 为此,您需要将分辨率设置为较低的值,以便在相机上激活像素分级,然后减少最大曝光时间。
#
# 当分辨率为320x240或更低时,相机会以2倍的速度读取像素。
# 当分辨率为160x120或更低时,相机读取像素的速度提高了4倍。
# 这是因为像素分级会自动激活,以提高读取速度。
#
# 虽然读取速度可能会增加,但相机必须仍然会在请求时间内曝光图像,
# 因此除非缩短曝光时间,否则不会获得最大读取速度。
# 这会产生一个黑暗的图像,所以你需要大量的照明以获得高FPS。
import sensor, image, time
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE
sensor.set_framesize(sensor.QQVGA) # Set frame size to QQVGA (160x120) - make smaller to go faster
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.
sensor.set_auto_exposure(True, exposure_us=5000) # make smaller to go faster
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.这是例程的高帧率代码,我用M3的旧摄像头又150帧的帧率,M4新买的摄像头只有50帧左右,这是为啥啊?
我的MV还是2020年的新款,就是MV4 Plus那个,看介绍上说帧率更快的。。。
OpenMV4 H7 Plus使用的是OV5640,主要是支持更高的分辨率,帧率会低。
如果你用OpenMV4 H7,用的是OV7725,和OpenMV3 M7是一样的。
哦哦,感谢,我的新的正好是ov5640,旧的是7725