We didn't track rectangles specifically - we tracked particles. With a good green LED ring around the lens of the camera, we found that it created a pretty distinct color range when reflected off the retroreflective tape (high blue, slightly higher green, low red). The algorithm went something like this:
Code:
-get image from camera
-perform threshold
-convex hull (makes particles a little clearer)
-remove small objects (removes noise and small gaps in particles, since gaps can make IMAQ think that they're separate particles)
-particle size filter (eliminates some more noise)
-get details (distance away & angle)
It calculates the distance based on the height that it sees, because if the camera is at a consistent height, the target's height is unlikely to be distorted, while its width can easily appear to vary with the angle of view.
Now I'm not sure that this is the best strategy, or even if it's really a good one, but with some optimization I got it to process an image in half a second, and provide an accurate distance to within 5 cm. Also, it runs in a separate thread, so that half a second isn't lagging the rest of the cRio
If you want to know anything more about the process (especially distance and angle calculations), just feel free to ask.