TransWikia.com

What is the status of generating LaTeX from handwriting (i.e., OCR)?

TeX - LaTeX Asked by Zev Chonoles on February 1, 2021

I type fast enough that for most things it’s not a pain, but I have a few big stacks of old course notes I’d like in LaTeX which I’m dreading having to go through. So, I’m just wondering what the best solution for handwriting -> LaTeX is so far, if any.

16 Answers

So, I'm just wondering what the best solution for handwriting -> LaTeX is so far, if any.

There is none, and if there’ll ever be one it’s probably years, if not decades off. I know people who are currently working on recognizing just the layout of a document, i.e. recognizing that a paper represents a letter, etc.

That works fairly well, but it’s still research level, and going from recognizing the layout to replicating the layout using LaTeX is a big, non-obvious step. And we’re not even talking about text recognition itself.

Just text recognition (i.e. ignoring any layout issue) works fairly well today but only for plain text, not with any formatting.

That said, there’s JMathNotes which recognizes basic formulas and produces LaTeX output. It’s a nice and quite powerful proof of concept.

JMathNotes

But it’s important to realize that even though many of the individual building blocks exist, piecing together a working solution is hard.

Answered by Konrad Rudolph on February 1, 2021

Very impressed by VisualObjects Web Equation

Screenshot (of doncherry's clueless scribbling):

Screenshot

Screenshot (of Aymon's expert scribing):

Screenshot

Answered by Aymon Fournier on February 1, 2021

It's not a LaTeX solution, but very useful to me: Get a new version of a speech recognition programm and read aloud to your computer.

This is a lot faster than typing, even if you were a professionell typewriter. I bought a "premium" version. There you can define your own speech commands. So the command "techenumeration" makes the software type

begin{enumerate}
item
end{enumerate}

Give it a try, the software works way better than some years ago.

Answered by Keks Dose on February 1, 2021

Given that it hasn't been mention, detexify basically takes handwritten text and produces TeX/LaTeX code (granted on a single symbol scale).

Answered by StrongBad on February 1, 2021

An iteresting research on Mathematical Information Processing is explained here at the InftyReader project page. It's a Japanese research group.

Answered by agodemar on February 1, 2021

Inlage (http://www.inlage.com) is a Latex editor which offers recognition of handwritten formulas on Windows 7. It makes use of the Windows 7 math input panel and converts the generated MathML to Latex. See a video of how it works at Inlage II feature: Math Input Panel to LaTeX.

Note: I'm in no way affiliated with this program. TexTablet might be a free alternative.

Answered by asmaier on February 1, 2021

I'm the developer of MyScript (formerly VisionObjects), but I'm not in the research team.

TeX characters are not all supported. Gregory posted on HN a list of chars we support.

Suggestions are welcomed. Do not hesitate to send us missing symbols or UI improvement ideas.

Answered by mruellan on February 1, 2021

I have summarized the most of the current answers here or below.

I will cover now some papers, work in progress. I understand it so that the Tapio -paper, before preprocessing, uses LP -methods for his formulated QP -puzzle. The Knerr -paper uses discretization of words so one word can have many routes, now getting easily an exponential network-optimization problem. The ON-REC -method is almost the same as the REC-REC -method but some modifications. Knerr has publized a new paper "Combining diverse systems for handwritten text line recognition" (2011). The Japananese paper contains pretty much no details, mostly programming-biased rhetory or worse marketing of their InftyReader.

Academia

I. Ernesto Tapia from Freie Uni Berlin, something here but many pages broken, has publications here and his mostly-cited paper below.

  • "Recognition of on-line handwritten mathematical formulas in the e-chalk system" here

Key terms: empirical risk, structural risk, pattern recognition, QP -problem, Lagrange multipliers, theory developed by Vapnik and Chervonenkis (VC),

Perhaps important terms: radial basis functions (RBFs), polynomial kernels, hyperbolic kernels, sequential minimal optimization (SMO), --

II. Stefan Knerr (CEO of Vision Objects here, over 70 employees) has publications here, they approach the problem differently -- firstly quantifying different segments into markov chains. Then they get some sort of network -optimization problem that I cannot yet fully understand but trying.

  • "Recognition-directed recovering of temporal information from handwriting images" -paper converts words into finite state-machines like the picture here.

Key terms: frame-extraction/vector-quantization/discreate-HMMs here, discrete Hidden Markov Models (HMMs), Tabou method (1984), Baum–Welch training algorithm, ON-REC system, REC–REC system,

"(i) a left–right scan of the word—referred as SCAN–REC further, (ii) a time order of the strokes recovered previously from the static image—referred latter as REC–REC, (iii) a time order of the strokes corresponding to the true online ordering—referred as ON–REC." (the Knerr -paper)

Perhaps important things: IRONOFF database,

III. Japanese researchers such as Masakazu Suzuki, Toshihiro Kanahori, Nobuyuki Ohtake and Katsuhito Yamaguchi -- apparently something to do with Ideal Group -companies such as InftyReader here. Anyway, their most-cited paper below shows a more programming-biased -prototype.

  • "An Integrated OCR Software for Mathematical Documents and Its Output with Accessibility" (2004)

Perhaps Key terms: Unified Braille Code (UBC) by BANA (Braille Authority of North American), working requires "scanned binary images in either 600 DPI or 400 DPI"

Puzzles

  1. Is this quadratic programming problem (QP) image here? Source is the Tapia. I understand this so that the author linearize the quadratic programming problem here with Lagrange -multiplier method.

  2. "baseline structure analysis method developed by Zanibbi et al [14]. The idea is that mathematical notation can be described as a hierarchical structure of nested baselines." (the Tapia -paper I added the bolding)

  3. The Knerr -paper mentions "the second optimization process uses directed graph models" and "The number of possible paths of the ‘‘REC– REC’’ approach for a word with N segments is 2N!" (I added bolding)

Future development

Products

  • Microtask breaks the OCR-detection into games where players identify parts that are too hard for computers to detect. In exchange, the gamers can receive digital currencies.

Answered by hhh on February 1, 2021

If you use LyX on Windows 7 or later, there is a Math Input Panel Helper.

It's a little program that converts the Math Panel output to LaTeX or MathML and lets you insert math directly to LyX (or any other LaTeX editor).

Answered by omrikap on February 1, 2021

Current answer: Smart Note (for iOs and Android). First "add equation", then "export:to LaTex".

Prior answer:

On the Samsung Galaxy Note, the proprietary program "S-Note" appears to have a licensed version of VisualObjects included, which it uses to do a very creditable job of converting handwriting to formatted equations. Downside: the LaTeX is not accessible (grrr). I actually was curious so I looked inside the application and decompiled some of the java source files... and I found that internally, it is using LaTeX! So honestly I'm sure that a creditable Java hacker (which I am not) could decompile the app, and with literally just a few lines of changes, make it convert to LaTeX rather than to a bitmap. If you grep the codebase for "EquationRecognition", you'll quickly find the relevant files. You could then recompile just those classes, re-bundle the app, and sign the hacked version. (Which of course would only be legal if you have a legit license to the app.)

I know, this is not actually a useful answer, but I just spend an hour or so finding this out, so I might as well share it.

Answered by Jameson Quinn on February 1, 2021

As the author of write-math.com, I think I can give this question an update.

First of all, there are two types of handwriting recognition: On-line and Off-line. On-line recognition means you can use the information how a symbol is written, whereas in off-line recognition you only have a pixel-map (aka "image"). Imagine on-line recognition as a movie where you get exact information where the tip of the pen was, whereas in off-line recognition you only get the end result. This means on-line recognition is simpler than off-line recognition as you can always just generate the end result.

I am doing research in on-line recognition.

There is an international conference on on-line handwriting recognition called ICDAR (international conference on document analysis and recognition) and a competition called CROHME. In this competition you get a very nice data (meaning: clearly written, no errors in the input as it often occurs in real live) and your classifier has to recognize the recording. The recordings are also very simple: The symbols are written on one line (no begin{align}end{align}, but multiple fractions are possible), a very simple set of 75 allowed symbols (0-9, a-e, i-k, n, x-z, A, B, C, X, Y - you can see that this list was designed to be minimal and not have difficult combinations like 0, O, o or pi and prod), no matrices, no delayed strokes (e.g. you write a < b and then decide to correct it to a leq b). And still the best system in 2013 (by VisionObjects, see web demo) only got 60.36% correct.

There are three tasks which have to be solved:

  • single symbol recognition (quite easy): Given only a single handwritten symbol, find its LaTeX code
  • segmentation (MUCH harder): Given a handwritten equation, find which strokes belong to which symbol (not classifying the symbols but only saying "this is symbol a, this is another symbol b, ...")
  • structural analysis: given a list of symbols a and b, say if its ab or a^b or a_b. (I didn't try that by now, but I think that's relatively easy)

Why is segmentation so hard? It is the mind-blowing number of possibilities you have to segment. Suppose you have n=3 strokes. Then you could have the following segmentations:

  • 1: [[0, 1, 2]]
  • 2: [[0, 1], [2]]
  • 3: [[0, 2], [1]]
  • 4: [[0], [1, 2]]
  • 5: [[0], [1], [2]]

Possibility 3 is what makes it so complicated. I've collected a lot of recordings with write-math.com and manually segmented them. About 10% of all multi-symbol recordings have such delayed strokes (see above). The number of possibilities grows a shown in https://oeis.org/A000110 But even without delayed strokes, you still have 2^{n-1} possible ways to segment n stokes.

You can see my progress on this topic here: https://github.com/MartinThoma/hwrt/issues/21

All of my material (papers, presentations, tools) are here: http://martin-thoma.com/write-math/

TL;DR

If you have something non-trivial, you still have to write it yourself. But I try hard to change that :-)

Answered by Martin Thoma on February 1, 2021

This solution may not answer your question entirely, but if just want a write-on-the-fly solution on Windows with equations as well as handdrawing pictures, then try using TeXStudio (http://www.texstudio.org/). This software has integrated the Windows write recognization engine into itself after my request a few years ago on the software's open-source development issue tracker. See the screen snapshoot enter image description here,

the write LaTeX option is under the Wizards menu named as Math Assistant. It will then open up an OCR window as shown in the figure below.

enter image description here

Handwrite your equations on the panel, and then you only need to copy the equations shown on top as a LaTeX code to your TeXStudio input window. Or, you can just press the insert button to insert the tex code to your main text. Errors can be fixed by rewriting your equations or just by correcting the generated LaTeX code.

I have used this software to take notes on Physics classes where math and graphics are needed all the time. I use the Insert Graphic tool under the Wizards menu of the software to insert hand-drawing pictures which can be done easily from OneNote on the fly if you have a tablet (I use Thinkpad X200 tablet, Thinkpad Tablet 2 and Thinkpad Yogo 460 for taking notes electrically). If you really want to handwrite everything, you can use the default writing panel from Windows (Windows 7 and above I guess) to input your text as well, and then use the two tools I have introduced above to input handdrawing diagrams and equations all into LaTeX format.

One real example of compiled output using this technique and this set of tools can be found in my shared Notes on Classical Mechanics on Github.

Answered by Xiaodong Qi on February 1, 2021

The Mathpix app (for iOS only, Android coming soon) actually does this all on your phone via the camera.Mathpix demo

Just take pictures, and you can export as Latex, PDF, or you can get an Overleaf link (they have a really nice browser based editor). The iOS link is:

https://itunes.apple.com/us/app/mathpix/id1075870730?ls=1&mt=8

and the main website is just http://mathpix.com/.

Disclaimer: I'm the founder of Mathpix. I started working on this as a Stanford grad student in applied math, I hated how long it took to digitize my notes / homework sets. Anyway, Mathpix want to take the pain out of Latex for everyone, I hope this helps!

Answered by nicodjimenez on February 1, 2021

Answered by asmaier on February 1, 2021

I have found another application named Equatio (Google Chrome extension for Modules and Documents) that have many functionalities. Here there is the lik of the site: https://www.texthelp.com/en-us/equatio-gratis-para-profesores/#. It is free for the teachers: https://www.texthelp.com/en-us/products/free-for-teachers/

enter image description here

I have seen that this program give the possibility to convert handwriting into LaTeX code. See the part of the comment in the site

EquatIO is much more than a replacement for pen and paper problem solving. It’s smart – predicting what expression you’re trying to write, transforming your handwriting into text, and ignoring those ‘umms’ and ‘errs’ when you dictate aloud.*

Answered by Sebastiano on February 1, 2021

There is another important tool which also converts handwriting into LaTeX code by MyScript.

https://webdemo.myscript.com/views/math/index.html#

Here there is a proof make with my hand:

enter image description here

If you push in convert button you will have the conversion of your handwriting in newtxtext font.

enter image description here

Answered by Sebastiano on February 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP