SESHAT: Handwritten math expression parser
github.com
github.com
[1] https://riunet.upv.es/handle/10251/51665
I've tried the web demo and for me it works quite well. In my case, definite integrals work except for the "dx" which gets interpreted as "d_x" for no apparent reason.
Some years ago I did some work in this direction which might be relevant: it only involved the formula structure analysis with an improved version of the DRACULAE algorithm from Zanibbi et al. (also cited in SESHAT's paper), starting from given characters (no symbol recognition except for hand-drawn fraction bars) freely positioned/scaled on the page. It delivers layout/presentation markup (MathML, DRACULAE tree), semantic encoding (OpenMath), natural language (English) and speech output, all in Javascript: http://matracas.org/tacto/
At the time, speech worked in Firefox, Chrome and even Safari, but nowadays only works in Firefox. I don't remember whether it worked in Opera but all other features did.
[Edit to add:] My application does not implement matrices either, just arithmetics including exponents, subindexes, and fractions.
For example, it doesn't seem to know about matrices. That's fine, but when you enter one, it comes up with spectacular failures. I got integrals (probably because an integral sign somewhat matches the 'opening parenthesis' of a matrix) i^i, cases where it almost randomly stringed together parts of a matrix, etc.
My point is that assembling the symbols into a complete expression does not seem to work as reliably yet.
I had a look at the PhD thesis on the approach and it seems that the algorithm essentially relies on relative positioning only, plus some heuristics for symbols with "appendages" like 'd' or 'p' (This probably explains how "dx" ends up as "d_x").
If it were to additionally take into account relative sizes also, performance might improve a bit.
Edit: Though, thinking of it, does anyone know of research into decomposing images of text into stroke patterns? It seems like it's a problem that must have had some decent research on it...
The confusion of a garden path sentence is caused by a prefix being parsed differently from the final sentence, but "Handwritten math expression" parses as one would expect here.