AprilRobotics / apriltag

AprilTag is a visual fiducial system popular for robotics research.
https://april.eecs.umich.edu/software/apriltag
Other
1.56k stars 535 forks source link

apriltag3 vs apriltag2 -- detect quad #263

Open ruichaowang opened 1 year ago

ruichaowang commented 1 year ago

Describe the bug Apriltag 3 has a lower detect rate than Apriltag 2. Tag family: tagCodes36h11

To Reproduce Steps to reproduce the behavior: parameters for apriltag3:

    td->nthreads = 8;
    td->quad_decimate = 1;
    td->quad_sigma = 0.0;

    td->qtp.max_nmaxima = 10;
    td->qtp.min_cluster_pixels = 1;

    td->qtp.max_line_fit_mse = 200.0;
    // td->qtp.critical_rad = 1 * M_PI / 180;
    td->qtp.cos_critical_rad = cos(10 * M_PI / 180);
    td->qtp.deglitch = 0;
    td->qtp.min_white_black_diff = 1;

    td->tag_families = zarray_create(sizeof(apriltag_family_t*));

    pthread_mutex_init(&td->mutex, NULL);

    td->tp = timeprofile_create();

    td->refine_edges = 1;
    td->decode_sharpening = 0.25;

    td->debug = 1;

Expected behavior Apriltag 3 can detect more tags than Apriltag 2.

Input Image raw imgae: front_debug_preprocess

using apriltag2: front

using apriltag3: front_3

Screenshots apriltag2 debug, aptag2debug

apriltag3 debug, aptag3debug

as you can see the apriltag2 can detect more quads.

Operating Sytem m1 mac

Additional context Add any other context about the problem here.

ruichaowang commented 1 year ago

re-upload raw images. front_debug_preprocess

christian-rauch commented 1 year ago

The behaviour between the implementations changed. This repo hosts all the versions. If you need an older implementation, you will have to check out that specific commit.

@mkrogius @wxmerkt Since this also came up in https://github.com/AprilRobotics/apriltag/issues/262, I think it makes sense to create branches apriltag1 and apriltag2 for the previous versions 1 and 2. Do you agree? Which commits would match the latest state of the version 1 and 2 implementations?

ruichaowang commented 1 year ago

The behaviour between the implementations changed. This repo hosts all the versions. If you need an older implementation, you will have to check out that specific commit.

It would be great to have branch apriltag2 for the previous versions 2. But from my point of view, the apriltag3 should have a better detection rate than apriltag2, but which is not ture in this case.

mkrogius commented 1 year ago

@ruichaowang Neither AprilTag 3 nor AprilTag 2 supports tags with the extra calibration squares on the corners like that. I also don't recognize the style of the image you have uploaded as apriltag2_debug, which makes me wonder whether this is actually an AprilTag 2 implementation? If I had to guess, this would actually be an AprilTag 1 implementation, which didn't officially support tags with calibration squares, but which did have better detection rate in this scenario than AprilTag 3.

@christian-rauch I think that makes sense. Unfortunately none of the earlier AprilTag releases are commits in this repo. It may take some digging in order to find the original releases for AprilTag 1 and AprilTag 2

XavierQL commented 1 month ago

@christian-rauch here i am confused by the highly distorted image how to detect the apriltag accurately and efficiently?from my side, the first step is to rectify the image and then to detect the apriltage code. But like the fisheye image as the issue shown, the undistorted image has cropped lots of FOV(using opencv), so how to detect the tags at the edge of the image?

christian-rauch commented 1 month ago

@XavierQL What is confusing? You should rectify the image in any case to have the line detection working properly. Is this related to the AprilTag 2 vs. 3 discussion above?