CV.jit.blobs OpenGL problem

Dec 13, 2010 at 3:05pm

CV.jit.blobs OpenGL problem

Hello I have made a patch that uses CV.jit.blobs detection and openGL.

I have 2 xy coords moving to seperate balls in openGL.

however when the balls cross each other on the XY grid they swap colours.

does anyone know why this may be happening?

this is the patch.
it is a little messy at the moment but you can see where the OPenGl renders the image
and the co-ordinates of each blob.

– Pasted Max Patch, click to expand. –

hope you can help.

#53863
Dec 13, 2010 at 3:52pm

I seem to have located the problem.

I use ‘jit.spill’ to get the seperate planes for X1-Y1 and X2-Y2 and then I ‘unpack’ these numbers to get individual co-ordinates.

with the ‘unpack’ object the X2-Y2 co-ordinates do not reset back to zero when I remove my hands from the touch screen.
is there a reason for this?

and are there alternatives to ‘unpack’

#193902
Dec 13, 2010 at 11:25pm

I believe with cv.jit.blobs that if there are no blobs the first blob output reads 0. the other blobs that have ‘disappeared’ will not have reverted to 0., so the last figure they outputted will be left in [unpack]. You could check for lack of change and say ‘if there is no change then output 0.’ [changelist] in jasch objects might be good for this.

Also, are you aware that the blobs in cv.jit.blobs will not be kept in order so 2 could become 1 all of a sudden (based on size). I see you have cv.jit.touches in your patch, but looks like you are not using for the gl.objects, it might be more suitable for your application?

#193903
Dec 15, 2010 at 12:12am

Thanks for this.

so this is why the colour changes/ I get this.
will try changlist tomorrow and also take a look again at cv.jit.touches.

thanks for pointing me in the right direction.

craig

#193904

You must be logged in to reply to this topic.