android Aruco. Cannot detect corners ?

asked 2020-09-06 01:41:14 -0600

Nayan826 gravatar image

Hi i am new to OpenCV and trying to to detect aruco marker from

but corner.size() always returns 0

This is the code

  public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
    Mat rgba = inputFrame.rgba();
    Mat gray = new Mat();
    Imgproc.cvtColor(rgba, gray, Imgproc.COLOR_RGBA2GRAY);
    Dictionary dictionary =  Aruco.getPredefinedDictionary(Aruco.DICT_4X4_50);
    Mat ids = new Mat();
    List<Mat> corners = new ArrayList<>();

    Aruco.detectMarkers(gray, dictionary, corners, ids);

    if (corners.size()>0)
        Aruco.drawDetectedMarkers(gray, corners);

    return rgba;
edit retag flag offensive close merge delete