Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Screengrab --> OCR -- text, GUI for options/results


  • Please log in to reply
46 replies to this topic
chrp10
  • Guests
  • Last active:
  • Joined: --
hi guys,

can you add a progress bar for this nice tool?

thanks...

  • Guests
  • Last active:
  • Joined: --
i cant seem to get this to work. Can anyone help?
where do i get all the necessary programs?

Rocky32
  • Guests
  • Last active:
  • Joined: --
I cant get tesseract to work, any help would be appreciated.

lilljimpa
  • Members
  • 127 posts
  • Last active: Feb 18 2011 05:48 PM
  • Joined: 18 Apr 2007
i get error all the time and it say's

line 317 RunWait, %mkbitmap_path%\mkbitmap %mkb_ii% -f %mkb_f% -s %mkb_s% -t %mkb_t% -o %TmpFile%.pbm %TmpFile%.ppm, %TmpDir%, hide,


help plz?
you'll have to excuse me...I'm from Sweden, so my English is not that good...(but now it's better cuz JSLover/Guest is helping me)...

wygd
  • Members
  • 10 posts
  • Last active: Aug 02 2016 06:02 AM
  • Joined: 04 Nov 2007
where can I download all programs??
many errors?
I can't run the script

EatTheCake
  • Guests
  • Last active:
  • Joined: --
Any chance we could get someone to re-upload that "ShowOCRunderMouse.zip" file?

CannedCheese
  • Members
  • 120 posts
  • Last active: Sep 24 2014 04:31 PM
  • Joined: 21 May 2008

Any chance we could get someone to re-upload that "ShowOCRunderMouse.zip" file?


Bump for this.

n-l-i-d
  • Guests
  • Last active:
  • Joined: --
My home site is offline atm, and the box on which I have the backup is dead... so, unless someone else manages to find a copy, you'll have to wait a bit, sorry...

daonlyfreez (aka n-l-i-d)

n-l-i-d
  • Guests
  • Last active:
  • Joined: --
If you want to take a shot at it yourself, get gocr.exe, and (optional: to get the captured text directly, instead of reading an output file) get cmdret.dll and cmdstub.exe (gocr.exe is a 16-bit application that needs the cmdstub.exe)

gocr accepts only grey-scale pictures of a specific format (pnm/pgm/pbm/ppm/pcx), I don't know if there is GDI code to save or get that type of picture data, but you should take a look at the GDI scripts anyway, for taking a screenshot of a specific portion of the screen (I think I used Irfanview and djpeg.exe? I don't remember)

Flow: screenshot of (a portion of) the screen > save as/convert to grey-scale pnm file > feed pnm file gocr > get gocr's output

The (simplest) command line/AHK for gocr:

RunWait, %comspec% /c gocr -i screenshot.pnm -o output.txt, %A_ScriptDir%

gocr options:

Optical Character Recognition --- gocr 0.40
using: gocr [options] pnm_file_name # use - for stdin
options:
-h - get this help
-i name - input image file (pnm,pgm,pbm,ppm,pcx,...)
-i - - read PNM from stdin (djpeg -gray a.jpg | gocr -)
-o name - output file (redirection of stdout)
-e name - logging file (redirection of stderr)
-x name - progress output (file or fifo)
-p name - database path (including final slash, default is ./db/)
-f fmt - output format (ISO8859_1 TeX HTML XML UTF8 ASCII)
-l num - threshold grey level 0<160<=255 (0 = autodetect)
-d num - dust_size (remove smaller clusters, -1 = autodetect)
-s num - spacewidth/dots (0 = autodetect)
-v num - verbose [summed]
1 print more info
2 list shapes of boxes (see -c)
4 list pattern of boxes (see -c)
8 print pattern after recognition
16 print line infos
32 debug outXX.pgm
-c string - list of chars (_ = not recognized chars, debug)
-C string - char filter (ex. hexdigits: 0-9A-Fx, only ASCII)
-m num - operation modes, ~ = switch off
2 use database (early development)
4 layout analysis, zoning (development)
8 ~ compare non recognized chars
16 ~ divide overlapping chars
32 ~ context correction
64 char packing (development)
130 extend database, prompts user (128+2, early development)
256 switch off the OCR engine (makes sense together with -m 2)
-n 1 only numbers
examples:
gocr -v 33 text1.pbm # some infos + out30.bmp
gocr -v 7 -c _YV text1.pbm # list unknown, Y and V chars
djpeg -pnm -gray text.jpg | gocr - # use jpeg-file via pipe


HTH

(rehash from Optical Character Recognition (OCR) - gocr [CLI] and the other postings on this topic)

n-l-i-d
  • Guests
  • Last active:
  • Joined: --
FYI: There is also tesseract (now at Google Code)

The Tesseract OCR engine was one of the top 3 engines in the 1995 UNLV Accuracy test. Between 1995 and 2006 it had little work done on it, but it is probably one of the most accurate open source OCR engines available. The source code will read a binary, grey or color image and output text. A tiff reader is built in that will read uncompressed TIFF images, or libtiff can be added to read compressed images.



daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
The OCR demo script is now here: ShowOCRUnderMouse.zip
Posted Image mirror 1mirror 2mirror 3ahk4.me • PM or Posted Image

Neverlevel
  • Members
  • 268 posts
  • Last active: May 05 2019 10:20 AM
  • Joined: 28 Jan 2008
been trying for like 2 days to get this to work. at all. always get errors. could somebody Simplify this a bit? to run this script you need

Gocr
Potrace
Whatever i am missing< here >

something!

i have made a folder c:\bin . and put Gocr Potrace and Mkbitmap in it


i get
Error: failed attempt to launch program or document:
Action:
params: <>

Current thread will exit.

Specifically: the system cannot find the file specified
Line#317 RunWait, %mkbitmap_path%\mkbitmap %mkb_ii% -f %mkb_f% -s %mkb_s% -t %mkb_t% -o %TmpFile%.pbm %TmpFile%.ppm, %TmpDir%, hide,

Deleting that section gives me a similar error on line 273

RunWait,cmd /c %gocr_path%\gocr -i %TmpDir%\%TmpFile%.pbm -s %ocr_s% -d %ocr_d% -m %ocr_m% -n %ocr_n% -o %TmpFile%.txt,%TmpDir%,hide

it seems like the path information is bad but getting into all these flags has me lost .
any help would be appreciated.

aznon3
  • Members
  • 13 posts
  • Last active: Feb 10 2010 12:28 AM
  • Joined: 08 Feb 2009
i get the same error. any help??

n-l-i-d
  • Guests
  • Last active:
  • Joined: --
Try the OCR demo script: ShowOCRUnderMouse.zip

HTH

EveOnline001
  • Members
  • 27 posts
  • Last active: Nov 02 2009 11:49 PM
  • Joined: 23 Mar 2009

Here is another OCR demo script: ShowOCRUnderMouse.zip (contains all needed files). It does not 'optimize' the image before OCRing, but I found that this 'optimizing' (with potrace or netpbm) does not really generate much better results.

This script will show the current text under mouse

It uses:
- GDIplusWrapper.ahk (by PhiLho)
Converts screen portion to jpg
- djpeg.exe
Converts jpg to pnm
- gocr.exe
OCRs the pnm file
- cmdret.dll/cmdstub.exe
Gets the result from gocr.exe
(since gocr.exe is a 16-bit program, cmdret.dll needs the cmdstub.exe)

When the script is running, you can press the Escape key anytime to exit


Enjoy!


Tells me it will not work with Win XP 64-bit. Any solution?