Skip to content

Commit

Permalink
Handle edge case for very very small tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Krogius committed Oct 4, 2019
1 parent 8fd1baf commit 43dbab7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apriltag.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,15 @@ float quad_decode(apriltag_detector_t* td, apriltag_family_t *family, image_u8_t
}
}

graymodel_solve(&whitemodel);
graymodel_solve(&blackmodel);
if (family->width_at_border > 1) {
graymodel_solve(&whitemodel);
graymodel_solve(&blackmodel);
} else {
graymodel_solve(&whitemodel);
blackmodel.C[0] = 0;
blackmodel.C[1] = 0;
blackmodel.C[2] = blackmodel.B[2]/4;
}

// XXX Tunable
if ((graymodel_interpolate(&whitemodel, 0, 0) - graymodel_interpolate(&blackmodel, 0, 0) < 0) != family->reversed_border) {
Expand Down

0 comments on commit 43dbab7

Please sign in to comment.