RAW Image Capture - Higher Frame Rate

It goes to about 10 frames per second with QVGA Resolution and Grayscale Pixel Format. If i add a windowing of 200 x 200, it does increase to about 34 frames per second

this is my code:

import sensor, image, pyb, time

record_time = 20000 # 10 seconds in milliseconds

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_windowing(200,200)
clock = time.clock()

stream = image.ImageIO(“/stream.bin”, “w”)

Red LED on means we are capturing frames.

pyb.LED(1).on()

start = pyb.millis()
while pyb.elapsed_millis(start) < record_time:
clock.tick()
img = sensor.snapshot()

Modify the image if you feel like here…

stream.write(img)
print(clock.fps())

stream.close()

Blue LED on means we are done.

pyb.LED(1).off()
pyb.LED(3).on()