Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use both cores for one while loop?

Hey!

 

 

I have a simple application. I just acquire image from USB camera and display it. The whole thing is in one while loop. When I run it the frame rate is quite low, around Fps. Also there is a delay in the presented image. When I run the task manager I can see that one core is at 100% and the second one is almost not used at all (2%). What should I do to use the whole processor?

 

 

Matej

0 Kudos
Message 1 of 3
(3,458 Views)

Hi Mate47!

 

From programming perspective, you cannot run a single thread on two cores at a time. (I am sure that experienced IT guys could give you an IT solution, though - disabling multi-core operation)

My recommendation is to use pipelining.

 

Generally, inside a single while loop, you break your sequential programflow (single thread) into a paralell manner communicating via shift registers. The only requirement is to have at least two significant steps in your programming flow. Ie.: Acquire - Analyze; In your case, it might be Acquire - Present.

 

Please, read the following articles/tutorials and you can experiment with example programs entitled! If it doesn't increase throughput, or pipelining is not applicable for your task, please, get back to us and we'll find another solution!

 

Pipelining

Pipelining for Multicore Computers Example

Pipline architecture

 

Best,

Matyas

 

0 Kudos
Message 2 of 3
(3,425 Views)

Maybe you could show your code so we might be able to suggest a solution to make it faster? If you are only acquiring and displaying you should be able to this with minimal CPU load.

 

Eric

0 Kudos
Message 3 of 3
(3,413 Views)