Colour tracking with a webcam in Jitter

    Jun 04 2011 | 4:40 pm
    Is it possible to do this with jitter? I tried to replace the in tutorial25 with jit.dx.grab but that doesnt seem to work?

    • Jun 04 2011 | 6:13 pm
      yes of course it's possible. that's why there is a tutorial for it ;) we need a bit more info. what did you try? what didn't work? what were you expecting and what did you get? did you give jit.findbounds good values to track? did you look into [suckah] to get color values for jit.findbounds?
      post a patch!!
    • Jun 04 2011 | 8:47 pm
      You may also want to check out cv.jit.*
    • Jun 05 2011 | 9:30 am
      @MIB I i'm following the tutorial nr 25 from the Jitter Tutorials, but thats not with a webcam but with a normal video. I just replaced the with a jit.dx.grab but this will probably too simplistic? My jit.findbounds values stay on -1.
      Thx for the replies!
    • Jun 05 2011 | 2:51 pm
      I'm trying to do the same as he is doing, but my valeus stay at -1
    • Jun 05 2011 | 6:07 pm
      try the below. Works great for me...
    • Jun 06 2011 | 2:12 pm
      cool, works great. how do you change the padding of the color ? can't understand the little formula you made there :D
    • Jun 06 2011 | 5:34 pm
      [vexpr $f1 - ($f1 * 0.01) @scalarmode 1]
      $f1... take the list from the first inlet $f1 * 0.01 .... get 10% of each element of that list add or subtract the padding to the original list @scalarmode 1... operate on each element of the list
    • Jun 30 2013 | 3:30 pm
      I had a bit of trouble with the patch you posted unfortunately.
      I have converted tutorial 25 to work with webcam video but the tracking of colour isn't working. Could someone have a look at what is wrong with it? And is there a way of setting what colour to look for?
      All the best,
    • Jul 01 2013 | 9:38 pm
      works fine for me when I change it to look for red (I am wearing a red t-shirt right now)... what's the issue?? more info is always good ;)
    • Jul 01 2013 | 10:00 pm
      hmm thats odd. I open webcam and turn it on and I see me moving about.. but not change in numbers :/
      how have you changed it to look for red?
      all the best
    • Jul 03 2013 | 12:17 pm
      still having a bit of trouble with this patch, I think I have set it to search only for red, but I still get no movement from the sliders or floats.
      Any suggestions?
    • Jul 03 2013 | 12:44 pm
      I have noticed the max window is outputting, "could not build preview graph"
      what does that mean?
    • Jul 03 2013 | 1:57 pm
      Hi Joe
      Your patch is working fine on my computer (OSX, Max 6.1.3) - I changed it only a bit:
      - 'cause I'm not using CV I'm using jit.grab - changed "unpack" to "unpack i i" - added manual control for min and max (be sure you always using "1." for alpha value - not "0.1"!)
    • Jul 03 2013 | 2:18 pm
      Hmm this is really odd. I am testing your patch and still getting no tracking. Even when I put a red pen lid right up to the webcam I get no movement of the sliders.
    • Jul 03 2013 | 2:23 pm
      Joe, please make for me a screenshot of your patch with parameters (min and max, etc.). I'm sure we can find a solution ;-)
    • Jul 03 2013 | 2:28 pm
      And test attached patch:
    • Jul 03 2013 | 2:31 pm
      that patch works perfectly!
      what colour is it tracking though?
    • Jul 03 2013 | 2:34 pm
      Just white and light-grey. Your problem is (or was) related to min and max parameters - I have an idea, how to do it, wait a bit for next patch.
    • Jul 03 2013 | 3:00 pm
      A lot of optimisations possible, but this is good enough for beginning...
      Just click on "pwindow" to select color to track and use "tolerance" slider to tune sensitivity of the tracker. And have hun ;-)
    • Jul 03 2013 | 7:06 pm
      Interesting approach, really like the ability to click on the colour to track.
      I am getting some very sporadic results mind, not sure if I have set it up right but I (change in numbers) until the tolerance is increased to about 0.6 and even then I don't think it is tracking what I want it to.
      Any suggestions?
    • Jul 03 2013 | 7:42 pm
      Interesting... I think I can return to the patch tomorrow ;-)
    • Jul 03 2013 | 9:15 pm
      Hmmm... I played with the patch a bit. Maybe i's something wrong with the jit.findbounds (I can reproduce your problem on my computer) or there's a bug in the patch - I'm not sure. But we can workaround this problem anyway.
      Check attached patch - I moved some parts of the work into jit.pix and jit.fastblur objects. Hope, this is helpful.
    • Jul 03 2013 | 10:10 pm
      Its strange because I have built a patch pretty similar to this that tracks my white iphone really well. The patch you posted doesnt seem to track the colour selected.
      Interestingly the data that is produced in the number boxs out of the two unpack i i seems to stay around 200, 60, 277 and 137 even when I change the colour I am looking for..
      Not sure if that helps with your diagnostic of the patch
    • Jul 03 2013 | 10:54 pm
      On my computer I can track selected colour, I'm sure. Please make screenshots of the patch during tracking with source and processed image. I can't reproduce this issue.
      Maybe this is something PC specific or your camera (and lighting condition) is producing noisy image. Try also play with "range" attribute of jit.fastblur (it's simply with attached patch).
    • Jul 04 2013 | 12:45 pm
      Yeah those changes have cleared it right up. thank you so much for your effort.
      I can now change it to fit my patch and get some decent tracking results.
      All the best
    • Jul 04 2013 | 1:29 pm
      Great! That was surprisingly spooky topic... I'm glad we solved all the problems.
      I attached once again a bit cleared version of the patch - maybe it will be inspiring for somebody in the future.
    • Nov 24 2013 | 11:09 pm
      Yaniki - this patch just saved me an entire day! Thank you!
    • May 03 2019 | 11:09 am
      Hi! this patch saved the day for me, is there any way of imputing an audio file into this and when you move the coloured object through the tracker it changed the pitch of the audio???