From 37eed825c06c94a0934bd00a809741e36fb8e771 Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Mon, 1 Jan 2024 16:26:39 -0800 Subject: [PATCH] Fix perimeter threshold April tags will only have straight sides. With the deduplication happening earlier, each pixel along that boundary will now only have 2 neighbors (one above, one at 45 degrees). We should adjust the max blob length threshold accordingly. Signed-off-by: Austin Schuh --- apriltag_quad_thresh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apriltag_quad_thresh.c b/apriltag_quad_thresh.c index 3c0a66e0..38d3e43d 100644 --- a/apriltag_quad_thresh.c +++ b/apriltag_quad_thresh.c @@ -1061,10 +1061,10 @@ static void do_quad_task(void *p) // a cluster should contain only boundary points around the // tag. it cannot be bigger than the whole screen. (Reject // large connected blobs that will be prohibitively slow to - // fit quads to.) A typical point along an edge is added three - // times (because it has 3 neighbors). The maximum perimeter - // is 2w+2h. - if (zarray_size(*cluster) > 3*(2*w+2*h)) { + // fit quads to.) A typical point along an edge is added two + // times (because it has 2 unique neighbors). The maximum + // perimeter is 2w+2h. + if (zarray_size(*cluster) > 2*(2*w+2*h)) { continue; }