Functions

Function Reference

AprilTags.jl functions

AprilTagDetector(tagfamily=tag36h11)

Create a default AprilTag detector with the 36h11 tag family Create an AprilTag detector with tag family in tagfamily::TagFamilies @enum TagFamilies tag36h11 tag25h9 tag16h5

source
freeDetector!(apriltagdetector)

Free the allocated memmory

source
homography_to_pose(H, f_width, f_height, c_width, c_height, [taglength = 2.0])

Given a 3x3 homography matrix and the camera model (focal length and centre), compute the pose of the tag.

Notes

  • Images.jl uses ::Array in Julia as column-major (i.e. vertical major) convention, that is size(img) == (480, 640)
    • Axes start top left-corner of the image plane (i.e. the image-frame):
    • width is from left to right,
    • height is from top downward.
  • The low-level ccall wrapped C-library underneath uses the convention (i.e. the camera-frame):
    • fx == f_width,
    • cy == c_height, and
    • C-library camara coordinate system: camera looking along positive Z axis with x to the right and y down.
      • C-library internally follows: https://docs.opencv.org/3.4/d9/d0c/group__calib3d.html
  • The focal lengths should be given in pixels.
  • The returned units are those of the tag size, therefore the translational components should be scaled with the tag size.
  • The tag coordinates are from (-1,-1) to (1,1), i.e. the tag size has length of 2 units.
    • Optionally, the tag length (in metre) can be passed to return a scaled value.
  • Returns ::Matrix{Float64}

Related

homographytopose

source
homographytopose(H, f_width, f_height, c_width, c_height, [taglength = 2.0])

Given a 3x3 homography matrix and the camera model (focal length and centre), compute the pose of the tag.

Notes

  • Images.jl uses ::Array in Julia as column-major (i.e. vertical major) convention, that is size(img) == (480, 640)
    • Axes start top left-corner of the image plane (i.e. the image-frame):
    • width is from left to right,
    • height is from top downward.
  • The low-level ccall wrapped C-library underneath uses the convention (i.e. the camera-frame):
    • fx == f_width,
    • cy == c_height, and
    • C-library camara coordinate system: camera looking along positive Z axis with x to the right and y down.
      • C-library internally follows: https://docs.opencv.org/3.4/d9/d0c/group__calib3d.html
  • The focal lengths should be given in pixels.
  • The returned units are those of the tag size, therefore the translational components should be scaled with the tag size.
  • The tag coordinates are from (-1,-1) to (1,1), i.e. the tag size has length of 2 units.
    • Optionally, the tag length (in metre) can be passed to return a scaled value.
  • Returns ::Matrix{Float64}

```

Related:

homography_to_pose

source
AprilTags.drawTagBox!Function.
drawTagBox!(image, tag)

Draw a box around the tag. imageCol = RGB.(image) foreach(tag->drawTagBox!(imageCol, tag), tags)

source
drawTagAxes!(image, tag, CameraMatrix)

Draw the tag x, y, and z axes to show the orientation. imageCol = RGB.(image) foreach(tag->drawTagAxes!(imageCol, tag, K), tags)

source
getAprilTagImage(tagIndex, tagfamily=tag36h11)

Return an image [Gray{N0f8}] for with tagIndex from tag family in tagfamily::TagFamilies @enum TagFamilies tag36h11 tag25h9 tag16h5

source
threadcalldetect(detector, image)

Run the april tag detector on a image

source
detectAndPose(detector, image, f_width, f_height, c_width, c_height, taglength)

Detect tags and calcuate the pose on them.

source
tagOrthogonalIteration(corners, H, f_width, f_height, c_width, c_height; taglength, nIters)

Run the orthoganal iteration algorithm on the poses.

Notes

  • See apriltag_pose.h
  • [2]: Lu, G. D. Hager and E. Mjolsness, "Fast and globally convergent pose estimation from video images," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 22, no. 6, pp. 610-622, June 2000. doi: 10.1109/34.862199
  • The low level C-library uses fx=f_width.
source

Wrappers

apriltag_detector_create()

Create a AprilTag Detector object with all fields set to default value.

source
tag36h11_create()

Create a AprilTag family object for tag36h11 with all fields set to default value.

source
tag36h11_destroy(tf)

Destroy the AprilTag family object.

source
apriltag_detector_add_family(tag_detector, tag_family)

Add a tag family to an AprilTag Detector object. The caller still "owns" the family and a single instance should only be provided to one apriltag detector instance.

source
apriltag_detector_detect(tag_detector, image)

Detect tags from an image and return an array of apriltagdetectiont*. You can use apriltagdetectionsdestroy to free the array and the detections it contains, or call detectiondestroy and zarraydestroy yourself.

source
threadcall_apriltag_detector_detect(tag_detector, image)

Experimental call apriltagdetectordetect in a seperate thread using the experimantal @threadcall Detect tags from an image and return an array of apriltagdetectiont*. You can use apriltagdetectionsdestroy to free the array and the detections it contains, or call detectiondestroy and zarraydestroy yourself.

source

Index