inconsistent behavior about ROI calculation
As we know:
Mat img(7, 8, CV_8UC1, Scalar(0));
Mat com = (Mat_<uchar>(4, 3) << 255, 0, 0, 255, 255, 0, 255, 255, 0, 255, 255, 255);
img(Rect(1, 2, 3, 4)) += com;
We will get a img
like this:
This is out understandable behavior because we do a calculation in the same ROI. But why this code:
Mat img(7, 8, CV_8UC1, Scalar(0));
Mat com = (Mat_<uchar>(4, 3) << 255, 0, 0, 255, 255, 0, 255, 255, 0, 255, 255, 255);
img(Rect(1, 2, 3, 4)) = com;
cannot get a same result? The img
is empty image still:
I'm confusion about it. Or do I have missed something?
What result you get with the latter?
@HYPEREGO I have edited the question.