cv.jit.touches.recycle bug?


    Jul 22 2014 | 3:12 pm
    Question about the cv.jit.touches.recycle of Jean Marc Pelletier
    In the recycling I miss the first ID (0) in my list. If i got two ID's (0 and 1) and 0 is suddenly gone, 1 stays. I want that ID 1 recycles to ID 0. How can I accomplish that?
    I attached the example patch from Pelletier with an example what i mean.
    Thanks in advance!

    • Jul 22 2014 | 11:23 pm
      Not a direct answer to what you're asking I'm sorry. but just for info, in case there's a bug is in cv.jit.touches.recycle and not in your patch : for the same purpose (recycling indices) but with touch tablets, I was before using a modified version of cv.jit.touches.recycle. I recently replaced it by a javascript which is IMHO more readable than the recycle abstraction. So if you feel comfortable with javascript it should be pretty easy to modify it to make it work with cv.jit.touches I think. you'll find it (s2m.recycleFingersIDs.js) in there in case you're interested: http://metason.cnrs-mrs.fr/Resultats/MaxMSP/s2m.wacomtouchV1.1.zip
    • Jul 23 2014 | 9:48 am
      Thanks for your reply! I don't know if it's a bug or it's the behaviour of the object, but i like to know a workaround.
      I will explain what i'm trying to do:
      I use the recycling not for a touchscreen solution, but for video blob tracking with ID labels. I have to follow a blob, not target the biggest or in order from left to right. Blobtracking in combination with the cv.jit.touches.recycle object i could follow just the first blob no matters its size or position. If i use cv.jit.blobs.sort the cv.jit.label mode order (biggest blob or left to right) keeps active, which i don't want. Different blobs can become one by moving around, in that case if the blobs separate again i want to follow one blob, no matter it's size or position.
      I'm not good in Javascript unfortunately. I tried you're patch but probably i'm missing something. I don't know how the data normally comes from the s2m.wacomtouch. I tried to put in coordinates in the s2m.recycleFingersIDs.js but it looks like only the drawLCD is working. Do you know how s2m.recycleFingersIDs.js want it's coordinates to receive? Probably i'm missing something with i suppose?
      I attached the patch with the example.
    • Jul 23 2014 | 10:53 am
      ok, I had a quick look at the first patch you posted. Your issue is definitely not related to cv.jit.touches.recycle. It's just the behaviour of cv.jit.touches I guess : it keeps the blob 2 and not the blob 0 because the blob 2 is much closer to the new blob position you give than the blob 0. That sounds fine no?
      So my javascript won't help you here, as it has the exact same behavior as cv.jit.touches.recycle. but in case someone is interested, here is how you would use it as a replacement of cv.jit.touches.recycle without modifying the javascript :
    • Jul 23 2014 | 11:09 am
      Thanks a lot for your quick response! That make sense, with knowing this i think will be able to make it work to keep follow an active blob.