Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered Apr 20 '16

berak gravatar image

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.