Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

your mask is not initialized properly. it has the right size / type, but the pixels contain uninitialized data.

Mat mask = Mat.zeros(submatrix.rows(), submatrix.cols(), CvType.CV_8UC1);

should do , what you want.