Close

Digitally Peeking Inside A Pack Of Pokemon Cards

A project log for X-Ray CT scanners get new life

Two small GE Explore Locus SPs find a new home, and they happen to be mine.

ahron-wayneAhron Wayne 07/16/2024 at 23:511 Comment

You heard me. For realzies. It's the dream of every pokemon-loving kid who ends up buying an x-ray microCT scanner on ebay, right? Cutting to the chase: It works. 

This here is enough of an image of a Gengar from INSIDE of a pack. Specifically, the one on the left:

I got these while on a business trip in Utah, at a little game shop in a mall. They said they were dropped off by an old lady with a shoe box --- if you know anything about vintage trading cards, pokemon, MTG, yugioh... you know that the packs can be searched, specifically by weighing. A skeptical person would say that there was no old lady, no shoebox, and no foils to be found. 

Thanks, reddit guy! You were wrong! 

There are several keys to this, and I don't feel bad about sharing anymore because, 1, someone else independently posted about this 2 weeks ago, causing me a huge amount of consternation and driving me to make a big post and get it out there blitz so I don't get left behind, and 2: very, very luckily, I filed for a provisional patent for this somewhat more than two weeks ago. That's right: this is PATENT PENDING, BABY! 

Some keys are resolution, signal to noise, contrast, and flattening. For tackling the first 3 it helps to use a brute force approach of ridiculous numbers of projection images, exposure time, and some techniques taken from for instance my experience scanning industrial batteries...

Like, for anyone trying this --- it is really helpful to do just a corner instead of go through the whole thickness. Remember, the goal isn't to image the whole card, it's to see enough of the card to know conclusively which one it is. There are only 16 possibilities per set! Seeing, or not seeing, the evolution symbol knocks out a bunch of choices. Seeing, or not seeing, a fist, or wing, or tentacle or whatever does the same. 

And virtual flattening is for sure informed by my experience with the Vesuvius Challenge and the ancient herculaneum scrolls --- if you have just a small amount of contrast, it's more important than ever to make sure the slicing plane is along the surface you're looking at exactly. The part we're interested in is only a couple dozen microns thick, whereas the bending of the card in the pack might be several millimeters! 

In Dragonfly, this is done by creating a "radial basis function", a group of points that you manually place along the surface of the card, and which can be projected onto a virtual flat plan. Boom --- secret is out (or rather, it was, 2 weeks ago... I'm just giving out a bit more detail maybe). 

Not the best example, but you can even measure stuff like centering, which contributes to the value of the card. 

I've actually been working on this for a while --- intensely since the first Herculaneum scroll was read enough to know that I did my part, whatever it was. At that point the machine really and truly became a testbed just for this. I gave a tiny preview in an earlier post, but I was actually focused on the idea of 2D x-ray imaging to determine the result --- this would be way faster and more portable. And I think it's possible, but it's really, really, really hard. Way harder than brute forcing it with a CT scanner, even a crappy one (a bit easier with a good modern machine). 

There IS in fact enough contrast in foil cards to show up with 2D x-ray images:

Hitmonchan (japanese, looks different):

This also incidentally provides a pretty easy tell for fake cards --- however they show up, it looks different. 

The problem, as you might have guessed, as that you can't just plop a pack in front of an x-ray detector and snap an image.

And that's because, the single, nonfoil cards cause noise --- they contribute to beam hardening, reducing contrast. They cause scatter. And then it's just like trying to see something through multiple panes of stained glass.

These are some examples of nonfoil cards --- compare naked machamp with 5 and 10 cards in front. 

If you know he's there, no problem. But you'll be fighting about it if you don't. In my first simulated example, I thought a clefairy was a zapdos --- was sure of it. The human brain is awesome at picking out patterns; it also means we're great at finding things that aren't there. 

Me and a couple of really really good ML researchers tried our darndest in a hundred different ways to denoise these images and produce a reliable silhouette of the original card. It's probably possible with enough training data, but the couple of hundred images I took by hand --- or the thousands of synthetic examples, couldn't do it.  

Here is kind of the current state of the art. And it's still somewhat overfit; not as good for an image taken on a different day. 

So yeah. Digitally peeking inside a pack of pokemon, cards. I have no idea who figured it out first --- maybe someone has been doing this for years. Considering the age of my machine, it's been possible for at least twenty.

NO IT DOES NOT WORK WITH SCRATCH OFF TICKETS!

Discussions

fchavez2 wrote 08/19/2024 at 22:30 point

You never cease to amaze me Ahron, Great job. You are an inspiration to scrappy engineers all over the world.

  Are you sure? yes | no