I chose to do triangulation matting as described in the lecture notes. Here are the two backgrounds I used:
Here is what the scene I added in front of the two backgrounds looked like:
Here is the new background that I wanted to add these objects to:
And here is the result of adding the objects in:
Any artifacts seen are due to the fact that I was not able to find completely homogeneous backgrounds, so there was noise while computing the alpha matte, which translated into noise in the final image. Perhaps a piece of colored paper that has completely even color would work better.