-
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
Inv marker contour detection improved #2236
Inv marker contour detection improved #2236
Conversation
Please squash patch into one commit (remove unrelated commits from the patch and remove merge commits (use rebase instead of merge if necessary)). |
1d57129
to
f937283
Compare
I rebased PR changes onto 3.4 branch (please fetch commit from your fork, do not use merges, cherry-pick new commits if any). |
Thank you @alalek and again, thank you for your help 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
*/ | ||
static void _filterTooCloseCandidates(const vector< vector< Point2f > > &candidatesIn, | ||
vector< vector< Point2f > > &candidatesOut, | ||
vector< vector< vector< Point2f > > > &candidatesSetOut, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vector< vector< vector<
There are really two many nested vectors.
Two values are expected in outer dimension.
Perhaps we should split this parameter into two:
vector< vector< Point2f > > &candidatesOut,
vector< vector< Point2f > > &candidatesInvertedOut,
if(biggerIdx > -1){ | ||
|
||
biggerCandidates.push_back(candidatesIn[biggerIdx]); | ||
biggerContours.push_back(contoursIn[biggerIdx]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we observing lack of performance in this code, then we can try to utilize smart pointers:
-const vector< vector< Point2f > > &candidatesIn
+typedef vector< Point2f > CandidatePoints;
+typedef cv::Ptr<CandidatePoints> CandidatePointsPtr;
+const vector<CandidatePointsPtr> &candidatesIn
d7cd6d8
to
93f910e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you 👍
I have a question regarding how it works, posted here: https://stackoverflow.com/questions/58302536/how-to-properly-detect-inverted-white-markers-with-opencv-aruco-module |
Hi @hamddan4, if you like i can give you some more details, so that you can keep working ;) |
Hi! Yes, i would like to know how to add this functionality to my code. Afaik, detectInvertedMarkers option of parameters is on the source code, but it doesn't seem to work.. what I am missing here? |
@hamddan4 🤔 well ... import cv2 i don't actually see what are you missing 🤔 |
So if it works with you, it has to be some problem with the my installed libraries? Maybe the headers are good but is not implemented in the installed version of opencv. I've done this by |
@hamddan4 well, i use (and recommend you) the official git repo... it includes some tests and tutorials :) |
This pull request improves the accuracy of the white markers
Resolves #2055.
This pull request modifies the contour selection for the white marker contours, by modifying the selection process of the corners and contour candidates, in _filterTooCloseCandidates.
candidatesSet: The candidates and the contours are saved in a structur, for future improvements.