Socket
Book a DemoInstallSign in
Socket

mtg-card-analyzer-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mtg-card-analyzer-sdk

a mtg ocr app for documenting a collection

0.0.3-alpha.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

MTG Card Analyzer

A collectors dream application, that gives you the ability to take pictures of your cards and have them instantly be recognized and added to your collection. This app will scan each image uploaded attempt to grab the name of the card and analyze the set image in an attempt to match it with a given set.

Example

Here is a test extraction:

Original Card

Logo Image

Name Extraction

Extracted Text: g Platinum Angel

Cleaned Extracted Text: gPlatinumAngel

Before Pre Processing

Logo Image

After Pre-Processing

Logo Image

Type Extraction

Extracted Text: E Artifact Creature —- Angel

Cleaned Extracted Text: EArtifactCreatureAngel

Before Pre-Processing

Logo Image

After Pre-Processing

Logo Image

More examples are available here

Getting Up And Running

Getting Started

Clone repo

git clone https://github.com/dills122/MTG-Card-Analyzer.git

Install dependencies

npm i

Navigate to the repo's directory, you will need to setup a few things first

  • Run this script to seed your local name dictionary
    • node .\src\db-local\bulk-insert.js
  • Create an RDS instance in AWS or any other mySql db provider
    • Create a secure.config.js with your mySql credentials (Schema below)
    • All sql scripts are located in src\data\scripts\sql, run all the table create scripts

Secure Config Schema

A template is avaliable here

    rds: {
        host: '...',
        database: '...',
        user: '...',
        password: '...'
    }

First Test Run

Once all of the setup is complete to run your first image through the processor you can use one of the test images or use the given command below.

This is deprecated in this repo now

This repo is no longer a CLI

# Run at the base directory of the repo
node index.js scan ./src/test-images/PlatinumAngel.jpg
# Might need to run as sudo on linux

Current Commands

  • scan <filePath> : this command scans a single image and outputs the results to the terminal
    • flags:
      • query or q: for disabling database manipulation (default true)
      • file or f: for processing an output file (default false)

Test images are provided at src\test-images

Backfiller utility instructions found here

Packages Under the Hood

  • fuzzyset.js
  • image-hash
  • jimp
  • string-similarity
  • tesseract.js

Keywords

mtg

FAQs

Package last updated on 28 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.