How to fill OpenCV image with one solid color?
If you are using Java for OpenCV, then you can use the following code.
Mat img = src.clone(); //Clone from the original image img.setTo(new Scalar(255,255,255)); //This sets the whole image to white, it is R,G,B value