This question is an exact duplicate of:
I am doing an animation with a camera to add 3D elements to it (don't really know what it is called) As you can see in the picture above, i am trying to use nodes to assemble my shadow, object and background for the final render, but for my shadow, some of the plane is still visible... I tried using a "Dilate/Erate" node to mask the plane but it ends up also hiding the shadow.
Do you guys have any idea on how I can fix this? Thank you