opencv Java中的形状检测

时间:2017-11-09 05:08:22

标签: java android opencv shape detection

public Mat onCameraFrame(CvCameraViewFrame inputFrame) {

  // get the camera frame as gray scale image
    Mat gray = null;

    if (DETECT_RED_OBJECTS_ONLY) {
        gray = inputFrame.rgba();
    } else {
        gray = inputFrame.gray();
    }


    // the image to output on the screen in the end
    // -> get the unchanged color image
    Mat dst = inputFrame.rgba();

此处使用代码

  

org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;但我想做这样的事情。我想把这个Android代码转换为opencv java

public static Mat onCameraFrame(Mat inputFrame) {

    Mat gray = null;
if (DETECT_RED_OBJECTS_ONLY) {
    gray = inputFrame.rgba();
} else {
    gray = inputFrame.gray();
}


// the image to output on the screen in the end
// -> get the unchanged color image
Mat dst = inputFrame.rgba();

现在没有这样的事情rgba()& gray()。请任何人帮我解决这个问题

0 个答案:

没有答案