# Why does cropping an image improve TextRecognize so much?

I am trying to use the TextRecognize function to extract data from certain screenshots. This is already a cropped version.

Using TextRecognize on this yields 12 Catherine FicktEuSC|'\A|V|K. Not very satisfactory. Isolating the last word, however:

This yields FicktEuschAMK. Why is this different? I tried converting the image to black and white first (both using ColorConvert and Binarize), but that didn't improve anything. Is there any way to get the desired result without having to crop the former image even more? This is problematic because I can't tell where the first word ends and the second one begins, without manual inspection.

• I can only surmise that TextRecognize employs meta-level analyses to determine if the text in question is likely to appear in a dictionary or not. Once it determines that "Catherine" appears in the dictionary, it "assumes" that the final character string will as well, leading to the erroneous transcription. However, when applied to the last character string alone, it determines that the word does not appear in the dictionary and recognizes it character-by-character (correctly). You should be able to test this with other word/non-word pairs. Mar 11, 2015 at 0:19
• In support of @DavidG.Stork's hypothesis, setting the language to German via TextRecognize[img, Language -> "German"] gives an almost correct text recognition. Mar 11, 2015 at 1:44
• You can also cheat which works perfectly. Mar 11, 2015 at 1:54

For this example, it seems that setting the Alpha Channel to .1 yields correct result across all languages without needing to crop.

TextRecognize[img ~SetAlphaChannel~ .1,
Language -> #] &  /@ {"English", "French", "German", "Spanish",
"Portuguese", "Italian"}

{"12 Catherine FicktEuschAMK", "12 Catherine FicktEuschAMK", "12
Catherine FicktEuschAMK", "12 Catherine FicktEuschAMK", "12 Catherine
FicktEuschAMK", "12 Catherine FìcktEuschAMK"}


(PS: it's "my secret trick", don't tell anybody...hi,hi,hi)

• With versions from 10.4.1 to 11.1.0 this trick doesn't work... Mar 30, 2017 at 13:41