Property of Dylan Roberts — Personal Archive · Est. 2026

Document Ref: DR-RESEARCH-001 · Rev. 2026 Open File Classification: Development & Research
Research File · 19 June 2026

Viridian: An Open Pokémon Card Grading Pipeline

Abstract. Professional trading-card grading is slow, costly, and opaque: a collector mails a card away and waits weeks for a single number. Viridian is an open pipeline that estimates that number from a phone photo in seconds. It detects and rectifies the card, identifies exactly which card it is by pooled ORB feature voting, and then — the key step — aligns the card's known-centered catalogue image to the photo with a homography, so centering is measured against ground truth rather than guessed. The result is a defensible centering measurement, a confident identification (or an honest “not sure”), and a live market value.

Introduction

The grade of a collectible card is mostly a story about its edges. Grading houses such as PSA score a card on four criteria — centering, corners, edges, and surface — and condense them into a single 1–10 grade that can swing a card's value by an order of magnitude. The process is authoritative but expensive and slow, and the reasoning behind a grade is rarely shown to the owner.

Viridian asks a narrower, more honest question: how much of that judgement can a commodity phone camera and classical computer vision recover, transparently, in real time? The answer is “a useful amount” — provided the system separates what it can measure from what it can only estimate, and says so plainly.

System Overview

Viridian is a single engine wrapped by three front-ends — a FastAPI web app, a Discord bot, and a CLI — so every surface returns an identical result for the same photo. A request flows through six stages: capture, detect & rectify, identify, reference-align, grade, and price.

The six-stage Viridian pipeline.
Figure 1. The end-to-end pipeline. A photo is flattened, identified against the full card index, aligned to its reference image, graded, and priced. Each stage may abstain rather than emit a low-confidence guess.

Detection and Rectification

A phone photo shows the card at some angle, against some background, under some lighting. The first job is to recover a clean, head-on image of just the card. Viridian locates the card's four corners, orders them consistently, and applies a perspective warp that maps that quadrilateral onto a fixed canonical rectangle. Everything downstream then works in the same normalised frame.

When edge detection cannot find a confident boundary, the pipeline falls back to segmentation rather than forcing a bad quad — a wrong rectangle is worse than none, because it would silently corrupt every later measurement.

Identification

Knowing which card is in the photo unlocks reliable grading, because it gives us a reference image to compare against. Viridian identifies cards with local feature matching rather than a trained classifier, so a new set works the day it is indexed — no retraining.

Perceptual-hash shortlist and ORB re-ranking

A fast perceptual hash (pHash) nearest-neighbour search produces a shortlist of candidates. Because a phone photo differs from a clean scan in perspective and lighting — exactly the differences pHash is weakest against — the shortlist is re-ranked by ORB (Oriented FAST and Rotated BRIEF) feature matches, counted with Lowe's ratio test.

Global ORB voting

The most reliable path skips the shortlist gate. Every indexed card's ORB descriptors are pooled into a single FLANN-LSH index; a scan's descriptors are matched against the whole pool, and each good match votes for the card it came from. The card with the most votes wins — removing the risk that a perceptual hash ranks the correct card off the shortlist before ORB ever sees it.

Crucially, identification is confidence-gated: a winner is only reported if it clears an absolute vote floor, beats the runner-up by a margin, and exceeds a dominance ratio. A genuinely ambiguous photo returns no identification rather than a wrong one.

Centering: Measurement, Not Guesswork

Centering is the one criterion classical CV can measure objectively, because it is purely geometric. Early versions measured it blindly from the photo and were only ~60% correct on perfectly centered cards, because a blind detector cannot reliably tell a card's frame from its artwork: every set lays out differently.

Identification fixes this. Once we know the card, we have its clean catalogue image, which is known to be centered. Viridian ORB-aligns that reference to the photo with a homography robust to holo, glare, and tilt, then maps a symmetric reference frame through it: any asymmetry that appears is the card's real physical miscut, with no frame-detection guesswork.

Centering measured as border asymmetry after reference alignment.
Figure 2. Because the reference frame is known-centered, the four border widths after alignment give the true horizontal and vertical ratios directly. A 73/27 horizontal offset caps the grade well below a PSA 10 (front tolerance ~55/45).

A side effect of alignment is surface analysis: the holographic pattern is present in both images, so it cancels in the aligned difference — only genuine whitening or damage survives. Promising, but still experimental.

Grade and Value Estimation

Viridian is deliberate about confidence. Centering is surfaced as a real measurement. Corners, edges, and surface are heuristic and reported with low confidence — explicitly a rough estimate, not a PSA sub-grade. A small CNN, exported to ONNX for fast CPU inference (~2.4 ms/card), runs alongside the classical grade as a second opinion until it is trustworthy.

For value, Viridian queries the TCGdex API for fresh TCGplayer (USD) and Cardmarket (EUR) prices and converts to GBP. These are raw market prices — real data. A rough per-grade multiplier (a PSA 10 modelled at ~5× raw) yields a ballpark graded value, clearly labelled as an estimate.

Deployment

The same engine powers all three front-ends, so a grade obtained on the website, in Discord, or from the CLI is identical. The service runs comfortably on a modest VPS: ONNX CPU inference keeps the ML path cheap, and the heavy cost is the optical work, not the model.

Limitations and Future Work

  • Corners, edges, and surface remain heuristic — the obvious target for the CNN once it is trustworthy across layouts.
  • The graded-value multiplier is coarse — real graded comparables would replace the fixed table.
  • Identification depends on the index — a card absent from the catalogue abstains rather than guesses.
  • Surface-from-difference is the most promising thread: the aligned, holo-cancelled difference image is a clean substrate for whitening and scratch detection.

Conclusion

Viridian shows that a phone photo and classical computer vision can recover a genuinely useful slice of card grading — an objective centering measurement, a reliable identification, and a live valuation — provided the system is honest about its confidence. The decisive idea is to identify first and measure second: once the card is known, its known-centered reference turns a guessing problem into a measurement problem.

References

  1. E. Rublee, V. Rabaud, K. Konolige, G. Bradski. “ORB: An efficient alternative to SIFT or SURF.” ICCV, 2011.
  2. D. G. Lowe. “Distinctive image features from scale-invariant keypoints.” IJCV 60(2), 2004.
  3. M. Muja, D. G. Lowe. “Fast approximate nearest neighbors” (FLANN). VISAPP, 2009.
  4. G. Bradski. “The OpenCV Library.” 2000. opencv.org
  5. PSA. “PSA Grading Standards.” psacard.com
  6. TCGdex — open TCG API. tcgdex.dev

Viridian is an independent open project, not affiliated with Nintendo, The Pokémon Company, or PSA. Grades and values are automated estimates for guidance only, not professional appraisals. “PSA” and “Pokémon” are trademarks of their respective owners.

← Back to research archive