Read China screens below the logo in the harness OCR

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 19:13:23 -04:00
1 parent 304c64dab8
commit db8615e5ff
1 file changed
+3 -2
+3 -2
View File
@@ -261,9 +261,10 @@ ocr_screen() {
screendump "$shot"
[[ -s $shot ]] || return 0
magick "$shot" -colorspace gray -negate -resize 150% "$prepped" 2>/dev/null || return 0
# tesseract spaces out CJK characters, so China runs also emit each line without spaces.
# The logo and the black strip under foot throw tesseract off CJK, so China runs also read between them, without spaces.
if [[ $REGION == "china" ]]; then
tesseract "$prepped" - --psm 6 -l "$OCR_LANGS" 2>/dev/null | sed 'p; s/ //g' || true
magick "$shot" -gravity north -chop 0x35% -gravity south -chop 0x4% -colorspace gray -negate -resize 150% "$prepped.text.png" 2>/dev/null || return 0
{ tesseract "$prepped" - --psm 6 -l "$OCR_LANGS"; tesseract "$prepped.text.png" - --psm 6 -l "$OCR_LANGS"; } 2>/dev/null | sed 'p; s/ //g' || true
else
tesseract "$prepped" - --psm 6 -l "$OCR_LANGS" 2>/dev/null || true
fi