Screengrab --> OCR -- text, GUI for options/results
can you add a progress bar for this nice tool?
thanks...
where do i get all the necessary programs?
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?
many errors?
I can't run the script
Any chance we could get someone to re-upload that "ShowOCRunderMouse.zip" file?
Bump for this.
daonlyfreez (aka n-l-i-d)
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)
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.
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.
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?