Skip to main content

Python bindings for apriltags v3

Project description

https://img.shields.io/pypi/v/pupil-apriltags.svg https://img.shields.io/pypi/pyversions/pupil-apriltags.svg tests Code style: Black https://img.shields.io/badge/skeleton-2022-informational

pupil-apriltags: Python bindings for the apriltags3 library

These are Python bindings for the Apriltags3 library developed by AprilRobotics, specifically adjusted to work with the pupil-labs software. The original bindings were provided by duckietown and were inspired by the Apriltags2 bindings by Matt Zucker.

How to get started:

Requirements

Note that pupil-apriltags currently only runs on Python 3.6 or higher.

Also we are using a newer python build system, which can fail for older versions of pip with potentially misleading errors. Please make sure you are using pip > 19 or consider upgrading pip to the latest version to be on the safe side:

python -m pip install --upgrade pip

Install from PyPI

This is the recommended and easiest way to install pupil-apriltags.

pip install pupil-apriltags

We offer pre-built binary wheels for common operating systems. In case your system does not match, the installation might take some time, since the native library (apriltags-source) will be compiled first.

Manual installation from source (for development)

You can of course clone the repository and build from there. For development you should install the development requirements as well. This project uses the new python build system configuration from PEP 517 and PEP 518.

# clone the repository
git clone --recursive https://github.com/pupil-labs/apriltags.git
cd apriltags

# install apriltags in editable mode with development requirements
pip install -e .[dev]

# run tests
tox

Usage

Some examples of usage can be seen in the src/pupil_apriltags/bindings.py file.

The Detector class is a wrapper around the Apriltags functionality. You can initialize it as following:

from pupil_apriltags import Detector

at_detector = Detector(
   families="tag36h11",
   nthreads=1,
   quad_decimate=1.0,
   quad_sigma=0.0,
   refine_edges=1,
   decode_sharpening=0.25,
   debug=0
)

The options are:

O p t i o n

D e f a u l t

Explanation

f a m i l i e s

‘ t a g 3 6 h 1 1 ‘

Tag families, separated with a space

n t h r e a d s

1

Number of threads

q u a d _ d e c i m a t e

2

Detection of quads can be done on a lower-resolution image, improving speed at a cost of pose accuracy and a slight decrease in detection rate. Decoding the binary payload is still done at full resolution. Set this to 1.0 to use the full resolution.

q u a d _ s i g m a

0

What Gaussian blur should be applied to the segmented image. Parameter is the standard deviation in pixels. Very noisy images benefit from non-zero values (e.g. 0.8)

r e f i n e _ e d g e s

1

When non-zero, the edges of the each quad are adjusted to “snap to” strong gradients nearby. This is useful when decimation is employed, as it can increase the quality of the initial quad estimate substantially. Generally recommended to be on (1). Very computationally inexpensive. Option is ignored if quad_decimate = 1

d e c o d e _ s h a r p e n i n g

2 5 e - 2

How much sharpening should be done to decoded images? This can help decode small tags but may or may not help in odd lighting conditions or low light conditions

d e b u g

0

If 1, will save debug images. Runs very slow

Detection of tags in images is done by running the detect method of the detector:

tags = at_detector.detect(img, estimate_tag_pose=False, camera_params=None, tag_size=None)

If you also want to extract the tag pose, estimate_tag_pose should be set to True and camera_params ([fx, fy, cx, cy]) and tag_size (in meters) should be supplied. The detect method returns a list of Detection objects each having the following attributes (note that the ones with an asterisks are computed only if estimate_tag_pose=True):

A t t r i b u t e

Explanation

t a g _ f a m i l y

The family of the tag.

t a g _ i d

The decoded ID of the tag.

h a m m i n g

How many error bits were corrected? Note: accepting large numbers of corrected errors leads to greatly increased false positive rates. NOTE: As of this implementation, the detector cannot detect tags with a Hamming distance greater than 2.

d e c i s i o n _ m a r g i n

A measure of the quality of the binary decoding process: the average difference between the intensity of a data bit versus the decision threshold. Higher numbers roughly indicate better decodes. This is a reasonable measure of detection accuracy only for very small tags–not effective for larger tags (where we could have sampled anywhere within a bit cell and still gotten a good detection.)

h o m o g r a p h y

The 3x3 homography matrix describing the projection from an “ideal” tag (with corners at (-1,1), (1,1), (1,-1), and (-1, -1)) to pixels in the image.

c e n t e r

The center of the detection in image pixel coordinates.

c o r n e r s

The corners of the tag in image pixel coordinates. These always wrap counter-clock wise around the tag.

p o s e _ R *

Rotation matrix of the pose estimate.

p o s e _ t *

Translation of the pose estimate.

p o s e _ e r r *

Object-space error of the estimation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pupil_apriltags-1.0.4.post4.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pupil_apriltags-1.0.4.post4-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

pupil_apriltags-1.0.4.post4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pupil_apriltags-1.0.4.post4-cp311-cp311-macosx_10_9_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pupil_apriltags-1.0.4.post4-cp310-cp310-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pupil_apriltags-1.0.4.post4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pupil_apriltags-1.0.4.post4-cp310-cp310-macosx_10_9_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pupil_apriltags-1.0.4.post4-cp39-cp39-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.9Windows x86-64

pupil_apriltags-1.0.4.post4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pupil_apriltags-1.0.4.post4-cp39-cp39-macosx_10_9_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pupil_apriltags-1.0.4.post4-cp38-cp38-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.8Windows x86-64

pupil_apriltags-1.0.4.post4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pupil_apriltags-1.0.4.post4-cp38-cp38-macosx_10_9_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pupil_apriltags-1.0.4.post4-cp37-cp37m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.7mWindows x86-64

pupil_apriltags-1.0.4.post4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

pupil_apriltags-1.0.4.post4-cp37-cp37m-macosx_10_9_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

pupil_apriltags-1.0.4.post4-cp36-cp36m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.6mWindows x86-64

pupil_apriltags-1.0.4.post4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

pupil_apriltags-1.0.4.post4-cp36-cp36m-macosx_10_9_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file pupil_apriltags-1.0.4.post4.tar.gz.

File metadata

  • Download URL: pupil_apriltags-1.0.4.post4.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pupil_apriltags-1.0.4.post4.tar.gz
Algorithm Hash digest
SHA256 99339b92c6afa11c334d197588e768d895058248a9712be6268ad97ce7f28351
MD5 397e5033ecaf1e1ad328bafb6c723720
BLAKE2b-256 e84a936e11955d9d56f41a1769cbf1d19b7441ef7803a11d5b0403b509dee8a7

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 451496551ce1c1427265d3d95a13b536d8af594b5dc866405999188ab7cf2c63
MD5 e652d0fd474476a4f885ecee20219ecb
BLAKE2b-256 5a123ea63275fd8a8467082b48cfa508a0f77561c2f49c0c9df195e57b330530

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71917b479b3635524a2cef8f636346d2d9c5f6d9d6e9445dd91c5c82066b00e7
MD5 d98c301a2b470150abad27e8978e134f
BLAKE2b-256 10977bae6f40d5a32fb642463d68f498a567eaf465e546224ac07d2986401b7f

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 96c282e3705f0d67bd4cd9e8bb8d654b4ba3698f9c8c0836b59e936c3e4988d6
MD5 9b42171811fb6ffc3400ff176d9a4bbe
BLAKE2b-256 493706ebc1dd8c2af524df9a7b5b464dc08319b7ab49065a007250f79eb279da

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c2b00c6aa873efac7d2f280d9ca84487e18b1e9aadf409cd75ade7b2c054e036
MD5 ee9bfea5309143284e8ef963481da3f3
BLAKE2b-256 bb34cfccba9388a03889ac1add53d591995c3cec68646c573f0f2a465a4214b3

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07ff6fdbcf418169530e72062b7c806e10d1f1d390ea59aecf6dc9188233cc8f
MD5 7dcda5c2a2265abf2e0ade1ed1469871
BLAKE2b-256 0b48a5f9c46223b1e5e7cf96ecdee7d75955152925ee2aaf5dbcd12f91e438ea

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 32168e9f5d1ead755255bab96f7fcb6b3ad40e4443ad570c1a5bb129d0ed27b6
MD5 d43708fe5fd993cfbb59be117d6274fc
BLAKE2b-256 5746b601f8022553248db549d5164548cc68415ce7cc081c3f1a701e6c2acfed

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ed2eab8441e61aababdde9bc2c14bc7b67b8c640fe66ce5fd27bbe4c9485884e
MD5 7acf5cc98200f22b5e5e82f3e958b446
BLAKE2b-256 53585cc78d6d6879ef9e8bb79db88460e1d39e4e160d60a36fa748cfea7ec399

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ec9bf44b7408a0518a7e68c7c14cc8ccead065ba07bbddf0108588c3ae165d9
MD5 34252b717e01488e73b1954cd394a453
BLAKE2b-256 dd16b370f17a5d4e7ea9c24475f0f628902ede0a71cce3a914173463700bd668

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 674adb5bbb129b8ca05fa24204f15058778b9de920f665094c6e6d2d88c1f889
MD5 04d462c5dcc27167f6439e406aa99ae2
BLAKE2b-256 2873e17c439a7b83d0d03d5ef90f45c6b3223b3cf47e6bf755814517e6bbcace

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3d4afaf7062329f1e4d73c7dfa2805f4efbf0ab57e505efd5e3054e3325543f4
MD5 1cad57aa9c8233018566545eea2c0918
BLAKE2b-256 c9cef1e8854c0a24e9d59fa24efb7b0c62bb4f3036a82c9d47ea4e11b280e96a

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 161811548b50440435bc24ed4fa6060f1bd0fc30a57eac2cf641a1d36f53c887
MD5 34435118c7c3673a31bde0b2294603b4
BLAKE2b-256 641703f007d431dad00c9ac8c89c6af5e089322f87fa8bb351931c423364202b

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 203080fea92e22379c2045ff7da4ee9db748f0f49cbb0c2d02781508ef9d755b
MD5 241c42fa04dbb413844382b0c053ebfb
BLAKE2b-256 f76a84fa43d88075c4046ecc426337e47bfe0bddc3b0fb510af383ab4cb826ba

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0edcb01e07837e53dd597d79ebdd278687fa2bfcd9b2b90accd0c887fbfea04d
MD5 7c031d12802e9de7cd55bc582e8fc8b3
BLAKE2b-256 44cb0cadcc66df1ddb431f86207b1716fea2121b9a11367a9d6381b2c9741aad

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57ac95974c20e053c1b54c62a7abbfec431e39f2aa7d40cd134b015681164396
MD5 eee96e672df41c73c23bb3cc062fec08
BLAKE2b-256 6b7047508bf18c9b281699d5f476da320acc316d68e699b7ba6fc3f07c707ef8

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f5cbb3c5cfc1b697f83a595a81b880ca008b62f86874602de4ba9b0e8020646f
MD5 e351c70c74d46e85f8ed7b4734b8f5ad
BLAKE2b-256 94ef4608b6721ce328d8a1552958ed41961b6d40dfe0d3949de14f2827302b9a

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1fb9cfe26210833e525240859ef0042c7412d9428cf156dad790b91c3aa33eb0
MD5 d882a5dc83f689ddaa901657e7512398
BLAKE2b-256 fa07e083b118463b39f478a56b3f86c7ab140ff7cb1892858e7c83f16475f07d

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20ca75253b4c037e1517313d0be2a97785e61b817bea318ad6b5a781bb95067d
MD5 3d2b1cd347723fb71996d4a7db126ba9
BLAKE2b-256 0d431bf10beb59b98dcd21d562445cf17177f0b48d25708bc15e790fce61b898

See more details on using hashes here.

File details

Details for the file pupil_apriltags-1.0.4.post4-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_apriltags-1.0.4.post4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7ed0c925646132597a03971d3cd5b5cf6a0c3a6913635aaa0b9092dc27599d91
MD5 04b8b2288598e2513def252ef49b5b8c
BLAKE2b-256 e47ff6980fd504fccb9576021b327f08d39b4d269a05cee950e6301633a1797a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page