Ask Your Question

mattzap's profile - activity

2016-01-24 22:05:30 -0600 commented question OpenCV Android- Using Imgproc.moments causes crash

Could this be another issue with the android SDK? I know the last release was missing the moments class ENTIRELY.

2016-01-24 20:35:22 -0600 received badge  Editor (source)
2016-01-24 20:34:48 -0600 commented question OpenCV Android- Using Imgproc.moments causes crash

In this case, the code I presented, I was trying contours but was getting the SAME error. I'll change it back to what I had. Doesn't fix anything though. -Updated

2016-01-24 20:24:17 -0600 asked a question OpenCV Android- Using Imgproc.moments causes crash

In OpenCV 3.1, the Moments class is back in the Android SDK. Yay!!!

However, upon calling the Imgproc.moments function, any of the multiple declarations with either contours or masks as parameters, the app crashes. I am unable to find an error in logcat. I do not understand what's going wrong.

Is anyone else getting similar issues?

 cd.caploop();
 //Do image processing
    if (cd.getCon() != null) {
        telemetry.addData("area", "" + Imgproc.contourArea(cd.getCon()));
        Point center;
        //I want to store the centroid of the mask in the point 'center'
        //I also have access to the contour I want to use above
        //but however I try to compute the moments, I get a crash
        Moments m = Imgproc.moments(cd.getConn());
    } else
        telemetry.addData("area", "not detected");
}