Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

android Aruco. Cannot detect corners ?

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;