I'm trying to count all non-black pixels in an ROI. Clearly I'm doing something wrong as it causes an exception when I try to use it.
rect = new Rect(touchX-100, touchY-100, 200, 200); Mat roi = grayMat.submat(rect); Imgproc.threshold(roi, roi, 240, 255, Imgproc.THRESH_BINARY); if (Core.countNonZero(roi) > 0){ ... }
I've taken a few different stabs at it and figured I'd just ask.