Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer a PDF of the tag36h11 fiducials for download #4

Open
sgilsonator opened this issue Oct 2, 2019 · 6 comments
Open

Offer a PDF of the tag36h11 fiducials for download #4

sgilsonator opened this issue Oct 2, 2019 · 6 comments

Comments

@sgilsonator
Copy link

Save someone from the hassle of converting a PS to PDF and offer a printable set of the tag36h11 fiducials for download.
AprilTag-tag36h11.pdf

@mkrogius
Copy link
Contributor

mkrogius commented Oct 2, 2019

Would .svg files have served your purpose as well?

@sgilsonator
Copy link
Author

sgilsonator commented Oct 2, 2019 via email

@cbteeple
Copy link

cbteeple commented Jan 29, 2021

I was recently plagued by this exact same issue. I'm using apriltags in my grasping/manipulation research (for estimating object poses), but I needed them to be pretty small. The PDF linked by @sgilsonator above of the standard 36h11 tag family is useful, but this has only one tag per page. To get smaller tags, I could have printed this with multiple pages per printed page, but that wastes a lot of space and you have no real control over the dimensions of the tags.

My Solution:

I wrote a bash script to generate pdfs with grids of apriltags at a specified real-world size. I wrote up some documentation on my own personal documentation site (https://docs.cbteeple.com/robot/april-tags). In addition to the script, I also included some some PDFs with grids of the 36h11 tag family at various useful sizes (30mm, 60mm, 100mm).

Note: I've only tested the bash script in Ubuntu 20.04...

@rgov
Copy link

rgov commented May 28, 2021

This ate up a lot of time because the macOS PDF renderer always does a smooth interpolation of low-resolution images. Much credit goes to @cbteeple for the suggestion of using ImageMagick. Note you must modify the ImageMagick security policy to allow writing PDFs.

I found that I could do a very simple conversion of a given tag (in this instance, for id=5):

convert -density 300 'tag36h11/alltags.ps[5]' tag.pdf

This generated a US Letter-sized PDF, but with the strange side length of ~215 mm. If you need a specific side length, then this does better:

convert tag36h11/tag36_11_00005.png \
    -density 300 \
    -scale $((100 * 200./10 * 300/25.4))% \
    -bordercolor black -border 1 \
    -gravity center -extent $((300*8.5))x$((300*11)) \
    -gravity south -annotate +0+$((300*0.25)) 'april.tag.Tag36h11, id = 5, size = 200 mm' \
    tag.pdf

This creates 300dpi, 8.5 x 11 inch PDF. The 10-pixel wide tag is scaled to be 200mm. (The constant 25.4 is the conversion factor from inches to mm.) It also adds a thin border around the tag and writes some reference information 0.25 in from the bottom of the page; just delete either line to remove these features.

Printing the resulting tag.pdf at 100% scale on macOS from Preview.app gave me the exact tag dimensions I expected.

@rgov
Copy link

rgov commented May 28, 2021

I've uploaded pre-generated tag36h11 PDFs here: https://github.com/rgov/apriltag-pdfs

@chenxiaocongAI
Copy link

I was recently plagued by this exact same issue. I'm using apriltags in my grasping/manipulation research (for estimating object poses), but I needed them to be pretty small. The PDF linked by @sgilsonator above of the standard 36h11 tag family is useful, but this has only one tag per page. To get smaller tags, I could have printed this with multiple pages per printed page, but that wastes a lot of space and you have no real control over the dimensions of the tags.

My Solution:

I wrote a bash script to generate pdfs with grids of apriltags at a specified real-world size. I wrote up some documentation on my own personal documentation site (https://docs.cbteeple.com/robot/april-tags). In addition to the script, I also included some some PDFs with grids of the 36h11 tag family at various useful sizes (30mm, 60mm, 100mm).

Note: I've only tested the bash script in Ubuntu 20.04...

I would like to ask, if a single apritag is used to print on A4 paper, and the camera is 50cm away from the apritag, how accurate is the calculated pose? Can the accuracy of mm be achieved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants