Skip to content
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

added detection of inverted Markers, tests included #2055

Merged
merged 2 commits into from
May 30, 2019

Conversation

szk1509
Copy link
Contributor

@szk1509 szk1509 commented Mar 22, 2019

This pullrequest introduces the detection of inverted markers

i.e. it allows to detect white markers on a black background

Inverted Marker
inverted

Enclosed-Inverted Marker
img

@szk1509
Copy link
Contributor Author

szk1509 commented Mar 22, 2019

hi @alalek ,
Thank you for your advice :)
I've already corrected the issues (made the changes from #2036 on this new branch), so I will delete the other branch later.
Sorry about the delay and the inconveniences 🍎

modules/aruco/test/test_arucodetection.cpp Show resolved Hide resolved
// to get from 255 to 1
int invBError = _getBorderErrors(~candidateBits-254, dictionary->markerSize, params->markerBorderBits);
// white marker
if(invBError<borderErrors){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indentation (it is "jumping").

modules/aruco/src/aruco.cpp Outdated Show resolved Hide resolved
for(int yaw = 30; yaw <= 90; yaw += 50) {
for(double distance = 0.1; distance < 0.7; distance += 0.2) {
for(int pitch = 0; pitch < 360; pitch += (distance == 0.1? 60:180)) {
for(int yaw = 70; yaw <= 120; yaw += 40){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int yaw = 70; yaw <= 120; yaw += 40

yaw: 70, 110 ?

Old yaw values are: 30, 80

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though the detection of a default marker happens using that yaw value, it was not the case for the inverted marker, however, it also occurs in the opposite way, that is, where the inverted marker is detected more easily than the default marker.

modules/aruco/test/test_arucodetection.cpp Outdated Show resolved Hide resolved
Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alalek alalek merged commit ffd13f9 into opencv:3.4 May 30, 2019
@alalek alalek mentioned this pull request Jun 5, 2019
Saafke pushed a commit to Saafke/opencv_contrib that referenced this pull request Jun 24, 2019
* added detection of inverted Markers, tests included

* corrections added, default preserved, identation, var, comment
@hamddan4
Copy link

hamddan4 commented Oct 9, 2019

The dictionary has to be inverted too?

@szk1509
Copy link
Contributor Author

szk1509 commented Oct 10, 2019

Hi @hamddan4,
The dictionary does not need to be inverted too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants