Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
22nd May 2007, 11:58 | #1 | Link |
I'm a newb, NOT a noob
Join Date: Mar 2007
Location: Next door
Posts: 86
|
Creating a mask from the differences between two clips
Topic says it all. I've Googled and searched for hours in vain. Maybe I'm just not using the right terminology, but how can I create a mask based on the absolute differences between two clips?
|
22nd May 2007, 23:37 | #2 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
Code:
c1 = #insert first clip here c2 = #insert second clip here yv12lutxy(c1, c2, "x y - abs 255 *", u=3, v=3) |
23rd May 2007, 02:41 | #3 | Link |
I'm a newb, NOT a noob
Join Date: Mar 2007
Location: Next door
Posts: 86
|
I don't know; I think I'm a little lost, as this is my first time using masks. Here's the function I'm trying to write. (It's meant to look for differences between an original clip and a filtered one, apply a threshold to them to binarize them and then expand the different areas.
Code:
function DifferentAreas(clip original, clip filtered) { #Get the differences between the clips difference = yv12lutxy(original, filtered, "x y - abs", u=3, v=3) #Apply a threshold - pixels with a Y value under 40 will be black; #pixels with a Y value of 40 or higher will be white difference = difference.YV12LUT("x 40 < 0 255 ?", u=-128, v=-128) #Expand the differences - this is where the problem starts difference = difference.Expand() return difference } |
|
|