cv.jit.centroids problem

Nov 17, 2010 at 11:23pm

cv.jit.centroids problem

I’m trying to get the coordinates from cv.jit.centroids, but I’m having some problems.
When I try to get at the coordinates from blob one it is working ok, but when I try to add another blob, then the coordinates are adjusting on blob one and two. What have I done wrong? How do you get to each blob coordinate separately?

– Pasted Max Patch, click to expand. –
#53382
Nov 18, 2010 at 7:15am

You’re not doing anything wrong, though it’s probably easier to use jit.iter instead of jit.spill. The order of the blobs is not guaranteed. Depending on the parameters of cv.jit.label, they will either be ordered from top-left to bottom-right position, or size.

If you need to have consistent positions, consider using cv.jit.touches instead.

Jean-Marc

#192048
Nov 18, 2010 at 7:53pm

Ah yes, I kind of suspected that. I’ll try the jit.touches.
Thanks for your answer and the objects :) Great work!

#192049

You must be logged in to reply to this topic.