cv.jit.touches: actual blob count

Jun 27, 2010 at 11:41am

cv.jit.touches: actual blob count

hello!

how do I get the actual blob count out of cv.jit.touches? (total count of actual blobs detected)

as the help file says, “In the context of this object, “blobs” are not connected components”.. hence the [cv.jit.label] -> [jit.3m] method won’t work anymore.

thanks in advance!

-jonas

#51079
Jun 27, 2010 at 1:39pm

Hi,

The object recycles index numbers, so some might be tempted to look at the highest index value, but the problem with this method is that it doesn’t work in situations where, for instance, you have three blobs and one disappears.

The best way is to use the [accum] object. Attach a [t b 1] to the “touch” outlet and a [t b -1] to the “release” outlet. The bangs trigger the accum output and 1 and -1 in/decrement the accumulator (middle inlet). This will give you the number of blobs currently active.

Jean-Marc

#183255
Jun 27, 2010 at 2:00pm

did as told :) thanks, jean-marc!

and a big thank you once more for the new cv.jit package (!)

all the best

-jonas

#183256
Jul 6, 2010 at 6:10am

you can also simply query the coll. that’s how i am doing it and it works great.

-jason

#183257

You must be logged in to reply to this topic.