A maximum of 3 markers can only be detect
Thank you for sharing. i tried your demo test but only up to 3 markers can be detect Hope you could help
I don't recall such limitation, did you try to debug it?
I don't recall such limitation, did you try to debug it?
I checked and found this code limits the number of markers that can be detected res.size() < 3
`vector<ArucoResult> ArucoDetector::detectArucos(Mat frame, int misses) { vector<ArucoResult> res; vector<vector<Point2f>> cands = findSquares(frame);
for (int i = 0; i < cands.size() && res.size() < 3; ++i) {
vector<Point2f> cnt = cands[i];
vector<int> sig = getContoursBits(frame, cnt, 36);
for (int j = 0; j < m_dict.sigs.size(); ++j) {
if (equalSig(sig, m_dict.sigs[j], misses)) {
ArucoResult ar;
ar.corners = cnt;
ar.index = j;
res.push_back(ar);
break;
}
}
}
return res;
}`
I tried increasing the size, it worked but it seemed unstable, Is there anything I can do to make it run more stable?, thank you
What do you mean more stable? If you want the detection to be more "flexible" you can increase the "misses" parameter I think (how many aruco "bits" can be missed and still consider the marker valid)
In my case there are 4 markers, but the detection will change back and forth between 3 and 4 markers. What can I do to detect 4 fixed markers? Hope you could help
I don't think it's the number of markers that matter but the location of the marker in the frame and its angle that makes a marker to "flicker"
yes, it flicker, but I don't think it's a matter of location and angle
https://github.com/ValYouW/flutter-opencv-stream-processing/assets/126755528/68b22c36-d195-4bdc-8831-184648fa3318
It actually looks pretty good I think, my experience with image processing is that there is always some noise when processing live camera feed. In the video I see the printed marker is not fully black, there are some white spots, try to paint then black and test.
@ValYouW I'm trying to use your example, but I'm using the library https://pub.dev/packages/opencv_dart. Do you think I could make a migration?. Why do you use an image as a detector? My detector is black squares but I look for them in the photo taken with the camera
@angelru I am not familiar with that library, it seems like a relatively new library. But if it provides all the OpenCV methods that you need easily and efficiently that would be cool. Not I understand you question "Why do you use an image as a detector", if I remember correctly I use an aruco marker.
@ValYouW
I'm trying to follow your example and load the marker.png from the assets in principle, I don't know which dictionary the aruco marker uses.
final markedData = await rootBundle.load('assets/images/marker.png');
final markedbytes = markedData.buffer.asUint8List();
var imgMarked = await cv.imdecodeAsync(markedbytes, cv.IMREAD_COLOR);
final detector = cv.ArucoDetector.create(
cv.ArucoDictionary.predefined(cv.PredefinedDictionaryType.DICT_4X4_250),
cv.ArucoDetectorParameters.empty(),
);
final (_, ids, _) = detector.detectMarkers(imgMarked);
int idMarked = ids.first;
There are never ids
Ah, I don't know how the builtin aruco detector of ooencv works, I created my own market. I would guess they have a set of predefined markers, or you should initialize a dictionary with your own market(s). You will have to rear ooencv docs...