A: 

You cannot initialize a Mat expression from an int or double. The solution is to use cv::Scalar, even for single channel Matrices:

Mat M = Mat::ones(Size(100, 100), CV_8U);
M = Scalar::all(255) - M;

See http://opencv.willowgarage.com/documentation/cpp/basic_structures.html#matrix-expressions for a list of possible Mat expressions.

Martin