thanks for the javascript page

jersmi's picture

just wanted to express my appreciation for the javascript tutorial. as i get deeper into this computer video world and see the stuff going on with javascript in these forums / examples, in the apple mailing lists, max/msp/jitter, et al., your generosity, mr. wright (if that is indeed your real name :), is greatly appreciated.

so now i am trying to unravel apple's optical flow javascript example. any insights would be welcomed how that one is working. there's a lot for me to learn there.

jersmi's picture
ps

oh, and thanks to cybero for his addition to the page about javascript strings. if it wasn't for his entry i would not have known the page was up. which brings up the topic, how does one find this page from the kineme home page (search, i guess). suggestion: maybe it could be linked to the patches wiki where smokris' entry is? that one's also useful...

gtoledo3's picture
Re: ps

You look at the talk section at the bottom of the wiki... that kind of prevents stuff that isn't totally vetted from instantly being part of the wiki, as is norm. The main wiki link itself is via the sidebar. It's in the "using Quartz Composer section" probably b/c it goes a bit more in depth than is called for with the patch wiki section.

I haven't had a chance to look at the stuff that cybero posted.... Good on you cybero! Awesome.

What are you trying to do with the optical flow that isn't covered by the dev example?

jersmi's picture
Re: ps

thanks for the reply.

first off, i just want to understand wtf is going on. the openCV stuff, optical flow, etc., is especially cool to me, so this is one place where i jump into deeper waters. next, i thought it could be interesting to try and combine the optical flow stuff with kineme particles, although it looks likely that my mbp / ati X1600 card may not keep up. for one thing my laptop does not do 32-bit, as i found out with the northern lights stuff. and of course designing lean is always a challenge, but especially at my level. also, i am interested in some of the stuff i am seeing on memo's vimeo page with particles / (what looks like) optical flow / cv / don't remeber without looking. so this is where i'm at. btw, i have in mind video work for dance-- i have friends willing to experiment. :)

jersmi's picture
Re: ps

btw, i see that the optical flow javascript patch is a vector field algo (this math i have to study, for sure). question: what are the "p's" in the variables? pixel location?

cybero's picture
Optical Flow JavaScript Patch - What are the 'p' and 's' for

I'm a little confused about which file you are seeking clarification upon..

I can't find an Optical Flow Developer's example that actually uses JavaScript.

Although Teapottil uses some JavaScript, I find Optical Flow to be basically CoreImage filters , Iterators, Structures & so on and so on.

Position & Speed, if it's anything like the TeapottII Optical Flow file that I have in my Developer /Examples / Quartz Composer / Plugins folder :-)

It does have Position & Speed one one of the Script patches, but it doesn't have 'p' or 's' as such in any Script patches it uses.

Having said that, I'm still confused, as that file doesn't actually seem to have any such variables - boy am I scratching around on this one. Mightily puzzled about this indeed...

Is it actually the OpenCV optical flow related example with Hough Lines tracking motion?

I await clarification and enlightenment on this matter :-)

Actually - looking through all that you have posted up , if you haven't sought and found this then I heartily recommend you do - looks to me like this exemplifies a whole lot of what you are actually seeking to achieve, if I've at least managed to understand what you are interested in.

It's Optical Flow with Kineme Particles Flattened by gtoledo

gtoledo3's picture
Re: Optical Flow JavaScript Patch - What are the 'p' and ...

Yep cybero, I'm with you... I got home at around 3:30 am-ish last night, and was like "where the frick is the javascript that he is talking about?". I hesitated to reply given the fact that I was looking at it at 3:30am after a set at a local bar... not the best time to write responses :o)

I even opened up the teapotii example to see if that's what he's talking about.... but I'm pretty darn familiar with that one and didn't think so... btw, the javascript in that one isn't necessary for motion tracking, it's a bit incidental, and just does the friction and bounce stuff (as I'm sure many of you already know).

I THINK what he's talking about is the CI patch in the Optical Flow.qtz? Yea or nay? I'll await a response on that one....

I flattened the referenced qtz simply for performance reasons... I was on a kick of flattening stuff for awhile, and also experimenting with laying patches on top of one another, or edging them up to slightly overlap so that there is no noodle-age. If it would be beneficial for me to dig out an unflattened version let me know. When you open up any Optical Flow thing, queue patches usually cause a lag. I think I was experiencing a placebo effect that made me feel like flattening it shortened the lag. I don't know if that is really true though.

I was feeling like it made a difference and averages out performance with some things. That said, I've never tested that theory since the Performance Inspector came out (which makes me feel like a bit of an ass, the Performance Inspector is awesome). [This reminds me that I need to do an OpenGL Profile on something else that I forgot about, glad I read this :o) ]

jersmi's picture
Re: Optical Flow JavaScript Patch - What are the 'p' and ...

Ahh! So sorry-- it is the Optical Flow CI Filter patch! Sorry about that... I was looking simultaneously at both the OpticalFlow.qtz and Teapotii.qtz (which is full of javascript) when i posted and forgot that it was a CI Filter patch...

yikes...

jersmi's picture
Re: Optical Flow JavaScript Patch - What are the 'p' and ...

now that i have my brain on straight, i did just look again at the flattened teapotii.qtz mod and see what gt was up to. i looked at it a while back and now i understand a lot more, so that's good. i think i'm a little more interested in the possibilities of combining particles with the OpticalFlow.qtz for my first idea, but i see now how it's possible using the existing CI Optical Flow patch, etc.

thanks again for assisting with my baby steps. my process is messy!