cv.jit.blob.bounds.draw: how to extract values of DIFFERENT blobs?

Mar 24, 2010 at 2:13am

cv.jit.blob.bounds.draw: how to extract values of DIFFERENT blobs?

hi there.
i was looking for a way to extract from jit.cv.cellblocks
the values of left,top,right and bottom coordinates of just the FIRST blob..
i know how to exrtract the number of the
last blob detected and their coordinates( by jit.iter and unpack the first 3 values),
but then i could not find a way to have the different ones distinguished between
multiple blobs detected..
is there a way to do it?

thank you very much.

federico

#49319
Mar 24, 2010 at 3:04am

I actually just made an example for blob bounds..does this help? each of the 4 colors are each coordinate and there are 4 values for each one so you could see the values for 4 sepearate blobs..if you want more just add more options to unpack..jit.spill is what you want to get stuff out of cellblocks:

– Pasted Max Patch, click to expand. –
#177201
Mar 24, 2010 at 1:57pm

thank you so much mate!, it was very useful your tip, and very fast the answer as well!
just one thing:
when it detects more than one blob, the detector gets confused.
when i’m trying to get the values of the first one only and on the detection there are more
than one, the first values of the jit.spill/unpack try to track the last blob anyway..
but i guess is a problem of the object itself…

cheers

fede

#177202
Mar 29, 2010 at 9:55am

the cv.jit.blobs.centroids tracks blobs left to right, top to bottom. so, yes, if your blobs cross over each other’s X axis, their order will get switched. I ran into this problem when the order was essential in my tracking, and still haven’t found an answer… though cv.jit.label can help.

#177203
Mar 10, 2011 at 7:23pm

this is really helpful for me, too. i’m trying to get to a point where the size of a single blob can be determined…

#177204
Apr 11, 2012 at 4:00am

Hey :) Sorry Im still a complete noob at this.

With the example, which is the left, top, right and bottom coordinates? Are each of the different coloured sections giving these coordinates correspondingly? (Like red=left, green=top, blue=right, orange=bottom?) And if so what are the 4 values they are outputting? So then if there is only one bounding box, shouldnt each plane (each colour) be unpacking only one value?

Or is each colour for a different blob, and is thus unpacking left, top, right, and bottom coordinates for 4 blobs each?

Sorry if this is a real dumb question but I would REALLY appreciate the help! :)

#177205
Oct 2, 2012 at 5:20am

@ANNEKE Yes, you understood it right : red = left, green=top, etc…
In this case, jit.spill will output a list whose size or quantity of values is equal to the amount of blobs found.
If you use the arrows.gif file, jit.spill @plane 0 will output one value per blob(arrow) – 10 values (left coordinates) according to your settings.

jit.spill @plane 4 will output the first plane (0), with an offset of one value, jit.spill @plane 8 with an offset of two values and so on…

If you connect the output of cv.jit.blobs.bounds to the jit.iter object, you can join the number of the blob and its coordinates.
This small code below does that : outputs a list with five values The first is the number of the blob (remember -> left to right, top to bottom) and it’s coordinates.

Best,
Rafael

[code]

-- Pasted Max Patch, click to expand. --

[/code]

#177206

You must be logged in to reply to this topic.