MacP1 wrote:
If you have an example of the node tree that would be brilliant.
I've pasted an example script below. For some reason, this forum software adds carriage returns to the RotoShape data, which ruins it. So paste the script into Shake, then create a little triangle in the middle of the RotoShape. That triangle is your actor.
First of all, I've created two fake images (one with a triangle on grey background and one with just the grey backgorund). Then I've added film grain to simulate the real world (you probably have video noise, but the effect is the same). So the outputs of the two film grain nodes represent your original footage. Important note: the two film grain nodes use a different seed value. Otherwise, they would be identical. In the real world noise is different for each frame. This is important.
Just to be clear, you will substitute your two FileIn nodes for the whole Rotoshape/Color/Max/FilmGrain section.
Now for the difference matte. As mentioned in my previous post, you use ISubA to subtract the two images, followed by a LumaKey to actually create a matte. Look at the alpha channel of the LumaKey and try to adjust the loVal and hiVal to get a good key. You'll see how the noise (film grain) is a big problem.
Finally, I use the LumaKey to composite the foreground image against a lovely orange background. You'll see that it does work, but it's not perfect. That's a difference matte example.
Les
Color1 = Color(1280, 720, 1, 0.4, 0.4, 0.4, 1, 0);
Color2 = Color(1280, 720, 1, 1, 0.5, 0, 1, 0);
RotoShape1 = RotoShape(1280, 720, 1, "v4.10", 0, 0, 0, 1, 1,
xScale, width/2, height/2, 0, 0.5, 0, 384, "100W@0B000VDhsuH9RYbMXJCo8QUPcJkW66fOX2cOZe2cwdLnSH198Q8CsQa9SO3XAO6mQgLH1KZ26 15W18QecceNcffdG6a#5bNc#zbl9EAcRHM#vaVpfvqKHf6fbgf26edf2efWcX1v98Qe1seZfd0f6DfqB sHThwmDdkXf2KGDeUpTHGdCSzfbk3xAJQSsbacHsjYGtn6w0dGHSP9PDme2ma5MC0YWR8ZEK98nCZ34V mOYRkm5xB0WY7RW1642q026CmW3EOenBEqmGpTSUGs0W0bM#1IEbIXSpl0lism3i19FIkOvO03s900IG mSY19dB000000000018");
FilmGrain2 = FilmGrain(Color1, "v3.0", 2, 1, 1, 2, "Eastman 5245",
0.031722, 0.020731, 0.047893, 1.14428, 0.993067, 0.997656,
0, 0, 0, 0.091092, 2.671764, 2.903616, 3.183743);
Max1 = Max(RotoShape1, Color1, 1, 100);
FilmGrain1 = FilmGrain(Max1, "v3.0", 2, 1, 1, time, "Eastman 5245",
0.031722, 0.020731, 0.047893, 1.14428, 0.993067, 0.997656,
0, 0, 0, 0.091092, 2.671764, 2.903616, 3.183743);
ISubA1 = ISubA(FilmGrain1, FilmGrain2, 1, 100);
LumaKey1 = LumaKey(ISubA1, 0.2, 0.3, 0, 0, 0);
KeyMix1 = KeyMix(Color2, FilmGrain1, LumaKey1, 1, "A", 100, 0);