The program:
-
Locate replay codes using OpenCV by locating areas of bright orange
-
Optimise the image for OCR
-
Order detected areas from top of the page going down
-
Crop and save those areas for OCR
-
OCR using an allowlist based off of Overwatch replay code's specific format to improve correctness (No O, U, I, or L)
-
Print out in order
$ go run cmd/getreplaycodes/main.go --help
Usage of cmd/getreplaycodes/main:
-image string
Path to the image file
e.g.
$ go run cmd/getreplaycodes/main.go --image cmd/getreplaycodes/assets/test/screenshot1.jpg
859MR0
QGMZ0K
6MZ63A
QNAVY1
SNRJ59
9MKHMB
The output contains each Overwatch Replay Code from the source image, from top to bottom.
tesseract --version
tesseract 5.3.4
leptonica-1.82.0
Installed per https://github.com/tesseract-ocr/tessdoc/blob/main/Installation.md#platforms
Installed via the gocv makefile https://github.com/hybridgroup/gocv?tab=readme-ov-file#ubuntulinux
As of writing, some dependencies in the makefile are outdated for Ubuntu 24.04 (libtbb2 and libfreetype6-dev) and it will fail to install. Remove them from DEBS and make install again.
Proper install from zero guide coming soon.

