Код: Выделить всё
public class Detector {
private final ArucoDetector detector;
public Detector() {
DetectorParameters param = new DetectorParameters();
Dictionary dict = new Dictionary();
detector = new ArucoDetector(dict, param);
}
public void detect(Mat mat) throws CvException {
ArrayList corners = new ArrayList();
Mat ids = new Mat();
detector.detectMarkers(mat, corners, ids); // Causes exception
System.out.println(ids.size());
}
}
Код: Выделить всё
Exception in thread "main" CvException [org.opencv.core.CvException: cv::Exception: OpenCV(4.9.0) /home/runner/work/opencv/opencv/opencv-4.9.0/modules/objdetect/src/aruco/aruco_detector.cpp:399: error: (-215:Assertion failed) markerSize > 0 && bits.cols == sizeWithBorders && bits.rows == sizeWithBorders in function '_getBorderErrors']
at org.opencv.objdetect.ArucoDetector.detectMarkers_1(Native Method)
at org.opencv.objdetect.ArucoDetector.detectMarkers(ArucoDetector.java:132)
at org.dcs.aruco.Detector.detect(Detector.java:28)
at org.dcs.main.DetectArucoMarkers.action(Main.java:37)
at org.dcs.camera.Camera.cameraLoop(Camera.java:65)
at org.dcs.main.Main.main(Main.java:58)
Заранее спасибо, и если потребуется дополнительная информация, я соответствующим образом отредактирую вопрос.
Подробнее здесь: https://stackoverflow.com/questions/787 ... cv-in-java