from Hacker News

Frog: OCR Tool for Linux

by Epitom3 on 11/22/22, 11:10 AM with 46 comments

  • by recuter on 11/22/22, 12:11 PM

    Appears to be a nice wrapper around Tesseract:

    https://github.com/tesseract-ocr/tessdata

    https://en.wikipedia.org/wiki/Tesseract_(software)

    The demo of course works perfectly on a Mac as this is already built into Ventura.

    If you haven't experienced it yet ye olde ctrl-f now seamlessly sneaks a peak into images on the page for example, surprisingly useful.

      In November 2020, Brewster Kahle from the Internet Archive praised Tesseract saying:
    
      Tesseract has made a major step forward in the last few years. When we last evaluated the accuracy it was not as good as the proprietary OCR, but that has changed– we have done evaluations and it is just as good, and can get better for our application because of its new architecture.
    
    Anybody have an up to date breakdown of available OCR solutions?
  • by twobitshifter on 11/22/22, 3:14 PM

    On windows this is built into powertoys. win+shift+T is the default shortcut.

    https://learn.microsoft.com/en-us/windows/powertoys/text-ext...

  • by mavu on 11/22/22, 2:18 PM

    I probably shouldn't but I dislike using libraries for the main part of your project and then not even mentioning that you are using them.

    Seems dishonest to me, but maybe I'm just too strict.

  • by rjzzleep on 11/22/22, 1:01 PM

    This looks like a nice app. I was looking for something like this a while back until I noticed that there are "one" liners that can you can setup for a hotkey:

        #!/usr/bin/env bash
        langs=(eng ara fas chi_sim chi_tra deu ell fin heb hun jpn kor nld rus tur)
        lang=$(printf '%s\n' "${langs[@]}" | dmenu "$@")
        maim -us | tesseract --dpi 145 -l eng+${lang} - - | xsel -bi
  • by lervag on 11/22/22, 9:58 PM

    Cool! I've seen similar ideas before and made my own inspired by these some years ago. It's a simple bash script based on Flameshot [0] for taking the screenshot and Tesseract:

        #!/usr/bin/env bash
    
        rm -f /tmp/screen.png
        flameshot gui -p /tmp/screen.png
    
        tesseract \
          -c page_separator="" \
          -l "eng" \
          --dpi 145 \
          /tmp/screen.png /tmp/screen
    
        if [ "$(wc -l < /tmp/screen.txt)" -eq 0 ]; then
          notify-send "ocrmyscreen" "No text was detected!"
          exit 1
        fi
    
        xclip /tmp/screen.txt
        notify-send "ocrmyscreen" "$(cat /tmp/screen.txt)"
    
    [0]: https://flameshot.org/
  • by ensocode on 11/22/22, 1:07 PM

    This is a nice app, thanks. I am using a similar a bit less UI-heavy tool based on Tesseract as well. It's called Normcap: https://github.com/dynobo/normcap
  • by xchip on 11/22/22, 12:33 PM

    Nice, but it should give credits to Tesseract and mention how much HD space it requires for the UI dependencies.
  • by seltzered_ on 11/22/22, 2:30 PM

    Oh nice. There hasn't been a good ocr screenshot tool with Wayland support yet so look forward to trying this. IIRC there's been..

    Linux: dpScreenOCR - x11 only last I checked in and now Frog

    MacOS: screenotate, prizmo

    Windows: screenotate

    I don't get all the nitpick comments. OCR tools like this are extremely useful when dealing with excerpting text from certain websites (slack) or taking class notes from video.

  • by habibur on 11/22/22, 12:13 PM

    Uses tesseract OCR on the ocr part.
  • by schappim on 11/22/22, 7:30 PM

    FYI if you’re on a Mac, I’ve made this similar tool: https://github.com/schappim/macOCR
  • by noisediver on 11/22/22, 12:35 PM

    A useful tool and great UI work. A handy extension would be the ability to extract text of specific colour, e.g. the highlights in Kindle's Cloud Reader, to get around the 10% highlight export cap that Amazon puts on most books. I did this previously by running the screenshot through ImageMagick's colour filling and thresholding options before passing the output to Tesseract. A colour picker tool might be a nice addition.
  • by throwawaaarrgh on 11/22/22, 12:22 PM

    ....why is it named frog?
  • by jalacang on 11/22/22, 1:29 PM

    L