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
try:
# 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:
print(line)
else:
# Optionally, you can add a small delay to reduce CPU usage in case of no data
time.sleep(0.01)
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.