Nicla vision Frame Rate

i want to achieve a higher frame rate using nicla vision board
this code : max 20.8 fps
import sensor
import image
import time
import utime

sensor.__write_reg(0xf8, 0x8b)
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # Set the pixel format to RGB565
sensor.set_framesize(sensor.QVGA) # Set the frame size to QVGA (320x240)

x = -320
y = -240
x_sign = 4
y_sign = 4

while True:
start_time = utime.ticks_ms()

img = sensor.snapshot()
sensor.ioctl(sensor.IOCTL_GET_READOUT_WINDOW, (x, y, 320, 240))
x += x_sign
y += y_sign
if abs(x) == 320:
    x_sign = -x_sign
if abs(y) == 240:
    y_sign = -y_sign

end_time = utime.ticks_ms()
elapsed_time = utime.ticks_diff(end_time, start_time)
fps = 1000 / elapsed_time  # Calculate frames per second

print("FPS:", fps)

Hi, the default driver sets the sensor max FPS more or less already.

We were approached last year by someone who asked me to improve the performance. I was able to get it up to 80 FPS. However, the image is very corrupt at the edges and bayer only.

Pushing it faster than where it’s at now will just result in image issues and etc.

Could you elaborate on the previous attempt to increase the frame rate to 80 FPS on the Nicla Vision Board? Specifically, what methods or optimizations were implemented, and what were the observed challenges or limitations, particularly concerning image quality and processing?

If you put the camera into bayer mode you can turn the PLL freq up on it. You also need to enable image downsampling.

Note, after doing this the image will look like liquid garbage along with corrupted pixels on it’s borders. However, it’s still a valid “image” so, if you then do “binary()” on it or find_blobs() you can extract movement of colors and etc. to do some type of image processing.

Finally, the res will be like 160x120 for this.