Yesterday was Google Day at work. A time to distill the frothing bubbles of inspiration and the foaming spume of innovation to form an elixir of software wonderment. It's one of the things I enjoy best about working at Metservice. The opportunity to play around with code that interests me without any kind of time pressure means it's more like playtime really.
I'm currently revisiting my old university project, and expanding it for a more nefarious use. Yesterday, I managed to get an implementation of Stochastic Diffusion Search working to correctly identify a letter 'A' in an image containing only a single letter 'A'! I know! Such a scientific breakthrough should have garnered more praise from the world's press, shouldn't it?
I used this method of 'swarm intelligence' at uni to pre-process a binary terrain map in order to match specific features responsible for inefficiencies in a popular pathfinding algorithm. I'd then highlight those features, ensuring that the algorithm avoided them when calculating the shortest route between two points. And it worked nicely (if crudely. Revisiting 10-year-old code is cringe-worthy).
However, what I failed to implement at uni were the transform-invariant properties of the algorithm; namely, finding that pesky letter 'A' when it was twice as wide as the original letter 'A'. Or twice as tall. Or twice as wide and twice as tall. And lying on its side. Asleep.
That's what I'm aiming for here. The ultimate goal is to take a font file, extract all the letters and produce a set of 26 (or 52, both lower- and upper-case) 'patterns'. Then take an image of some text (in the same font) and parse it using SDS. With a bit of luck, I should be able to find out what the word in the image is, even if some of the letters are skewed or rotated, squished or stretched. Good, eh?
It's early days, but finding that letter 'A' is a good milestone. It's a pity Google Day is only once every two weeks!