A web application that scans Pokémon trading cards using OCR (Optical Character Recognition) and provides real-time market prices and card information.
- Card Recognition: Automatically identifies Pokémon cards from images
- Price Lookup: Displays current market prices from TCGPlayer
- Multiple Input Methods: Upload images or use your webcam to scan cards
- Detailed Card Information: View card set, rarity, artist, and other details
- Side-by-Side View: Compare your scanned card with the official card image
- Frontend: HTML, CSS, JavaScript
- Backend: Node.js, Express
- OCR: Google Cloud Vision API for text extraction
- Card Data: Pokémon TCG API
- Image Processing: Custom algorithms to enhance OCR accuracy
Before you begin, ensure you have the following:
- Node.js (v14 or higher)
- npm
- A Pokémon TCG API key (get one at https://dev.pokemontcg.io/)
- Google Cloud Vision API credentials
To use the OCR functionality, you'll need to create a Google Cloud Vision API project and download a credentials file named google-credentials.json.
-
Go to the Google Cloud Console
-
Click on Select a project and then New Project
-
Enter a project name and click Create
-
Navigate to the Vision API page
-
Click Enable
-
Go to the Service Accounts page
-
Click Create Service Account
-
Enter a name (e.g., vision-api-user) and click Create and Continue
-
Under "Role", select Project > Editor and click Done
-
In the list of service accounts, click on the one you just created
-
Go to the Keys tab and click Add Key > Create new key
-
Select JSON and click Create
-
A file will be downloaded — rename this file to google-credentials.json
-
Move google-credentials.json to the root directory of your project
-
Open your .env file and add the following line (Note: It's better to use the path to the file rather than putting the entire JSON in .env):
GOOGLE_APPLICATION_CREDENTIALS=./google-credentials.json
Now your application is ready to authenticate with the Google Cloud Vision API.
-
Clone the repository:
git clone https://github.com/ABreadLoaf/Final-project.git cd pokemon-card-scanner -
Install dependencies:
npm install
-
Create your environment file:
cp .env.example .env
-
Edit the
.envfile with your API keys and configuration. -
Start the server:
npm start
-
Open your browser and navigate to:
http://localhost:3000
- Open the application in your browser
- Click on "Upload Image" if not already selected
- Either drag and drop your card image or click to browse your files
- Select an image of a Pokémon card
- Click "Scan Card"
- View the results showing your card image, the official card image, and pricing information
- Open the application in your browser
- Click on "Use Webcam"
- Allow webcam access when prompted
- Position your Pokémon card in the frame
- Click "Capture & Scan"
- View the results showing your captured image, the official card image, and pricing information
The application works through several steps:
- Image Acquisition: Get card image via upload or webcam
- Image Preprocessing: Enhance image for better OCR results
- Text Extraction: Use Google Cloud Vision API to extract text from the card
- Card Identification: Match extracted text to cards in the Pokémon TCG database
- Data Retrieval: Get official card data and pricing information
- Display Results: Show all information in a user-friendly interface
Common issues and solutions:
- Card Not Recognized: Ensure the card name is clearly visible and the image is well-lit
- Incorrect Card Identified: Try taking a picture of just the card name at the top
- Webcam Not Working: Make sure you've granted camera permissions to the browser
- API Error: Check that your API keys in the .env file are valid
- Pokémon TCG API for providing card data and pricing information
- Google Cloud Vision API for OCR capabilities
- The Pokémon Company for creating these amazing cards
Project Link: https://github.com/ABreadLoaf/Final-project.git