LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Pattern Matching Parallel Processing

I have developed a IMAQ pattern matching program that analysis images from a .avi file.  In it use there are up (but not limited) to 22 matching template pattern used, each with a (their own) set area of the image to search. 

At the moment the pattern matching process is sequential that is read the image from the avi file

  • perform the pattern matching process with template No 1
  • save position found
  • Repeat until are templates are used
  • Read another image and repeat the pattern matching process until all the images are analysed.

With the present computer system it takes about 46 ms to read the image and 10 ms per templates match with a quad-core computer working about 30%.

 

Now the question is how to reduce the processing time.  I will pursue reading the image from the avi file while the pattern matching process is going on (I assume that these two processes will be on separate threads within the same For loop 😉 ).  Another solution, is to replace the spinning storage disk with a SSD.  I may try that one first since it is easier. 

 

But the more interesting/difficult questions are:

  • if I use two (or more) instances of the pattern matching dll (wrapped up in a vi), working in parallel loops, will it improve the processing time per frame?
  • If it the pattern matching vi can operate in multi-threaded mode, what need to be set/configured to the vi execution so they will work in separate thread?
  • What otherr condition need to be met for the parallel process to work? (such as work on two instances of the same target image)

 Configuration

Window 10

LabVIEW 2017 (64 bit)

 

Thank in advance

 

Paul A. Rochefort

 

 

 

 

 

0 Kudos
Message 1 of 3
(2,240 Views)

What you may want to do is to "spawn an asynchronous VI" (what I call "spawn a Clone").  For example, I record AVIs of animal behaviors lasting a few seconds, and "capture" about 10-30 behaviors over a 2-hour recording session.  Tedious to do for one animal at a time, so I have 24 cameras, 24 Event Detectors, and collect them all in parallel (on a 7-8 year old PC, yet).  The function you want to learn about is called "Start Asynchronous Call", it is on the Application Palette, and if you search LabVIEW Examples with "Asynchronous", you should find some example code.

 

Bob Schor

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

If the processing happens in a for loop, you can simply configure the for loop for parallel processing. That would give you the answer straight away... Alternatively, you could make a test VI using a parallel for loop simply to check if parallelization would help.

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