color tracking and masking for multiple objects

mrmorrisplains's icon

i have a friend who would like a patch that is able to identify all of the red objects in a video and mask everything else in the frame.
i've used the basic color-tracking features in jitter before, but i'm not sure how to integrate it to work with multiple objects of a similar color or how to make a mask that conforms to the shape, rather than producing a rectangle around the color.
i know that the jit.cv objects have some things that might be functional for this purpose, but i'm not totally sure how to implement them.
any advice would be greatly appreciated. thanks!