Ask Your Question

Revision history [back]

" Some problem has occur" must we guess it?

a mask is binary 0 or non zero and it should be uchar

Mat mask = (Mat_<uchar>(3, 3) << 1, 1, 1, 0, 1, 1, 1, 0, 0);
Mat_<float> m(3, 3);
m << 1.0f, 2.0f, 3.9f, 4.0f, 5.0f, 6.0f, 7.7f, 8.0f, 9.0f;
Mat m2;
m.copyTo(m2, mask);

becarefull some values of m2 are not initiliased

" Some problem has occur" must we guess it?

a mask is binary 0 or non zero and it should be uchar

Mat mask = (Mat_<uchar>(3, 3) << 1, 1, 1, 0, 1, 1, 1, 0, 0);
Mat_<float> m(3, 3);
m << 1.0f, 2.0f, 3.9f, 4.0f, 5.0f, 6.0f, 7.7f, 8.0f, 9.0f;
Mat m2;
m.copyTo(m2, mask);

becarefull some values of m2 are not initiliased

I think books are always necessary : Learning OpenCV: Computer Vision with the OpenCV Library Par Gary Bradski,Adrian Kaehler

image description