AprilTag

class AprilTagDetector(family)

Class to be used to detect April Tags.

Parameters

family (AprilTagFamily) – The tag family that you want to detect.

detect(image)

Detect april tags within an image.

Typical usage:

detector = edgeiq.AprilTagDetector(edgeiq.AprilTagFamily.TAG_16h5)

with edgeiq.WebcamVideoStream(cam=0) as video_stream:

    while True:
        frame = video_stream.read()
        detections = detector.detect(frame)
        for detection in detections:
            frame = detection.markup_image(frame, tag_id=True)
Parameters

image (numpy array) – The image you want to detect april tags in.

Returns

list[AprilTagDetection]

class AprilTagDetection(top_right, top_left, bottom_right, bottom_left, tag_id)

Result object that pairs with AprilTagDetector.

markup_image(image, tag_id=False)

Overlay the detection on an image.

Parameters
  • image (numpy array) – The image you want to overlay the detection on.

  • tag_id (bool) – Set True if you want to also overlay the tag id of the detection.

Returns

numpy array – The image with the detection overlayed.

property tag_id

The tag id that was detected.

Type

string

property corners

Corners of the detection.

Returns

namedtuple with the following fields:

  • top_left - top left corner of the detection

  • top_right - top right corner of the detection

  • bottom_left - bottom left corner of the detection

  • bottom_right - bottom right corner of the detection

class AprilTagFamily(value)

April Tag Families supported by the detector.

TAG_16h5 = 17
TAG_25h9 = 18
TAG_36h10 = 19
TAG_36h11 = 20