Here is the test image:
You might recognize this as a Boggle board. I want to translate the image into a 4x4 array of letters. Not quite sure how to deal with rotated letters and ambiguous letters yet ('M' vs. 'W') but one problem at a time. Here's what I've done.
testcaseEASY = my_img.jpg
bin = ChanVeseBinarize[testcaseEASY]
imgs = Flatten[ImagePartition[bin, ImageDimensions[bin][[1]]/4]];
Dividing the screen up into a 4x4 array manually is pretty dumb, it seems to work. So now I have a list of the letters, and they look pretty decent.
I try to make them look a bit better:
cleaner[img_] := ColorNegate[RemoveBackground[DeleteSmallComponents[img, 1000]]]
imgsCLEANED = Map[cleaner,imgs]
Now I get this:
Why the ColorNegate? Not sure, it just gave the best results. Finally, I do
letters = {};
Do[AppendTo[letters, TextRecognize[imgsCLEANED[[i]], RecognitionPrior -> "Character"]], {i, 1, 16}];
MatrixForm[ArrayReshape[letters, {4, 4}]]
The output is
l A A W
H S A R
Y T H B
C L u
So it's pretty close but I'm obviously not quite there yet. Any ideas on how to improve this? I'm using Mathematica 12.0 if that's relevant.