AprilRobotics / apriltag-imgs

Pre-generated AprilTag images
BSD 2-Clause "Simplified" License
374 stars 125 forks source link

Offer a PDF of the tag36h11 fiducials for download #4

Open sgilsonator opened 5 years ago

sgilsonator commented 5 years ago

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 commented 5 years ago

Would .svg files have served your purpose as well?

sgilsonator commented 5 years ago

I'm advocating for customers who may know nothing about PS or SVN so, providing a read-to-print PDF sheaf of fiducials seems like the simplest thing.

Thanks for your note Max.

-sg

On Wed, Oct 2, 2019 at 3:23 PM Max Krogius notifications@github.com wrote:

Would .svg files have served your purpose as well?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AprilRobotics/apriltag-imgs/issues/4?email_source=notifications&email_token=ABE47PNA62Z35HX4QHU2I23QMTYJLA5CNFSM4I4VFWBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAF4FNY#issuecomment-537641655, or mute the thread https://github.com/notifications/unsubscribe-auth/ABE47PKLOLBE7EMJSDSAR73QMTYJLANCNFSM4I4VFWBA .

-- Stephen Gilson Strategist and Content Manager

cbteeple commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

chenxiaocongAI commented 1 year ago

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?