Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Compare value of a 1x1 Mat to an int

I want to compare a 1x1 Mat to an int to see if it passes a threshold. I do not know how to do this on android.

public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
    rgbMat = inputFrame.rgba();
    bgrPixel= rgbMat.submat(1,2,1,2).clone();
    grayPixel = new Mat();
    Imgproc.cvtColor(bgrPixel, grayPixel, Imgproc.COLOR_RGBA2GRAY, 1);
    return rgbMat;
}

Compare value of a 1x1 Mat to an int

I want to compare a 1x1 Mat to an int to see if it passes a threshold. I do not know how to do this on android.

public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
    rgbMat = inputFrame.rgba();
    bgrPixel= rgbMat.submat(1,2,1,2).clone();
    grayPixel = new Mat();
    Imgproc.cvtColor(bgrPixel, grayPixel, Imgproc.COLOR_RGBA2GRAY, 1);
    return rgbMat;
}