Use the Difference Matte to generate a matte clip from two source clips with the same background but different foreground elements.
To access the Difference Matte menu, use:
Batch, then select a node from the Node bin.
Timeline, then use Batch FX (see Creating Batch FX).
Tools, then select from the menu (See Accessing Tools).
This node accepts a front and back clip as input, and outputs a result.
The Difference Matte allows you to remove an image from one context and add it to another. The matte is created using the Tolerance and Softness values that you specify.