Forums > Jitter

CV.jit.blobs OpenGL problem

December 13, 2010 | 3:05 pm

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.


December 13, 2010 | 3:52 pm

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’


December 13, 2010 | 11:25 pm

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?


December 15, 2010 | 12:12 am

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


Viewing 4 posts - 1 through 4 (of 4 total)