Raoul
Raoul

Reputation: 1892

Picklable image in python

Does anyone know of a method to make images picklable? I am trying to pass OpenCV images between processes to separate display from real-time processing of an OpenCV video. I have tried PIL Image.tostring(), but to no avail. Is there a standard technique?

Upvotes: 1

Views: 180

Answers (2)

Velimir Mlaker
Velimir Mlaker

Reputation: 10975

OpenCV's newer cv2 module uses NumPy arrays, which are inherently pickleable. See my answer here: https://stackoverflow.com/a/17054961/1510289

Upvotes: 0

PurityLake
PurityLake

Reputation: 1120

This is what you are looking for: pickleable image object

Making it a dict and then using the information in the dict to recreate the image again. Hopefully this helps

Upvotes: 1

Related Questions