You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the way to write directly to shared memory would be to pass a subset of the shared memory buf attribute into the UserMemory object.
Something like this:
frommulitprocessing.shared_memoryimportSharedMemoryfromegrabberimportUserMemory# Assume a 10 pixel image.shm=SharedMemory(create=True, size=100)
img_mem=UserMemory(shm.buf[:10]) # first imageimg_mem=UserMemory(shm.buf[10:20]) # later images offset deeper into memory.
Another note: since we're writing images to buffers, we can remove the need to do any image copies if we simply send over the most recent image directly out of the buffer. We need to track the previous buffer index to have another thread access the right image for a live view. (We could probably do this in the Shared Double Buffer object.)
The eGrabber api showcases an example where you can write to an existing buffer. Pasted below.
It would be a huge win to be able to write this into the shared memory double buffer so that the image would never have to be copied.
Note: that this is only practical if we
The text was updated successfully, but these errors were encountered: