feat: add RapidOCR QEMU console capture

This commit is contained in:
2026-08-16 16:02:37 +09:00
parent 8e8ab22d30
commit 2477777e1a
5 changed files with 754 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# Development tools
## QEMU console OCR
Capture the current QEMU VGA screen and print detected console text:
```powershell
uv run python tools/qemu_ocr.py
```
Useful options:
```powershell
# Machine-readable boxes, confidence scores, and text
uv run python tools/qemu_ocr.py --json
# OCR an existing screenshot without recapturing
uv run python tools/qemu_ocr.py --image .qemu/qemu-screen.png
# Save extracted text
uv run python tools/qemu_ocr.py -o .qemu/qemu-screen.txt
```
The tool invokes `.qemu/screenshot.ps1`, runs RapidOCR with ONNX Runtime, sorts
recognized lines by screen position, and emits UTF-8 text. Screenshots and OCR
output under `.qemu/` remain ignored build artifacts.