NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
shivels
Posts: 122
0 Kudos

track particles

Hi guys,

 

I have a question about tracking multiple particles in an image.  I coded up a program that will take an image and apply a threshold to the image at each numeric iteration (0-255).  At each iteration, the program thresholds the images at the numeric value (0-255) and then uses the particle analysis report to display the total number of particle.  I also overlap bounding boxes on the image to show the particles being tracked.  The question I have is about how LabVIEW numbers the particles.  At each iteration, the particles change nunmbers.

Ex:

Iteration 56: A particle is given the label number 4

Iteration 57: The same particle is given a new label number 5 

Iteration 58: The same particle is given the new label number 4

 

Is there a way to "tell" LabVIEW that once it finds a particle, to keep the label assigned to that particle constant?

 

Cheers,

Shivels

Trusted Enthusiast
Christian Mergl
Posts: 2,604
0 Kudos

Re: track particles

Hi,

 

With a new threshold value also the number of particles will change.

So with e.g. the first iteration and threshold value X you have 7 particles, with the second iteration and threshold X+1 you might have 8 particles or more or less then 7.

With the number of particles also the indexing might change.

I don't know the way we index particles, but it's not possible to mark a particle permanently with an index using the particle analysis functions.

 

I also don't know another way to accomplish that, but maybe one of the other users here did something similar and can give you some advice.

 

 

Christian

Member
NimbleThink
Posts: 24
0 Kudos

Re: track particles

You might take the P particle positions in image N-1 and the Q particle positions in image N and calculate all the distances between the P points and the Q points (P x Q calculations, however there may be some linear algebra matrix functions which can do this faster).  Then find the smallest distance in the P x Q array and call that a match between a particle in image N-1 and image N.  Then find the next smallest distance, etc. until P or Q (whichever is smaller) particles have been matched between images N-1 and N.


By the way, if you know the maximum speed of particles in your image then you don't need to compare all P particles with all Q particles.  Just compare each of the P particles with only the particles of set Q which are within range such that they could have moved to those new positions.

 

Example:

in image #4 there are two particles of positions 1,1 and 10,12

in image #5 there are three particles of positions 1,2 and 2,3 and 11,12

If you know that particles can't move faster than 4 positions per image capture then clearly you don't need to compare the particle at position 1,1 in image #4 with the particle at position 11,12 in image #5.

 

Regards,

 

Leif Kirschenbaum, Ph.D.

LabVIEW user since 2.0
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page