opencv-python and multi-threading

asked 2019-08-11 23:32:44 -0600

kiet gravatar image

Python has GIL that makes multi-threading is less efficient. Opencv-python will release GIL when calling C/C++ function. Therefore, I think that I can use many threads to run tasks with opencv without lost parallel efficiency. For example, I can run a capture thread, a pre-processing thread and a main processing thread.

Currently, I am using multiprocessing module, it works but I feel tired because of making communication among processes (frame queue on shared memory, or pipe for sending commands). Could some experienced programmers give me some comments about this problem ?

Thanks !

edit retag flag offensive close merge delete