Forums > Jitter

cv.jit.blobs.bounds query

January 1, 2007 | 10:14 pm

The patch i’m working on is tracking the movement of a person and the white t-shirt he is wearing is clashing with colours of his hands and feet which I am trying to track.

I have used the cv.jit.blobs.bounds object to select the t-shirt and have replaced this region with a black square using the jit.lcd object, which will make colour tracking easier.

The problem I have is that parts of the colours on the person’s hands and feet are also replaced by black squares because parts of them are the same frequency of colour contained in the white t-shirt.

I know that I can single out the bounds of the largest blob by using the jit.op object with the arguement:

jit.op @op == @val 1

However, when I put this object where I thought it would go in the chain of objects, it wouldnt output any values. Having moved the object around the chain of objects, I still can’t work out how to only output the values for the largest 1 or 2 blobs.

If anyone could help me out I would very much appreciate it, I’ve been tearing my hair out over this for ages :(

Jazz


January 2, 2007 | 9:53 pm

I’m not sure from your message exactly where you are going wrong.

This:

[cv.jit.label @charmode 1 @mode 1]
|
[jit.op @op == @val 1]

This will paint the largest blob white and leave everything else black. You can track this blob using either cv.jit.centroids or jit.findbounds.

Now, if you do:
[cv.jit.label @charmode 1 @mode 1]
|
[cv.jit.blobs.bounds]
|
[jit.iter]

You get bounds for every single blob in your image. The first blob that comes out is the biggest, so you can ignore it, using only the others. Like this:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 48 175 29 196617 gate;
#P newex 82 149 27 196617 != 0;
#P newex 67 129 41 196617 jit.iter;
#P newex 67 109 94 196617 cv.jit.blobs.bounds;
#P newex 67 88 165 196617 cv.jit.label @charmode 1 @mode 1;
#P fasten 3 0 4 0 87 171 53 171;
#P connect 2 0 4 1;
#P connect 2 1 3 0;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P window clipboard copycount 5;


Viewing 2 posts - 1 through 2 (of 2 total)