Ask Your Question

Revision history [back]

with 20% number thread is 5 default value in your configuration with 2 threads cpu is 10% =2/5*20% one core is sleeping

with 4 threads cpu is 17% =4/5*20 all core are working

now your process can be split in two grab and pyrLK. Grab take x% and pyrLK y% x+y=1. I think that grab takes 70% (example) so when you change number of thread you will optimize only pyrLK. 30% of time. Your process is waiting an image and sometime it starts a job

instead of

while (true)
{
    capture >> frame;

do something like this (of course is wrong but I think CPU usage will be 100% with 5 threads)

    capture >> frame;
while (true)
{

if you want to thread and parallel in opencv you can try this program

with 20% number thread is 5 default value in your configuration with 2 threads cpu is 10% =2/5*20% one core is sleeping

with 4 threads cpu is 17% =4/5*20 all core are working

now your process can be split in two grab and pyrLK. Grab take x% and pyrLK y% x+y=1. I think that grab takes 70% (example) so when you change number of thread you will optimize only pyrLK. 30% of time. Your process is waiting an image and sometime it starts a job

instead of

while (true)
{
    capture >> frame;

do something like this (of course is wrong but I think CPU usage will be 100% with 5 threads)

    capture >> frame;
while (true)
{

if you want to test thread and parallel in opencv you can try this program

Another problem I think if you have an opencl video card cpu usage can be wrong

with 20% number thread is 5 default value in your configuration with 2 threads cpu is 10% =2/5*20% one core is sleeping

with 4 threads cpu is 17% =4/5*20 all core are working

now your process can be split in two grab and pyrLK. Grab take x% and pyrLK y% x+y=1. I think that grab takes 70% (example) so when you change number of thread you will optimize only pyrLK. 30% of time. Your process is waiting an image and sometime it starts a job

instead of

while (true)
{
    capture >> frame;

do something like this (of (

of course is wrong but I think CPU usage will be 100% with 5 threads)threads 
)

    capture >> frame;
while (true)
{

if you want to test thread and parallel in opencv you can try this program

Another problem I think if you have an opencl video card cpu usage can be wrong

with 20% number thread is 5 default value in your configuration with 2 threads cpu is 10% =2/5*20% one core is sleeping

with 4 threads cpu is 17% =4/5*20 all core are working

now your process can be split in two grab and pyrLK. Grab take x% and pyrLK y% x+y=1. I think that grab takes 70% (example) so when you change number of thread you will optimize only pyrLK. 30% of time. Your process is waiting an image and sometime it starts a job

instead of

while (true)
{
    capture >> frame;

do something like this (

(  of course it is wrong only first frame is capture  but I think CPU usage will be 100% with 5 threads 
threads)

    capture >> frame;
while (true)
{

if you want to test thread and parallel in opencv you can try this program

Another problem I think if you have an opencl video card cpu usage can be wrong

with 20% number thread is 5 default value in your configuration with 2 threads cpu is 10% =2/5*20% one core is sleeping

with 4 threads cpu is 17% =4/5*20 all core are working

now your process can be split in two grab and pyrLK. Grab take x% and pyrLK y% x+y=1. I think that grab takes 70% (example) so when you change number of thread you will optimize only pyrLK. 30% of time. Your process is waiting an image and sometime it starts a job

instead of

while (true)
{
    capture >> frame;

do something like this ( of course it is wrong only first frame is capture but I think CPU usage will be 100% with 5 threads)

    capture >> frame;
while (true)
{

if If you want to test minimize CPU usage one thread and parallel in opencv you can try this programinsert a sleep !

Another problem I think if you have an opencl video card cpu usage can be wrong