cv.jit.faces + jit.grab + exportimage

peterhorvath's icon

hello,

my patch is detecting faces with [cv.jit.faces].

i am also using [exportimage /Users/xxx/photo jpeg] with [jit.qt.grab]

i am interested in adding a sequential variable to the end of the filename. currently it overwrites the same image.

i have tried something like this [exportimage /Users/xxx/photo $1 jpeg].

the ultimate goal is to exportimage of a jit.qt.grab every time cv.jit.faces detects a face.

thanks in advance!

here is my patch for reference: http://pastebin.com/m62e3da3c

Zachary Seldess's icon

Check out the sprintf object. I'm guessing your problem is that you have a space between your variable and "photo".

Zachary

peterhorvath's icon

thanks zach, that did the trick!

i'm curious — how can i use a bang on a [counter] only once even if it keeps banging? for example, check if it's the first bang, and if it is, do not accept more bangs for x amount of time.

David Beaudry's icon

check out "onebang"

David

Dg's icon

try [onebang], [speedlim] and else ...

peterhorvath's icon

thanks that worked beautifully with a [counter]

natp's icon

Hi, I see this post is quite old, but I have the same problem and I can't understand the answer about the sprintf because I am new to MAX.

[exportimage /Users/xxx/photo $1 jpeg]

If I just erase the space between photo and the variable then I just have a photo named photo$1

What can be done?

Ty

Andrew Benson's icon

It might be easier to just use the combine object for this stuff.