12-08-2010 03:19 PM
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
12-09-2010 04:22 AM
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
12-09-2010 11:16 AM
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.