Sending Image from camera to computer

Hello, I am trying to send the image that is being seen from the OpenMV camera to my computer through serial. I am using the code from the Donkey Car .

I commented out the motor controls I am using the lane detection from the code.

This is the code I am using to send information from the camera but I am stuck trying to figure out how to display the image on the computer without the IDE. I already have the camera running a script when it is plugged in.

import serial
import time

# Configure the serial connection
port = 'COM5'
baudrate = 115200
timeout = 1 # in seconds, adjust if needed

    # Open the serial port
    with serial.Serial(port, baudrate=baudrate, timeout=timeout) as ser:
        print(f"Connected to {port} with baudrate {baudrate}")

        while True:
            # Read a line from the serial port
            line = ser.readline().decode('utf').rstrip()
            if line:
                # Optionally, you can add a small delay to reduce CPU usage in case of no data

except serial.SerialException as e:
    print(f"Error connection to {port}: {e}")

except KeyboardInterrupt:
    print("\nExiting. . .")

I would like to have the image be opened in its own window.

Hi, you have to roll your own way of receiving images via USB. You are free to do whatever. The camera can send jpeg images through the USB port via print() in your code and/or literally anything you want.


We have a debug protocol you can leverage here: openmv/tools/ at master · openmv/openmv (

openmv/tools/ at master · openmv/openmv (

If you don’t want to use that then please search the forums for the many posts where folks ask this and I have provided a response.