Frame difference percentage

Anthony Palomba's icon

Hey folks, I want to detect any large changes between video frames. Is there a way in jitter that will give you the percent difference between the current frame and the previous frame, such that 0% difference means the frames are the same and 100% means they are totally different.

Thanks,
Anthony

Rob Ramirez's icon

source --> [optional jit.rgb2luma] --> jit.absdiff --> jit.3m

James Harkins's icon

(Necrobump...)

I wouldn't have guessed this because I would have assumed that the second operand of a jit.op would be 0, if no other operand is specified.

So I just tested (with both jit.playlist and jit.movie):

And both grayscale pwindows look the same -- which is what you would expect if it's doing someMatrix absdiff: 0.

Adding a frame delay to the right operand -- where this is probably inelegant, but asking the documentation "what is the best way to do a single-frame delay in Jitter" is a losing game -- does produce what I would expect from a frame differentiator.

(jit.gen is just doing `clip((value - 0.5) * 3 + 0.5, 0, 1)` because jit.brcosa doesn't like luma matrices. There's probably a better way to do that, too, just difficult to find.)

Anyway... I was wondering if there is something terribly obvious that I'm overlooking.

hjh

riccardo dapelo's icon

indeed you're right, you have to subtract frames from the same source:

James Harkins's icon

Ah, [t l l] is what I was looking for. Wish Max had a [t a] (anything) as in Pd.

hjh

Roman Thilenius's icon

[p a a]

____________