This commit is contained in:
Chris Kruining 2026-02-05 09:41:07 +01:00
parent 86aa0f856c
commit 0801ceee6a
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
310 changed files with 6712 additions and 418 deletions

151
TestImages/README.md Normal file
View file

@ -0,0 +1,151 @@
# Test Images
This directory contains **225 reference images** for testing card recognition algorithms without requiring actual hardware.
## Directory Structure
| Category | Count | Description |
|----------|-------|-------------|
| `reference_alpha/` | 47 | Alpha edition reference cards (old frame) |
| `varying_quality/` | 38 | Different lighting, blur, exposure, angles |
| `single_cards/` | 19 | Individual card photos |
| `real_photos/` | 18 | Phone camera photos from Visions project |
| `foreign/` | 16 | Non-English cards (Japanese, German, French, etc.) |
| `worn/` | 15 | Heavily played, damaged, worn cards |
| `foil/` | 14 | Foil cards with holographic glare/reflections |
| `low_light/` | 14 | Poor lighting, glare, shadows, amateur photos |
| `tokens/` | 13 | Tokens and planeswalker emblems |
| `hands/` | 11 | Cards held in hand (partial visibility) |
| `ocr_test/` | 10 | Images optimized for OCR testing |
| `reference/` | 9 | High-quality reference scans |
| `multiple_cards/` | 6 | Multiple cards in frame |
| `augmented/` | 4 | Augmented training examples |
| `training_examples/` | 3 | ML training set samples |
| `angled/` | 2 | Perspective distortion |
## Image Sources
Images from open-source MIT-licensed projects:
- [hj3yoo/mtg_card_detector](https://github.com/hj3yoo/mtg_card_detector)
- [tmikonen/magic_card_detector](https://github.com/tmikonen/magic_card_detector)
- [fortierq/mtgscan](https://github.com/fortierq/mtgscan)
- [LauriHursti/visions](https://github.com/LauriHursti/visions)
- [KLuml/CardScanner](https://github.com/KLuml/CardScanner)
- [dills122/MTG-Card-Analyzer](https://github.com/dills122/MTG-Card-Analyzer)
- [ryanlin/Turtle](https://github.com/ryanlin/Turtle)
Additional images from:
- Reddit r/magicTCG (user-submitted photos)
- Flickr (Creative Commons)
- Card Kingdom / Face to Face Games grading guides
- Scryfall (foreign language card scans)
## Usage
```csharp
[Theory]
[InlineData("varying_quality/test1.jpg")]
[InlineData("angled/tilted_card_1.jpg")]
[InlineData("hands/hand_of_card_1.png")]
[InlineData("foil/rainbow_foil_secret_lair.jpg")]
[InlineData("worn/hp_shuffle_crease.webp")]
[InlineData("foreign/japanese_aang.jpg")]
public async Task RecognizeCard_VaryingConditions(string imagePath)
{
using var stream = File.OpenRead(Path.Combine("TestImages", imagePath));
var result = await _recognitionService.RecognizeCardAsync(stream);
Assert.True(result.Success);
Assert.NotNull(result.Card);
Assert.True(result.Confidence >= 0.7f);
}
```
## Category Details
### foil/
Foil cards showing holographic effects that challenge recognition:
- Rainbow foils with color-shifting (`rainbow_foil_secret_lair.jpg`)
- Surge foils with holo stickers (`surge_foils_holo.jpeg`)
- Old-style foils (`old_foil_yawgmoth.jpg`)
- Textured/dragonscale foils (`dragonscale_foil.jpg`)
- Foil curling examples showing warping
### worn/
Heavily played and damaged cards:
- Edge whitening (`edge_white.png`, `very_good_*.jpg`)
- Scratches and scuffs (`scratch.png`, `hp_scratches.png`)
- Creases and bends (`hp_shuffle_crease.webp`, `bent_creased.jpg`)
- Binder damage (`hp_binder_bite_*.webp`)
- Water damage (`hp_water_warping.png`)
- Corner damage (`hp_compromised_corner.webp`)
### low_light/
Poor lighting and amateur photography conditions:
- Glare from toploaders/sleeves (`glare_toploader.png`)
- Direct light causing hotspots (`glare_straight_down.jpg`)
- Depth of field blur (`dof_blur_amateur.jpg`)
- Amateur condition photos with shadows
- Flickr collection shots with mixed lighting
### foreign/
Non-English cards (8 languages):
- Japanese (日本語)
- German (Deutsch)
- French (Français)
- Italian (Italiano)
- Spanish (Español)
- Russian (Русский)
- Simplified Chinese (简体中文)
- Korean (한국어)
### tokens/
Tokens and planeswalker emblems:
- Official WotC tokens
- Custom/altered tokens
- Planeswalker emblems (Elspeth, Gideon, Narset)
- Token collections and gameplay shots
### varying_quality/
Images with various real-world challenges:
- Different camera exposures
- BGS graded cases (`counterspell_bgs.jpg`)
- Cards in plastic sleeves (`card_in_plastic_case.jpg`)
- Various lighting conditions
- 28 numbered test images (`test1.jpg` - `test27.jpg`)
### reference_alpha/
47 Limited Edition Alpha cards for old-frame recognition:
- Power Nine (Black Lotus, Ancestral Recall, Moxen, etc.)
- Dual lands (Underground Sea, Volcanic Island, etc.)
- Classic staples (Lightning Bolt, Counterspell, Sol Ring)
### hands/
Cards held in hand - partial visibility, stacked:
- Various deck archetypes (Tron, Green, Red)
- New and old frame cards
- Different lighting conditions
### real_photos/
Phone camera photos from Visions project:
- Real-world scanning conditions
- Various resolutions and crops
- Includes processed result images
### ocr_test/
From CardScanner project, graded by difficulty:
- `card0-4.jpg`: Easier recognition
- `card10-13.jpg`: Harder recognition (noted ~less accuracy)
## TODO: Additional Categories Needed
- [ ] **double_faced/** - Transform/MDFC cards (both sides)
- [ ] **art_cards/** - Art series cards without text boxes
- [ ] **promos/** - Extended art, borderless, showcase frames
- [ ] **very_low_light/** - Near-dark conditions
- [ ] **motion_blur/** - Cards in motion during scanning
## License
Card artwork is property of Wizards of the Coast. Images used for testing/research purposes only.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Some files were not shown because too many files have changed in this diff Show more