How to best get an BMP image off the H7 board to a PC

Hi -

I have a python application on a PC that process BMP images. I have some code working, but not sure if im doing this the best way. It seems a bit slow compared to the IDE buffer, but granted im spooling the whole ROI and pushing it over serial as hex.

Is there a way to stream or buffer the global shutter image off the H7 via USB or Serial that is “fast as” the buffer image in the IDE? I just dont know what i dont know, im new here and happy to read up on some examples :slight_smile:

snippet of the code i have running on the H7

sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE
sensor.set_framesize(sensor.WVGA2)   # sensor.WVGA2 752x480 resolution for the MT9V034 camera sensor.

start_marker = '*/'
end_marker = '/*'

if not button2.value():  # Check if the button is pressed (active low)

        # Access the raw image data as a bytearray
        raw_buffer = img.bytearray()

        # Get image dimensions
        width = img.width()
        height = img.height()

        # Export the buffer to the print() terminal with markers
        for row in range(height):
            # Extract the row
            row_data = raw_buffer[row * width : (row + 1) * width]
            # Convert the row data to a list of hexadecimal values
            hex_row = ' '.join('{:02X}'.format(byte) for byte in row_data)
            # Print the row as a list of hexadecimal values

Thanks in advance

Yeah, you want to jpeg compress the image. You are basically doing the same thing. But, because the image is uncompressed you are running up against the USB speed limit.

The RT1062 runs at 480 MHz versus 12 MHz for USB. The 40x speedup will allow you to do what you are doing 40x faster.