Community
cancel
Showing results for 
Search instead for 
Did you mean: 
hitach__0
Beginner
73 Views

Parallel pipeline

I have to use pipeline for video processing, my task is object tracking. For tracking every frame has depend on previous frame. I want to run this part in parallel pipeline. any idea to develop that?
0 Kudos
8 Replies
nagy
New Contributor I
73 Views

I think you need to be a bit more specific on what you want to do and what problems you have. However there is an example in the tbb tutorial document (starting on page 26) that shows an example where tokens depend on previous tokens. Maybe could be useful?
robert-reed
Valued Contributor II
73 Views

Quoting hitach__0
I have to use pipeline for video processing, my task is object tracking. For tracking every frame has depend on previous frame. I want to run this part in parallel pipeline. any idea to develop that?

Understanding the nature of the problem is key. You say every frame depends on the previous frame for object tracking, but where exactly does the dependence lie? Are the image frames themselves complete and uncompressed, or must the frames be preprocessed to unroll motion-estimation data? Can the frames (or some interval of them) reside as uncompressed images in shared memory, where they may be read by multiple threads without slowing each other down? I imagine that object tracking algorithms would be similar to motion-estimation in identifying candidates. Is your image processing object-centric or region-centric (or in basketball terms, are your agents playing zone defense or man-to-man)? Understanding the work at this level may help guide you to an approach to the data flow that will maximize opportunities for independent action of the threads.
hitach__0
Beginner
73 Views

My task is, I have to track object. that means, i have to say object that have appeared in previous frame has appeared in the next frame. For that i am using bounding box overlapping method. that means, i put bounding boxes on blobs that are in t-1 frame, then i read current frame and put bounding box around blobs that are in current frame, if both boxes are merged then i am saying that both blobs are same.
(Here blobs means white color object, this comes after background subtraction.)
simply saying all my current tasks is depend on previous steps.
For that i am using pipeline, because i got better performance (more than 2x) for other steps using pipeline.
Andrey_Marochko
New Contributor III
73 Views

It sound like your pipeline could consist of the following filters sequence:

  1. serial-ordered: read the frame
  2. parallel: subtract background from the frame
  3. parallel: put bounding box on the frame
  4. serial-ordered: match bounding box with the one from the previous frame
  5. ...

hitach__0
Beginner
73 Views

ya your correct, but i dnt like 4th step, can we do it in serial?
Andrey_Marochko
New Contributor III
73 Views

"but i dnt like 4th step, can we do it in serial?"

"serial-ordered" exactly means that each next frame is processed only after the previous one was processed by this filter. Isn't it what you need?
hitach__0
Beginner
73 Views

ya i know that method and i am doing that for reading file, but this method may delay my task. thats y i am asking can we do it in parallel as inparallel_reduce (calculating sum) example in tbb tutorial document?
Andrey_Marochko
New Contributor III
73 Views

If you have all the frames ready before your computation with random access to any of them, and if the result of your bounding boxes matching between frames {N, N+1} does not depend on the result of matching for {N-1, N} pair, then you could use tbb::parallel_reduce.

Otherwise you have to use tbb::pipeline. Prallel stages in the middle of it will ensure the high level of the hardware utilization (provided there is enough work on these stages).

Just to clear up possible misunderstanding, when a serial ordered filter 4 is being executed for the frame N, other stages will be processing frames N+1, N+2, etc. filling up machine's computational capacity.
Reply