Optical character recognition API for Python
Extract text from scanned images, photos, and screenshots, create searchable PDFs, search and compare text in images, and more from Python applications.Download Free Trial
Aspose.OCR for Python via .NET is a powerful, while easy-to-use optical character recognition (OCR) engine for your Python applications and notebooks. In less than 10 lines of code, you can recognize text in 28 languages based on Latin, Cyrillic, and Asian scripts, returning results in the most popular document and data interchange formats. There is no need to learn complex mathematical models, build machine learning algorithms and train neural networks — our simple and robust API will do everything for you.
The library works equally well with all sources, from a high-quality scan to a quick photo on a smartphone. Whether the image is rotated, distorted or noisy — automatic pre- and post-processing filters provide the highest recognition accuracy in the shortest time.
At a Glance
Extract text in major European and Asian languages from any image type
- ID cards
- License plates
- and more...
- and more...
Aspose.OCR for Python via .NET works under Python version 3.6 or later
- Windows 7
- Windows 8
- Windows 10
- Windows 11
- Windows Server 2008
- Windows Server 2012
- Windows Server 2016
- Windows Server 2019
- Windows Server 2022
Supported File Formats
Convert any image from a scanner, camera or Internet to the most popular document and data exchange formats
- Searchable PDF
- Microsoft Word
- Microsoft Excel
- Plain text
Features and capabilities
Extract text from scans, photos and screenshots
Convert scanned PDF to searchable and indexable PDFs
Read Latin, Cyrillic and Asian scripts in all popular typefaces
Recognize more than 6,000 Chinese characters
Extract text from handwritten notes, memos and medical records
Work with blurry, distorted, rotated, and noisy images
Identify and preserve content blocks from the original text layout
Detect and read areas of an image: paragraphs, lines and single words
Bulk process multipage documents, folders and archives
Recognize images from the Internet without downloading
Identify and automatically correct misspelled words
Find text in images and intelligently compare image texts
Easy to use
You only need 5 lines of code to recognize the image and display the result. Yes, it really is that simple!
Live code sample - Python 3
# Initialize OCR engine recognitionEngine = AsposeOcr() # Add image to batch input = OcrInput(InputType.SINGLE_IMAGE) input.add("sample.png") # Extract text from image result = recognitionEngine.recognize(input) # Display the recognition result print(result.recognition_text)
28 recognition languages
Aspose.OCR for Python via .NET can recognize a large number of languages and all popular writing scripts, including texts with mixed languages:
- Extended Latin alphabet: Croatian, Czech, Danish, Dutch, English (including handwritten script), Estonian, Finnish, French, German, Italian, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Slovak, Slovene, Spanish, Swedish.
- Cyrillic alphabet: Belorussian, Bulgarian, Kazakh, Russian, Serbian, Ukrainian.
- Chinese: more than 6,000 characters.
You can also read texts in other languages based on extended Latin and Cyrillic, even if they are not directly supported by the OCR engine. For example, Latin, Vietnamese, Gaelic, and so on.
Powerful processing filters
The accuracy and reliability of optical character recognition is highly dependent on the quality of the original image. Aspose.OCR for Python via .NET offers a large number of fully automated and manual image processing filters that enhance an image before it is sent to the OCR engine:
- Automatically straighten images aligned at a slight angle to the horizontal.
- Manually rotate severely skewed images.
- Automatically remove dirt, spots, scratches, glare, unwanted gradients, and other noise.
- Automatically adjust the image contrast.
- Automatically upscale, or manually resize the image.
- Convert images to black and white or grayscale.
- Invert image colors so that light areas appear dark and dark areas appear light.
- Increase the thickness of characters in an image.
- Blur noisy images while preserving the edges of letters.
- Straighten page curvature and fix camera lens distortion for page photos.
These filters can be combined and applied to the entire image or only to selected areas of the image, as well as in batch processing. Not only can you fine-tune preprocessing in the recognition pipeline, but you can also store processed images for display, caching, and debugging.
Optimized for specific document types
Aspose.OCR for Python via .NET offers specially trained neural networks to extract text from certain types of images with maximum accuracy:
- Scanned or photographed ID cards and passports.
- Vehicle license plates.
Built-in spell checker
Although Aspose.OCR for Python via .NET provides high recognition accuracy, printing defects, dirt, or non-standard fonts may cause certain characters or words to be recognized incorrectly. To further improve recognition results, you can turn on spell checker, which finds and automatically corrects spelling errors based on the selected recognition language.
If the recognized text contains specialized terminology, abbreviations, and other words which are not present in common spelling dictionaries, you can provide your own word lists.
Creating searchable PDFs
Even with the highest recognition accuracy, the original image may contain a lot of important non-textual information or simply be of great historical value. Aspose.OCR for Python via .NET offers a simple and elegant solution to combine the best of both worlds. We extract text from an image, PDF document or file package and place it as an invisible text layer on top of the original images. The result is saved in PDF format, which is the industry standard for storing and sharing documents. The resulting files can be searched and indexed, and the text can be selected and copied in the same way as if you selected and copied the original characters.
Aspose.OCR for Python via .NET allows you to recognize multiple files, regardless of their number and type, as simple as reading a single image. With a single API call, you can recognize multiple pages from an auto-feed scanner or extract vehicle license plates from automatic traffic cameras.
The results can be saved as searchable PDF document or spreadsheets, or returned as plain text, JSON or XML for further analysis.
Support and Learning Resources
- Learning Resources
- Tutorial Videos
- Product Support
- Free Support
- Paid Support
- Release Notes
- Why Aspose.OCR for Python via .NET?
- Customers List
- Success Stories
Aspose also offers native OCR APIs for other popular programming languages: