Memory read errors with v4.5.2

Openmv H7 Plus using modified example works on older firmware v4.2.3 but non on v4.5.2., loop=False, pause=False) fails with “TypeError: can’t convert Image to int”

Code to reproduce:

# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# Image Memory Stream I/O Example
# This example shows how to use the ImageIO stream to record frames in memory and play them back.
# Note: While this should work on any board, the board should have an SDRAM to be of any use.
import sensor
import image
import time

# Number of frames to pre-allocate and record
N_FRAMES = 500

sensor.reset()  # Reset and initialize the sensor.
sensor.set_framesize(sensor.QQQVGA) #resolution

# This frame size must match the image size passed to ImageIO
sensor.set_windowing((57, 24))


clock = time.clock()

# Write to memory stream
stream = image.ImageIO((57, 24, sensor.GRAYSCALE), N_FRAMES)

for i in range(0, N_FRAMES):
current_frame =, loop=False, pause=False)

while True:
    # Rewind stream and play back
    for i in range(0, N_FRAMES):
        img =, loop=False, pause=False)
        # Do machine vision algorithms on the image here.

Hi, the API changed.

We removed copy_to_fb copying directory to images. You can pass True to False. But, not another image object. This feature was to hard to maintain and creates mind-bending code complexity.

@kwagyeman a) Could you please let me know the latest firmware version where I can pass another image object in the function. and b) an alterative way to realize the same thing with other functions ? Thanks.


a) This is detailed in the release notes for each firmware. Look for any changes related to the Image() method.
b) Just copy it to the main frame buffer and then use the replace()/assign()/set() methods to copy to the target buffer. Yes, this is technically another copy. This will be the functionality for the mean time.