I'm trying to send images (4000, 3000, 3) between two processes. My first process acquires the image with a camera, attaches to it some metadata, another image and then sends the whole thing to the second process, which processes it.
I want to have a maximal delay of 0.2 seconds between the moment the image is acquired and the moment the processing is over.
Let's assume the way I acquire and process the image is optimal.
I tried 2 methods to send the image, with a queue (mp.Queue
) and with a shared array (mp.Array('i', 4000*3000*3)
)
Both took to much time.
The Queue.put()
method takes about 0.5 seconds to send the package.
Copying the image in a shared array like this:
shared_array[:] = img.copy()
Takes about 2 seconds.
So my question is, is anyone aware of a faster way to transit two images between two processes?
Thanks for your time!