1 | initial version |
I have solved my problem. I compiled Opencv with the option WITH_OPENMP. My computer was using 8 threads. I forced it to use 1 thread (with the code lign : omp_set_num_threads(1);) and my execution is faster now and stable. On the chart below, I call 1000 times the function warpaffine with one thread (blue dots) and with 8 threads (red dots). With 8 threads, the execution time explodes sometimes (the red dots at 5 ms are higher actually, I reduced their values (~50ms) to 5 ms for scaling reason). As I call warpaffine function several times per frame and some other optimized opencv functions, there were some big execution time leaps. Now, the execution time per frame is stable (+- 1ms) and faster (time/2). It's less efficient to use more threads due probably to data transmission.