Aspose.OCR for Python via Java API docs
|
AsposeOcr main class for recognition. More...
Public Member Functions | |
__init__ (self) | |
typing.List[SkewOutput] | calculate_skew (self, OcrInput input) |
Calculates the skew angles of an images. | |
bool | compare_image_texts (self, str fullPath1, str fullPath2, RecognitionSettings settings=None, bool ignoreCase=True) |
Check if two images contain the same text. | |
str | correct_spelling (self, str text, SpellCheckLanguage language) |
Corrects text (replaces misspelled words). | |
typing.List[RectangleOutput] | detect_rectangles (self, OcrInput input, aspose.models.AreasType areasType, bool isDetectAreas) |
Detects text areas on images. | |
bool | image_has_text (self, str fullPath, str text, RecognitionSettings settings=None, bool ignoreCase=True) |
Check if the image contains the provided text fragment. | |
float | image_text_diff (self, str fullPath1, str fullPath2, RecognitionSettings settings=None, bool ignoreCase=True) |
Compare the texts on the two images and return a number representing how similar they are (0 to 1). | |
typing.List[RecognitionResult] | recognize (self, OcrInput input, RecognitionSettings settings=None) |
Recognizes image with the ability to specify RecognitionSettings. | |
typing.List[RecognitionResult] | recognize_car_plate (self, aspose.models.OcrInput input, aspose.recognitionsettings.CarPlateRecognitionSettings settings=None) |
Recognizes car plate with the ability to specify CarPlateRecognitionSettings. | |
typing.List[RecognitionResult] | recognize_fast (self, OcrInput input) |
Recognizes text on good quality image. | |
typing.List[RecognitionResult] | recognize_id_card (self, aspose.models.OcrInput input, aspose.recognitionsettings.IDCardRecognitionSettings settings=None) |
Recognizes ID card with the ability to specify IDCardRecognitionSettings. | |
typing.List[RecognitionResult] | recognize_invoice (self, aspose.models.OcrInput input, aspose.recognitionsettings.InvoiceRecognitionSettings settings=None) |
Recognize invoice with the ability to specify InvoiceRecognitionSettings Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64. | |
typing.List[RecognitionResult] | recognize_lines (self, OcrInput input, RecognitionSettings settings=None) |
Recognizes single line image with the ability to specify RecognitionSettings. | |
typing.List[RecognitionResult] | recognize_passport (self, aspose.models.OcrInput input, aspose.recognitionsettings.PassportRecognitionSettings settings=None) |
Recognizes passport with the ability to specify PassportRecognitionSettings. | |
typing.List[RecognitionResult] | recognize_receipt (self, aspose.models.OcrInput input, aspose.recognitionsettings.ReceiptRecognitionSettings settings=None) |
Recognize receipts with the ability to specify ReceiptRecognitionSettings. | |
typing.List[RecognitionResult] | recognize_street_photo (self, OcrInput input) |
Recognizes text on street photos. | |
shutdown (self) | |
Shut down the JVM machine. | |
Static Public Member Functions | |
save_multipage_document (str fullFileName, Format saveFormat, List results) | |
Allows to get multipage document from list of RecognitionResult objects. | |
AsposeOcr main class for recognition.
This sample shows how to recognize image.
__init__ | ( | self | ) |
typing.List[SkewOutput] calculate_skew | ( | self, | |
OcrInput | input | ||
) |
Calculates the skew angles of an images.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. The container with sources. |
bool compare_image_texts | ( | self, | |
str | fullPath1, | ||
str | fullPath2, | ||
RecognitionSettings | settings = None , |
||
bool | ignoreCase = True |
||
) |
Check if two images contain the same text.
fullPath1 | Path to the first image. |
fullPath2 | Path to the second image. |
settings | Recognition settings. |
ignoreCase | True - means a case-insensitive search. |
str correct_spelling | ( | self, | |
str | text, | ||
SpellCheckLanguage | language | ||
) |
Corrects text (replaces misspelled words).
text | Text for correction. |
language | Dictionary to use SpellCheckLanguage. |
typing.List[RectangleOutput] detect_rectangles | ( | self, | |
OcrInput | input, | ||
aspose.models.AreasType | areasType, | ||
bool | isDetectAreas | ||
) |
Detects text areas on images.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
areasType | Determinates wich rectangles to return - line, paragraphs or words. |
isDetectAreas | Enable automatic text areas detection. |
bool image_has_text | ( | self, | |
str | fullPath, | ||
str | text, | ||
RecognitionSettings | settings = None , |
||
bool | ignoreCase = True |
||
) |
Check if the image contains the provided text fragment.
fullPath | Path to the image. |
text | Text fragment for searching on the image. |
settings | Recognition settings. |
ignoreCase | True - means a case-insensitive search. |
float image_text_diff | ( | self, | |
str | fullPath1, | ||
str | fullPath2, | ||
RecognitionSettings | settings = None , |
||
bool | ignoreCase = True |
||
) |
Compare the texts on the two images and return a number representing how similar they are (0 to 1).
fullPath1 | Path to the first image. |
fullPath2 | Path to the second image. |
settings | Recognition settings. |
ignoreCase | True - means a case-insensitive search. |
typing.List[RecognitionResult] recognize | ( | self, | |
OcrInput | input, | ||
RecognitionSettings | settings = None |
||
) |
Recognizes image with the ability to specify RecognitionSettings.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | RecognitionSettings object. |
typing.List[RecognitionResult] recognize_car_plate | ( | self, | |
aspose.models.OcrInput | input, | ||
aspose.recognitionsettings.CarPlateRecognitionSettings | settings = None |
||
) |
Recognizes car plate with the ability to specify CarPlateRecognitionSettings.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | CarPlateRecognitionSettings |
typing.List[RecognitionResult] recognize_fast | ( | self, | |
OcrInput | input | ||
) |
Recognizes text on good quality image.
Doesn't use automatic image skew correction and text areas detection. Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
typing.List[RecognitionResult] recognize_id_card | ( | self, | |
aspose.models.OcrInput | input, | ||
aspose.recognitionsettings.IDCardRecognitionSettings | settings = None |
||
) |
Recognizes ID card with the ability to specify IDCardRecognitionSettings.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | IDCardRecognitionSettings |
typing.List[RecognitionResult] recognize_invoice | ( | self, | |
aspose.models.OcrInput | input, | ||
aspose.recognitionsettings.InvoiceRecognitionSettings | settings = None |
||
) |
Recognize invoice with the ability to specify InvoiceRecognitionSettings Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | InvoiceRecognitionSettings |
typing.List[RecognitionResult] recognize_lines | ( | self, | |
OcrInput | input, | ||
RecognitionSettings | settings = None |
||
) |
Recognizes single line image with the ability to specify RecognitionSettings.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | RecognitionSettings object. |
typing.List[RecognitionResult] recognize_passport | ( | self, | |
aspose.models.OcrInput | input, | ||
aspose.recognitionsettings.PassportRecognitionSettings | settings = None |
||
) |
Recognizes passport with the ability to specify PassportRecognitionSettings.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | PassportRecognitionSettings |
typing.List[RecognitionResult] recognize_receipt | ( | self, | |
aspose.models.OcrInput | input, | ||
aspose.recognitionsettings.ReceiptRecognitionSettings | settings = None |
||
) |
Recognize receipts with the ability to specify ReceiptRecognitionSettings.
Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
settings | ReceiptRecognitionSettings |
typing.List[RecognitionResult] recognize_street_photo | ( | self, | |
OcrInput | input | ||
) |
Recognizes text on street photos.
Extract text from street photos, traffic camera images, ID cards, driver licenses, and other images with sparse text and noisy/colored backgrounds. Supports GIF, PNG, JPEG, WBMP, TIFF, JFIF, TIFF, PDF, binary array, folder, array, zip archive, URL, base64.
input | :py:any:~aspose.models.OcrInput . instance. |
|
static |
Allows to get multipage document from list of RecognitionResult objects.
fullFileName | Filename with a path for saving recognition result in the selected format. |
saveFormat | Document format (Docx, Txt, Pdf, Xlsx, Xml, Json). |
results |
shutdown | ( | self | ) |
Shut down the JVM machine.