cv.jit.blobs.bounds query

Jazz's icon

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

Jean-Marc Pelletier's icon

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:

Max Patch
Copy patch and select New From Clipboard in Max.