I've made a little "object detection" demo, that shows an approach to object detection based on storing texture offscreen.
By looking up color values that are stored in a separate offscreen texture, one can use color detection to keep track of object id's. This uses primary colors, and is the simplest implementation.
If one wanted to add more steps of complexity, one needs to test conditional for the whole color vec4, instead of whether or not a given primary color bit is off/on. That's pretty simple, but overly complex for the sake of illustration of the principle.
The extrapolation of this, is that this premise can actually be used to detect what every piece of a body is(!) *if* you understand how to color code a moving body and keep the color on it as it moves all around (which I thankfully do). Yep!
The composition is at http://www.box.net/shared/qpxj57oqsy
NOTE: As implemented, keep your texture and rendering destination square.