I’m new to C4D and I’m betting that someone else has a better method than this but this is what I would do.
- Recreate your set in 3D with the exact same measurements or a scale multiplier (e.g. 10x) of those measurements. Texture all the objects with a checkerboard pattern. (Available as a procedural texture within C4D). You might want to set the transparency to 70% or so so you can see through the objects somewhat.
- Create a background object in C4D and texture the color channel (disable Specular) with one of your images.
- Create a camera and move it so that the the 3D model aligns with the background object image. Focal length and such should match as close as possible.
- Now create a white texture and apply that to all surfaces. (Replace the checkerboard).
- Light as normal with shadows turned on. This will allow you to create whatever shadow effects you desire.
- Add Compositing and External Compositing tags to each object in the scene. Create object buffers for each one.
- Render out a shadow pass.
- Render out alpha hold out mattes (or just one combined one) using the object buffers.
- Import into your favorite compositng program and composite over your image.