I'm interested in developing a PC-side application in Python, to help the user tune parameters and filters for object tracking with the OpenMV M7 camera.
The application will have to display images from the cam so the user can adjust threshold, white balance and other parameters, to optimize the tracking system for their environment. Once the system is configured, the M7 will run autonomously for the remainder of the user session.
My question is about moving image data and parameters between the M7 and the PC-side application.
In several places in the forum, the USB_VCP class is referenced as a way to move data between a serial terminal and the M7 (albeit at the expense of being able to debug in the OpenMV IDE). Presumably, the PC side would use the PySerial class. The M7 could compress frames into jpg, and send them via USB_VCP.
To get started, I wrote a very simple sketch, to exchange a byte:
Code: Select all
import time, pyb myUSB = pyb.USB_VCP() while(True): if myUSB.any(): message = myUSB.read() myUSB.send('X')
Is there any guidance about why I might be seeing this, and more generally, how to have OpenMV talk to an application? I have seen suggestions to use UART and a UART to USB (FTDI) interface - but I am worried that the transfer speed would be impractical for sending image data. Any advice?