Multiple Targets in "LabVIEW Sample two-color target tracking code"

Hey all,

My team doesn’t have 2 vision targets and I couldn’t tell by looking at the code; what happens if you have more than 1 distinct vision targets in front of the camera? (Does it return a rectangle covering both of them, or does it lock on to the bigger one, will the area percent include both, what if the 2 are switched, etc.)


The way the example code was written, it will sort by size and then test the particles one at a time. If they overlap, the camera will likely likely see them as one, otherwise it will describe the largest.

If you’d like to get info on more than one, you can change the example to keep looping until you find as many as you like.

Greg McKaskle

So if the targets weren’t overlapping it would just select the larger target?

It will describe the largest based upon the primary color threshold.

Greg McKaskle

A little trick I did, cut some small squares from the fabrics and hold those closer to the lens. Gives you something to work with anyway.


You can see a video demonstration of the multi-target tracking in the middle of this video:

Very cool video! I saw that it was always able to pick the “enemy” target - what if you have 2 enemy targets infront, I assume it picks the larger one? (It doesn’t just think there is a huge target and aim between them?)

At 1:15 there are two enemy targets, and it went for the larger one. It should be impossible to get 2 targets that are the same size and blend together, because of the dimensions of the trailer. And, if you get one trailer in the perfect position behind a trailer so they blend, it’s unlikely to stay that way for very long.