Testing the OCR With Some Real Tiles

A project log for TMD-2: Turing Machine Demonstrator Mark 2

Build a Turing machine based on TMD-1 but with support for more states and symbols.

michael-gardiMichael Gardi 09/23/2020 at 17:260 Comments

For my last bit of OCR testing I wanted to use a photo of some real printed tiles on a printed base. So I created a single state "card" with rectangular indentations for tiles.

Since I will be combining six of these I wanted to scale things down as much as possible and still be useable.  You can see the A tiles above for comparison, the larger being from TMD-1.  The smaller tiles still feel pretty good and are easy to pick and place. Notice that the empty spots above have a square dot as a "place holder".

The Pi camera was not in yet so I just used my phone to take this shot.

The process is almost as before. One change is that I now identify where the black borders are around and between the "cells" and use a "flood fill" algorithm with white to eliminate them.  Here is the resulting binary image:

Use dilation to eliminate the noise:

Edge detect the objects:

Then use contours to identify where the objects are:

And the happy result after using Tesseract on each of the table cells:

Since the size seems good I will print five more of these "cards" for states B, C, D, E, and F. I'll also make a legend down the side with each row's actions: Read, Write, Move, and Goto and combine them all on a base of some sort. I'll also have to figure out a way to mount the Pi camera above this base.