News for hackers. Stuff that matters.
Re:Ask HN: What are some tools / libraries you built yourself? by schappim on Sunday May 16, 2021 @06:10PM (#27177508)
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-...

Re:Ask HN: What are some tools / libraries you built yourself? by schappim on Sunday May 16, 2021 @06:24PM (#27177591)
Edit: I'll clean the script up and make it available as a "Show HN:" soon.
Re:Ask HN: What are some tools / libraries you built yourself? by schappim on Thursday May 20, 2021 @05:58PM (#27227933)
As promised, the Show HN is available here: https://news.ycombinator.com/item?id=27227925
Re:Ask HN: What are some tools / libraries you built yourself? by nathansherburn on Friday May 21, 2021 @01:59AM (#27230961)
Thank you!
Re:Ask HN: What are some tools / libraries you built yourself? by schappim on Friday May 21, 2021 @03:58AM (#27231544)
Re:Ask HN: What are some tools / libraries you built yourself? by NetOpWibby on Sunday May 16, 2021 @06:25PM (#27177599)
You have a hit on your hands. Let me (@NetOpWibby) know if you need a website built.
Re:Ask HN: What are some tools / libraries you built yourself? by deepdmistry on Sunday May 16, 2021 @06:21PM (#27177572)
Please share if possible, this is very useful
Re:Ask HN: What are some tools / libraries you built yourself? by jjgo on Sunday May 16, 2021 @06:33PM (#27177666)
Not the original poster, but this (https://news.ycombinator.com/item?id=27177609) how I do the same thing
Re:Ask HN: What are some tools / libraries you built yourself? by nicoburns on Sunday May 16, 2021 @06:13PM (#27177524)
Can you share it? That sounds pretty useful!
Re:Ask HN: What are some tools / libraries you built yourself? by jjgo on Sunday May 16, 2021 @06:26PM (#27177609)
Not 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

[2] https://github.com/JJGO/dotfiles/blob/master/scripts/bin/ocr

[3] https://pypi.org/project/pytesseract/

[4] http://www.hammerspoon.org/

[5] https://github.com/JJGO/dotfiles/blob/master/mac/.hammerspoo...

Re:Ask HN: What are some tools / libraries you built yourself? by schappim on Sunday May 16, 2021 @06:36PM (#27177699)
Nice, I started with tesseract, but moved to Google Vision as the quality was better.

Azure's offering was better for hand written notes.

Re:Ask HN: What are some tools / libraries you built yourself? by jjgo on Sunday May 16, 2021 @06:45PM (#27177793)
Interesting, 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.
Re:Ask HN: What are some tools / libraries you built yourself? by schappim on Sunday May 16, 2021 @06:51PM (#27177864)
Yeah, 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.