Skip to content

Commit

Permalink
Fix refine_edges() Corner Ordering (AprilRobotics#188)
Browse files Browse the repository at this point in the history
* fix issue with refine_edges reordering the apriltag corners, causing failures in the fallback case
  • Loading branch information
QuentinTorg authored Feb 26, 2022
1 parent e54d53b commit b91b195
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apriltag.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,10 @@ static void refine_edges(apriltag_detector_t *td, image_u8_t *im_orig, struct qu

double L0 = W00*B0 + W01*B1;

// compute intersection
quad->p[i][0] = lines[i][0] + L0*A00;
quad->p[i][1] = lines[i][1] + L0*A10;
// Compute intersection. Note that line i represents the line from corner i to (i+1)&3, so
// the intersection of line i with line (i+1)&3 represents corner (i+1)&3.
quad->p[(i+1)&3][0] = lines[i][0] + L0*A00;
quad->p[(i+1)&3][1] = lines[i][1] + L0*A10;
} else {
// this is a bad sign. We'll just keep the corner we had.
// printf("bad det: %15f %15f %15f %15f %15f\n", A00, A11, A10, A01, det);
Expand Down

0 comments on commit b91b195

Please sign in to comment.