Самый простой tesseract.exe синтаксис tesseract.exe inputimage output-text-file
. Предполагается, что tesseract.exe добавляется к переменной окружения PATH
. Вы можете добавить аргумент -psm N
, если ваш текстовый аргумент особенно трудно распознать.
Я вижу, что регулярный синтаксис (без каких-либо переключателей -psm
) работает достаточно хорошо с прикрепленным изображением, если уровень точности не достаточно хорош.
Обратите внимание, что неанглийские символы (такие как символ рядом с рецептом) не распознаются; моя установка по умолчанию содержит только данные обучения на английском языке.
Вот описание синтаксиса тессеракт:
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
А вот выход для изображения (Примечание: Когда я скачал его, он преобразуется в 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,
Пожалуйста, объясните, что вы попробовали более подробно. – Vish
@Vish Я установил библиотеку tesseract со своего сайта. и из cmd я попытался преобразовать текстовое изображение. tesseract imagename.tif. Но не получилось. – Akunar
Для введенного синтаксиса вывод сохраняется в файле output.txt. Вы проверяли, что такой файл был создан? Кроме того, вы можете загрузить файл TIF где-нибудь? Если я получу какое-то время, я смогу проверить свою установку tesseract. – Vish