{"id":13571857,"url":"https://github.com/nettlep/magic","last_synced_at":"2026-03-11T09:37:11.810Z","repository":{"id":41151847,"uuid":"508479580","full_name":"nettlep/magic","owner":"nettlep","description":"Scanner for decks of cards with bar codes printed on card edges","archived":false,"fork":false,"pushed_at":"2023-06-22T05:16:00.000Z","size":43089,"stargazers_count":834,"open_issues_count":0,"forks_count":31,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-11-05T04:34:21.374Z","etag":null,"topics":["computer-vision","magic","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nettlep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-06-28T23:04:37.000Z","updated_at":"2024-10-28T12:44:05.000Z","dependencies_parsed_at":"2024-02-16T03:43:29.306Z","dependency_job_id":null,"html_url":"https://github.com/nettlep/magic","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettlep%2Fmagic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettlep%2Fmagic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettlep%2Fmagic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettlep%2Fmagic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nettlep","download_url":"https://codeload.github.com/nettlep/magic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247152770,"owners_count":20892552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","magic","swift"],"created_at":"2024-08-01T14:01:07.278Z","updated_at":"2025-04-04T09:30:33.853Z","avatar_url":"https://github.com/nettlep.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# The Nettle Magic Project\n\nThis deck of cards has a bar code printed on the edge of each card. Scanning these bar codes would reveal where every card is (or isn't - if cards are missing.)\n\nThink card magic.\n\n![A deck of cards with digital marks printed on the edge of each card.](docs/img/stamped-deck.jpg)\n\nThis wouldn't be a very good magic trick if you could see the marks. We need invisible marks.\n\nOne of these decks is unmarked, the other is marked with this special ink that is only visible under specific IR conditions.\n\n![Two decks of cards - each viewed from the same end. Both decks appear normal.](docs/img/ink_comparison.jpg)\n\nThis device (a Raspberry Pi Zero W with a NoIR camera) can see these marks. The shiny circle is a special IR filter.\n\nA scanning server runs on this small device.\n\n![A small computer module, about the size of a thumb. It has a small camera attached. The lens of the camera is covered with what looks like s small round mirror.](docs/img/device.png)\n\nThis is Abra, the iOS client application running on my iPad. It shows what the server's camera sees along with the decoded deck. As you can see, the IR marks are quite visible to the camera.\n\n![A screenshot of an app containing an array of playing cards in suit and numerical order, with a black-and-white image of a deck of playing cards with edge-marks clearly visible.](docs/img/abra_ipad.png)\n\nYour iDevices can also be a server, but they can't see those infrared marks, even with special filters. However, they can see black ink marks and marks made using a different type of invisible ink - ultraviolet fluorescing ink.\n\n![A deck of cards with marks on the edges of cards that are glowing brightly under the light of a UV pen light. Next to the deck is an iPad showing the deck from it's camera's perspective.](docs/img/uv-ink.jpg)\n\nFor hard core developers, I've included the testbed, which has a bunch of visualization tools to understand how things work.\n\n![A screenshot of an app that shows a deck of cards in a viewport with marks outlined digitally, and various statistics listed below.](docs/img/steve.png)\n\nThe testbed only runs on Mac. However, the server app is a generic Linux console app and it includes a text-based GUI mode.\n\n![A text-based console app with an image of a deck of cards printed using alphanumeric characters. Statistics appear below this text-based viewport.](docs/img/whisper.png)\n\nPerformance is critical.\n\nThe statistical model requires a full 30Hz of data. Also, this can be strapped to a person's body during a performance. Efficiency means longer battery, less heat.\n\nIt can scan/decode a 1080p image to an ordered deck in as little as 4ms. On a rPI.\n\n# Get started\n\nFull documentation is available [here](https://nettlep.github.io/magic/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnettlep%2Fmagic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnettlep%2Fmagic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnettlep%2Fmagic/lists"}