Optical Character Recognition (OCR) in Javascript in your browser

Like everything else becoming available in the browser, now there’s OCR for Javascript. The demo which you can try our here captures documents from the user’s webcam, then applies image processing to convert the image to machine readable black and white bitmap and then uses the Javascript implementation of Orcad (an GNU licensed open source OCR program), called Orcad.js to convert the processed image into text.

Even though I called it implementation before, Orcad.js was created using Emscripten, a trans-compiler which turns C or C++ code into web browser compatible Javascript (not the most accurate description of the process but that’s the general idea). Looks like an awesome tool, which I hope to have the time to play with some day. You can check it out here.

If you missed the link, demo here. Read/download Orcad.js here. The image processing is applied using glfx.js which used WebGL to accelerate image processing on the client.

There’s also a video demonstration:

Unix-like Tail function in Windows without installing new software

Windows Powershell has a powerful command that lets you view the last lines of a text file or even monitor it for new lines, similar to tail -f command in Linux. Here’s some examples:

 

The following will view the last 10 lines of Apache’s log file:

PS c:\apache\logs> gc access.log -last 10

The following will view the whole apache log file and when done, will continue waiting for new entries:

PS c:\apache\logs> gc access.log -wait

Of course the previous example is not very useful if your log file is already large, so you can combine the two commands and skip to the last lines like this:

PS c:\apache\logs> gc access.log -wait -last 10

Until I discovered the above command I used Tail Win32 to monitor log files, so this makes life easier.