Optical Character Recognition for monospace code snippets

250 Views Asked by At

OCR can be used to recognize characters of a wide variety of fonts, size and positions in any picture.

Does there exists a tool that is optimized to recognize code? Since screenshots of code is often mono-space, I imagine that there are algorithms that take advantage of this fact and are thus optimized to recognize indentation, characters in certain intervals of x/y in the image etc.

Does such a tool exist yet or has anyone attempted to build such a tool?

I imagine it would be super useful in cases of say YouTube tutorials where the creator hasn't posted the source code and the viewer would need to retype it (and run into mistyping etc.). One could then just screenshot the code snippet and convert it to the actual text version, keeping indentation and all.

0

There are 0 best solutions below