Ask Your Question

PJPS's profile - activity

2018-06-12 00:12:32 -0600 received badge  Famous Question (source)
2015-11-15 09:47:07 -0600 received badge  Notable Question (source)
2015-10-05 11:51:06 -0600 received badge  Popular Question (source)
2013-03-04 09:04:36 -0600 received badge  Supporter (source)
2013-03-04 06:55:49 -0600 commented answer Android counting white pixels in binary Mat.

That was exactly it. Thank you very much!

2013-03-04 06:55:06 -0600 received badge  Scholar (source)
2013-03-03 21:57:57 -0600 received badge  Student (source)
2013-03-03 13:20:42 -0600 commented question OpenCV JavaCameraView is not full screen

Take a look at the color blob detection sample, it is full screen. I haven't checked out much of it, I just recall that being a difference between the HelloWorld and that sample. Sorry I can't help more.

2013-03-02 20:58:02 -0600 commented question Android counting white pixels in binary Mat.

Thank you for the suggestion, but that doesn't appear to be it. Cheers :-)

2013-03-02 11:32:53 -0600 received badge  Editor (source)
2013-03-02 11:32:19 -0600 asked a question Android counting white pixels in binary Mat.

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){
...
}

The countNonZero throws the exception

OpenCV Error: Assertion failed (src.channels() == 1 && func != 0) in int cv::countNonZero(cv::InputArray), file /home/reports/ci/slave/50-SDK/opencv/modules/core/src/stat.cpp, line 496

I'm too dumb to interpret the exception :P. I've taken a few different stabs at it and figured I'd just ask.