-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aruco detection is worsened since OpenCV 4.1.2 #2492
Comments
Hi @stefanopini, you can reduce the minimum marker distance rate (in this case to 0.025), which allows to recognize all the markers at the bottom of the image provided, i.e. the synthetic markers. |
Hi @szk1509 , thank you for spotting it. I looked again at your pull request (#2236 improving the accuracy with white markers), but I didn't find what may cause the misdetection of markers without external white border. opencv_contrib/modules/aruco/src/aruco.cpp Lines 249 to 322 in 93f910e
|
Hi @stefanopini , I'm glad, I can help :) |
I am experiencing a similar issue. I have a video file consisting of roughly 1000 frames, showing an Aruco marker in an outdoor location with bright sunlight. Every now and then a slight shadow passes over the marker. In opencv-contrib-python 4.1.1.26 the marker was detected in every single frame. In opencv-contrib-python 4.3.0.36 the marker is detected in only half the frames (see top image). The frames in which the marker is not detected is when the shadow passes over the marker (see bottom image). For the parameters I'm using the default values. It took me a while to realise that the problem was the module version, quite frustrating. |
@szk1509 I know that is not the normal use case, but I am wondering if there's a way to combine the two things: ability to detect the markers with almost non-existing white border and better detection of inverted markers. Looking at the example reported by @daanvV (thank you for posting it), it looks like the misdetection does not only happen when the white border is extremely small/non-existent, but also when the white border present a slightly hue variation (in the example, it has a blueish tint). |
Any updates on this, @szk1509? Recently I was doing a new install of python on my machine and it seems that it's no longer possible to install opencv-contrib-python 4.1.1.26 via pip or poetry, so I have a big problem here since the Aruco detection of the most recent opencv-contrib versions is insufficient for my purposes. |
Hi @stefanopini and @daanvV, sorry I haven't answered so far. Due to some personal issues and since I'm working on my thesis I haven't been able to continue working on this topic as much as I would like :( |
Hi @szk1509 ! In this moment, I don't have a lot of time (nor much competence btw) to work on this issue, but I'll try to continue investigating its causes and when it occurs. |
#2900 maybe? |
Thank you @paroj for the reference to the pull request! I tested the code compiling opencv 4.5.1 with the opencv_contrib commit a124db8 and the issue is still there unfortunately. |
Any news on this issue? |
PR #3201 fixes marker detection on your image. But you need to set |
PR #3201 fixes marker detection on your image. But you need to set |
Amazing! Thanks a lot @AleksandrPanov for fixing this! |
System information (version)
Detailed description
The last version of the Aruco detection algorithm ( see pull request #2236 ), which is included in OpenCV 4.1.2 and above, has worse performance than the previous one when the outer border of black markers is small.
The algorithm completely fails to find black markers whose outer white border is quite small (just few pixels) with both real and synthetic images. The old algorithm finds them.
I tried to change some
DetectorParameters
(e.g.minMarkerPerimeterRate
,minCornerDistanceRate
andmarkerBorderBits
) without success.Steps to reproduce
Please see the attached reference Python code and image.
Code is tested with OpenCV 4.1.1.26 (8/8 markers found) and 4.2.0.34 (2/8 markers found) with Python 3.6.4. Corresponding results are reported.
aruco-detection-issue.zip
Issue submission checklist
answers.opencv.org, Stack Overflow, etc and have not found solution
The text was updated successfully, but these errors were encountered: