answered 2013-06-11 05:09:08 -0600
Try to set your background before image copying:
Mat res(image.size(), image.type()); // fill background res.setTo(Scalar::all(255)); // white // copy foreground image.copyTo(res, binMask);