Color Tracking with cv.jit.blobs.bounds?
I'm trying to achieve the same type of color tracking that one can do with [jit.findbounds] but I need to track multiple points at the same time - not a single rectangle. Will [cv.jit.blobs.bounds] help facilitate this? or is it the wrong object for the job? I can't figure out how to make it color selective.
thanx
Hey,
I'm rather new to Jitter myself so my ideas probably aren't the best ones to use. But for what it's worth, I would try:
1. If the numerous points have different colors -- use multiple jit.findbounds objects simultaneously, specify a different color for each one.
2. If the numerous points share the same color, but are spatially isolated in different regions -- play the video through multiple matrices, on each one crop it so it only shows one of the points that you are trying to track, then run them through multiple jit,findbounds objects.
Again, there are probably much better solutions to your problems, but this is what I'd do.
p.s.
Try searching this place for some answers: http://opencv.willowgarage.com/wiki/Welcome
I think cv.jit.blobs.bounds/centroids will only track grayscale, or technically it uses a number threshold on only one plane, so your image will look grayscale in the pwindow or wherever it is.
You can have two matrices going at once: the original with all the colors, and a grayscale [jit.rgb2luma] one for the cv stuff. Try the recently-added cv.jit.touches to make your indexing consistent. Then with the values you get out for the blob positions, you can use [getcell] on your original color matrix (after scaling the 0.0 to 1.0 values you get for the X and Y from cv.jit to the resolution of your matrix, so something like [scale 0.0 1.0 0 320] for X and [scale 0.0 1.0 0 240] for Y). The values from your [getcell] will give you the ARGB at that blob center, which you can use to distinguish colors.
The multiple jit.findbounds would also work, though I think the cv is better optimized for this sort of thing.