This tool extracts 7-segment-style timestamps from images (e.g., old digital cameras, CCTV), allows manual correction via a visual tool, and updates EXIF DateTimeOriginal
metadata accordingly.
The pipeline consists of three steps:
-
Extract Date Strings (OCR)
Rundates_to_json.py
to detect and OCR date stamps intooutput.json
. -
Manual Correction & HSV Tuning
Launch the visual tool inhsv_filter_tool/
to inspect and correct extracted dates. -
Update EXIF Metadata
Useupdate_files.py
to write these dates into the image files' EXIF data.
python3 -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -r requirements.txt
Install Tesseract:
- Ubuntu:
sudo apt install tesseract-ocr
- macOS (Homebrew):
brew install tesseract
- Windows: UB Mannheim Tesseract
wget https://github.com/Shreeshrii/tessdata_ssd/raw/refs/heads/master/ssd.traineddata -O 7seg.traineddata
sudo mv 7seg.traineddata /usr/share/tesseract-ocr/5/tessdata/
Then verify:
tesseract --list-langs # should list '7seg'
Install and serve with:
npm install -g http-server
cd hsv_filter_tool
http-server
Open your browser to http://localhost:8080
python dates_to_json.py /path/to/image_folder --debug
Creates output.json
.
- Visit
http://localhost:8080
- Upload:
- Images
output.json
- Correct dates manually.
- Click Export JSON to download updated metadata.
python update_files.py /path/to/updated_metadata.json
Optional: --dry-run
to preview changes.
.
├── dates_to_json.py
├── hsv_filter_tool/
│ ├── config.json
│ ├── index.html
│ ├── script.js
│ └── style.css
├── requirements.txt
└── update_files.py
MIT