2014-10-08 15 views
6

Jestem nowy w tesseract OCR. Próbowałem przekonwertować obraz na tif i uruchomić go, aby zobaczyć, jaki wynik z tesseract przy użyciu cmd w systemie Windows, ale nie mogłem. Możesz mi pomóc? Jakiego polecenia użyć?Czy mogę przetestować tesseract ocr w linii poleceń systemu Windows?

Oto mój przykładowy obraz:

enter image description here

+0

Proszę wyjaśnić, co próbowałem bardziej szczegółowo. – Vish

+0

@Vish Zainstalowałem bibliotekę tesseract z jej witryny. i z cmd próbowałem przekonwertować obraz tekstowy. dane wyjściowe tesseract imagename.tif. Ale nie udało się uzyskać żadnego wyniku. – Akunar

+0

Dla wpisanej składni wynik jest zapisywany w pliku output.txt. Czy sprawdziłeś, czy taki plik został utworzony? Czy możesz też gdzieś przesłać swój plik TIF? Jeśli dostanę trochę czasu, mogę sprawdzić z moją instalacją tesseract. – Vish

Odpowiedz

12

Najprostsza składnia tesseract.exe jest tesseract.exe inputimage output-text-file. Założeniem jest tutaj, że tesseract.exe jest dodawany do zmiennej środowiskowej PATH. Możesz dodać argument -psm N, jeśli Twój argument tekstowy jest szczególnie trudny do rozpoznania.

Widzę, że regularna składnia (bez żadnych przełączników -psm) działa wystarczająco dobrze z załączonym obrazem, chyba że poziom dokładności nie jest wystarczająco dobry.

Należy pamiętać, że znaki spoza angielskiego (takie jak symbol obok recepty) nie są rozpoznawane; moja domyślna instalacja zawiera tylko angielskie dane szkoleniowe.

Oto opis składni tesseract:

C:\Users\vish\Desktop>tesseract.exe 
Usage:tesseract.exe imagename outputbase [-l lang] [-psm pagesegmode] [configfile...] 

pagesegmode values are: 
0 = Orientation and script detection (OSD) only. 
1 = Automatic page segmentation with OSD. 
2 = Automatic page segmentation, but no OSD, or OCR 
3 = Fully automatic page segmentation, but no OSD. (Default) 
4 = Assume a single column of text of variable sizes. 
5 = Assume a single uniform block of vertically aligned text. 
6 = Assume a single uniform block of text. 
7 = Treat the image as a single text line. 
8 = Treat the image as a single word. 
9 = Treat the image as a single word in a circle. 
10 = Treat the image as a single character. 
-l lang and/or -psm pagesegmode must occur before anyconfigfile. 

Single options: 
    -v --version: version info 
    --list-langs: list available languages for tesseract engine 

A oto wyjście dla obrazu (UWAGA: Po pobraniu go, jest konwertowany do obrazu PNG):

C:\Users\vish\Desktop>tesseract.exe ECL8R.png out.txt 
Tesseract Open Source OCR Engine v3.02 with Leptonica 

C:\Users\vish\Desktop>type out.txt.txt 
1 Project Background 

A prescription (R) is a written order by a physician or medical doctor to a pharmacist in the form of 
medication instructions for an individual patient. You can't get prescription medicines unless someone 
with authority prescribes them. Usually, this means a written prescription from your doctor. Dentists, 

optometrists, midwives and nurse practitioners may also be authorized to prescribe medicines for you. 

It can also be defined as an order to take certain medications. 

A prescription has legal implications; this means the prescriber must assume his responsibility for the 
clinical care ofthe patient. 

Recently, the term "prescriptionΓÇ¥ has known a wider usage being used for clinical assessments, 
Powiązane problemy