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.
![](https://cdn.hackaday.io/images/6645501600880487726.jpg)
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.
![](https://cdn.hackaday.io/images/6375471600880841789.jpg)
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:
![](https://cdn.hackaday.io/images/7652141600880965601.png)
Use dilation to eliminate the noise:
![](https://cdn.hackaday.io/images/2305401600881036663.png)
Edge detect the objects:
![](https://cdn.hackaday.io/images/6544861600881072339.png)
Then use contours to identify where the objects are:
![](https://cdn.hackaday.io/images/362081600881225695.jpg)
And the happy result after using Tesseract on each of the table cells:
![](https://cdn.hackaday.io/images/9347991600881771857.png)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.