1 | initial version |
please do not abuse Mat::at to manipulate whole images, as it is slow and error-prone.
your image has 3 channels, thus you (would) have to use img.at<Vec3b>
, not img.at<uchar>
but again, to set a whole image to white, rather use:
img.setTo(Scalar::all(255));
or even:
img = Scalar::all(255);
2 | No.2 Revision |
please do not abuse Mat::at to manipulate whole images, as it is slow and error-prone.
your image has 3 channels, thus you (would) have to use img.at<Vec3b>
, not img.at<uchar>
but again, to set a whole image to white, rather use:
img.setTo(Scalar::all(255));
img.setTo(Scalar(255,255,255));
or even:
img = Scalar::all(255);