Colour tracking with a webcam in Jitter
Is it possible to do this with jitter?
I tried to replace the jit.qt.movie in tutorial25 with jit.dx.grab but that doesnt seem to work?
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!!
You may also want to check out cv.jit.*
@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 jit.qt.movie with a jit.dx.grab but this will probably too simplistic?
My jit.findbounds values stay on -1.
Thx for the replies!
I'm trying to do the same as he is doing, but my valeus stay at -1
try the below. Works great for me...
cool, works great.
how do you change the padding of the color ?
can't understand the little formula you made there :D
[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
HTH
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,
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 ;)
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
J
Hey
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?
J
I have noticed the max window is outputting, "could not build preview graph"
what does that mean?
j
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"!)
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.
Joe, please make for me a screenshot of your patch with parameters (min and max, etc.). I'm sure we can find a solution ;-)
And test attached patch:
that patch works perfectly!
what colour is it tracking though?
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.
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 ;-)
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?
Interesting... I think I can return to the patch tomorrow ;-)
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.
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
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).
Hi
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
J
Joe!
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.
Yaniki - this patch just saved me an entire day! Thank you!
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???