Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv-python and multi-threading

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 !