3 ms·
I made a macOS script that OCRs text on screen. It is super handy for dealing with everything from scanned documents with account numbers to web pages with text
by schappim 5y ago
I made a macOS script that OCRs text on screen. It is super handy for dealing with everything from scanned documents with account numbers to web pages with text in images.
When I press F16, I get an image capture cursor, and the area selected is turned into text.
Example:
https://files.littlebird.com.au/Screen-Recording-2021-05-17-08-08-21-DxRy6BdGZanemgvHcV0bS5t77jD7.gif https://files.littlebird.com.au/Screen-Recording-2021-05-17-...
- nicoburns 5y agoCan you share it? That sounds pretty useful!
- jjgo 5y agoNot op, but I wrote something equivalent based on a linux script that I found [1]. Here's the mac version of the script [2]. You need tesseract [3] installed for the OCR. For launching it using a keyboard shortcut I use a hammerspoon [4]. Example of how I bind it [5] [1] https://github.com/sdushantha/bin/blob/master/utils/ocr https://github.com/sdushantha/bin/blob/master/utils/ocr [2] https://github.com/JJGO/dotfiles/blob/master/scripts/bin/ocr https://github.com/JJGO/dotfiles/blob/master/scripts/bin/ocr [3] https://pypi.org/project/pytesseract/ https://pypi.org/project/pytesseract/ [4] http://www.hammerspoon.org/ http://www.hammerspoon.org/ [5] https://github.com/JJGO/dotfiles/blob/master/mac/.hammerspoon/keyboard.lua#L68 https://github.com/JJGO/dotfiles/blob/master/mac/.hammerspoo...
- schappim 5y agoNice, I started with tesseract, but moved to Google Vision as the quality was better. Azure's offering was better for hand written notes.
- jjgo 5y agoInteresting, that doesn't really work for me as I sometimes use it to OCR sensitive stuff from scanned documents, and it wouldn't work offline. I found tesseract to work pretty reliably for my use and only fail when scanning non-ASCII characters.
- schappim 5y agoYeah, I only use it for things where the context wouldn't matter. For example grabbing an account number from a document. I've been experimenting w/ CoreImage detectors (mainly for categorisation of scanned documents based on QR codes). When I clean things up today, I'll see what can be used.
- deepdmistry 5y agoPlease share if possible, this is very useful
- jjgo 5y agoNot the original poster, but this (https://news.ycombinator.com/item?id=27177609 https://news.ycombinator.com/item?id=27177609) how I do the same thing
- schappim 5y agoEdit: I'll clean the script up and make it available as a "Show HN:" soon.
- schappim 5y agoAs promised, the Show HN is available here: https://news.ycombinator.com/item?id=27227925 https://news.ycombinator.com/item?id=27227925
- nathansherburn 5y agoThank you!
- schappim 5y agohttps://github.com/schappim/macocr https://github.com/schappim/macocr
- NetOpWibby 5y agoYou have a hit on your hands. Let me (@NetOpWibby) know if you need a website built.