Read spaced-out CJK in the harness OCR
This commit is contained in:
1 parent
b7edf95ecb
commit
304c64dab8
1 file changed
+6
-1
@@ -261,7 +261,12 @@ ocr_screen() {
|
||||
screendump "$shot"
|
||||
[[ -s $shot ]] || return 0
|
||||
magick "$shot" -colorspace gray -negate -resize 150% "$prepped" 2>/dev/null || return 0
|
||||
tesseract "$prepped" - --psm 6 -l "$OCR_LANGS" 2>/dev/null || true
|
||||
# tesseract spaces out CJK characters, so China runs also emit each line without spaces.
|
||||
if [[ $REGION == "china" ]]; then
|
||||
tesseract "$prepped" - --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
|
||||
}
|
||||
|
||||
# Wait until the console shows the given text. Saves the offending screen as
|
||||
|
||||
Reference in new issue
Block a user