This project automatically:
- Reads person IDs from the bottom of photos using OCR.
- Renames images using the detected ID.
- Generates unique ArUco markers for each person.
- Creates a mapping between ArUco IDs and Person IDs.
- Scans ArUco markers using a webcam and identifies the corresponding person.
Python 3.9+ is recommended.
Verify installation:
python --versionpython -m venv venv
venv\Scripts\activatepip install opencv-contrib-python
pip install pytesseract
pip install numpy
pip install pandasOr install everything at once:
pip install opencv-contrib-python pytesseract numpy pandasThis project uses Tesseract OCR to read IDs from images.
Download and install:
https://github.com/UB-Mannheim/tesseract/wiki
After installation, update the path inside:
pytesseract.pytesseract.tesseract_cmd = \
r"C:\Program Files\Tesseract-OCR\tesseract.exe"Place all photos inside:
photos/
Example:
photos/
├── img1.jpg
├── img2.jpg
├── img3.jpg
The person's ID should be visible near the bottom of each image.
Run:
python index.pyThe script:
- Reads the bottom section of each image
- Extracts the ID using OCR
- Renames the image using the detected ID
- Stores the result in:
renamed_photos/
Example:
Before:
img1.jpg
img2.jpg
After:
22011001.jpg
22011002.jpg
Run:
python marker_generator.pyThe script:
- Reads all files in:
renamed_photos/
- Creates a unique ArUco marker for each person
- Saves markers in:
aruco_markers/
- Creates:
marker_mapping.csv
Example:
marker_id,person_id
0,22011001
1,22011002
2,22011003Generated markers:
aruco_markers/
├── 22011001_aruco.png
├── 22011002_aruco.png
├── 22011003_aruco.png
You can:
- Print markers on paper
- Display them on phones
- Attach them to ID cards
Each marker uniquely identifies a person.
Run:
python scanenr.pyThe script:
- Opens the webcam
- Detects ArUco markers
- Looks up the marker in:
marker_mapping.csv
- Displays the corresponding Person ID
Example:
Detected Person ID: 22011001
Press:
ESC
to exit.
Original Photo
│
▼
OCR Reads ID
│
▼
Photo Renamed
│
▼
Generate ArUco Marker
│
▼
Save Mapping CSV
│
▼
Print Marker
│
▼
Scan Marker
│
▼
Retrieve Person ID