Pyb module for data transfer from the camera to the

Hi, I’m trying to transfer data from the OpenMV camera to my computer via USB. In particular, I’m getting real-time values of the position of some LED blobs using the camera and now I want to transfer those values to python in my computer in order to make some calculations that the microprocessor is not able to do by itself.
I was trying to implement the RPC library as shown as follows (this is a test function which aims to transfer a vector of numbers), but I’m getting an error: “ImportError: no module named ‘pyb’”. How could I fix it? Thank you so much.


image

Hi, the RPC library doesn’t fully support the RT1062. It has complete support for the H7 Plus though right now.

Anyway, you can just print() values. Then on the COM port the camera represents on your PC and you’ll get data.

See our GitHub openmv repo Readme. It’s 4 lines of Python code to receive what the camera sends on the PC.

Hi, sorry for the delay in answering. The problem is that what I am trying to do is getting some numeric values from the images captured by the MV Camera and then I want to solve a system of equations which the sd card of the microcontroller can not support, so I need to send it to Python or Matlab in order to solve it. However, I need to do it real-time. But if I use the print() method, I can’t use the same port as the one the camera is connected to, as it is getting new data from each frame captured at each time-step.

Is there any way of transfering those numeric values from the camera to python at the same time that the camera is capturing images?

thank you so much in advance

Hi, you just save your script to the camera so it runs automatically and then just open the port in another Python program as you can see the print values.