Remove background from image
Since you already know your background image beforehand, it should be simple. I done many background subtraction before. Here is an example of removal of background by comparison.

    if (newBitmap.Width == backgroundBitmap.Width &amp;&amp; newBitmap.Height == backgroundBitmap.Height)
    {
        for(int x = 0; x &lt; newBitmap.Width; x++)
        {
            for (int y = 0; y &lt; newBitmap.Height; y++)
            {
                Color firstPixel = newBitmap.GetPixel(x, y);
                Color SecondPixel = backgroundBitmap.GetPixel(x, y);  

                int Totalfirst = (int)((firstPixel.R * .3) + (firstPixel.G * .59) + (firstPixel.B * .11));
                int Totalsecond = (int)((SecondPixel.R * .3) + (SecondPixel.G * .59) + (SecondPixel.B * .11));
                if (Totalfirst &lt; Totalsecond )
                {

                    Color WhiteColor = Color.FromArgb(0, 0, 0);
                    newBitmap.SetPixel(x, y, WhiteColor);
                }
                else
                {
                    Color SameColor = Color.FromArgb(firstPixel.R, firstPixel.G, firstPixel.B);
                    newBitmap.SetPixel(x, y, SameColor);
                }

            }
        }
    }
    FinalImage = newBitmap; // after substaction of back ground.
}


This code is just a copy and paste from one of the program I did back then. Note that newBitmap is the image of the object and the background, your second picture. While the backgroundBitmap is well, the background. 

Use this as your reference on how your code should look like for this segment. Should be good enough.

Also, I am new to this website(my first post here), but I think for image processing questions, you can post it to https://stackoverflow.com/questions next time, there will be more people to help you. 

If this method doesn't work, let me know, cause I still got some other methods. But from you question, this should be sufficient.