OCR magic: image to text
Transform Images into Text - Java
More showcases >// Initialize OCR engine
AsposeOCR api = new AsposeOCR();
OcrInput images = new OcrInput(InputType.SingleImage);
images.add("image1.png");
// Recognize images
ArrayList<RecognitionResult> results = api.Recognize(images);
System.out.println(results[0].recognition_text);
Why Choose Aspose.OCR for Java?
Discover the seamless world of Aspose.OCR for Java – a potent, easy-to-use, and cost-effective OCR API. With less than 5 lines of Java code, add OCR functionality to your applications without delving into complex math or neural networks. Our robust OCR engine boasts superior speed and accuracy, supporting 28 languages, including Latin, Cyrillic, and Chinese scripts. From scanned images and smartphone photos to screenshots and scanned PDFs, retrieve results in popular document and data exchange formats. Benefit from pre-processing filters that handle rotated, skewed, and noisy images. Optimize recognition performance and system load by offloading resource-intensive tasks to the GPU.
Swift and Precise OCR
Achieve high-speed and accurate OCR results with our advanced Java technology.
Multilingual Support
Recognize text in 28 languages, including Latin, Cyrillic, and Chinese scripts.
Adaptable Image Support
Process images from various sources, such as scanners, cameras, and smartphones.
Chinese Character Mastery
Recognize more than 6,000 Chinese characters with unparalleled precision.
Font Styles and Format Integrity
Preserve font styles and formatting for faithful representation of recognized Java text.
Live code sample
Experience the simplicity: Transform image to text in few lines of Java code!
* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.
Convert image to text
Explore More Examples >AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput images = new OcrInput(InputType.SingleImage);
images.add("image1.png");
images.add("image2.png");
// Recognition language
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setLanguage(Language.Eng);
// Recognize images
ArrayList<RecognitionResult> results = api.Recognize(images, recognitionSettings);
results.forEach((result) -> {
System.out.println(result.recognition_text);
});
Java Everywhere
Aspose.OCR for Java seamlessly operates on any platform supporting Java SE 6.0 or above – be it a local machine, web server, or the cloud.
Supported file formats
Aspose.OCR for Java can work with virtually any file you can get from a scanner or camera. Recognition results are returned in the most popular file and data exchange formats that can be saved, imported to a database, or analyzed in real time.
Images
- JPEG
- PNG
- TIFF
- GIF
- Bitmap
Batch OCR
- Multi-page PDF
- ZIP
- Folder
Recognition results
- Text
- Microsoft Word
- Microsoft Excel
- HTML
- RTF
- ePub
- JSON
- XML
Effortless Installation
Aspose.OCR for Java is distributed as a lightweight Java Archive (JAR) file or as a downloadable file with minimal dependencies. Simply install it into your project, and you’re all set to recognize texts in multiple supported languages and save recognition results in various formats.
Request a trial license to kickstart the development of a fully functional OCR application without limitations.
Java, Everywhere
Our library fully supports Java SE 6 or above, enabling your applications to run seamlessly on any platform – desktop Windows, Windows Server, macOS, Linux, and the cloud.
28 Recognition Languages
Our Java OCR API recognizes numerous languages and popular writing scripts, including mixed languages:
Leave language detection to the library or define the language yourself for enhanced recognition performance and reliability.
- Extended Latin alphabet: Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Italian, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish;
- Cyrillic alphabet: Belorussian, Bulgarian, Kazakh, Russian, Serbian, Ukrainian;
- Over 6,000 Chinese characters;
- Hindi.
Empowering Features and Capabilities
Aspose.OCR for Java Explore the advanced features and capabilities of Aspose.OCR for Java.
Photo OCR
Extract text from smartphone photos with scan-level accuracy.
Searchable PDF
Convert any scan into a fully searchable and indexable document.
URL recognition
Recognize an image from URL without downloading it locally.
Bulk recognition
Read all images from multi-page documents, folders and archives.
Any font and style
Identify and recognize text in all popular typefaces and styles.
Fine-tune recognition
Adjust every OCR parameter for best recognition results.
Spell checker
Improve results by automatically correcting misspelled words.
Find text in images
Search for text or regular expression within a set of images.
Compare image texts
Compare texts on two images, regardless of the case and layout.
Web Link Image Recognition
Seamlessly recognize images directly from web links, enhancing OCR integration in your Java projects.
Automatic Misspelled Word Correction
Enhance OCR results by automatically correcting misspelled words, ensuring accuracy in your Java applications.
Full Integration with Aspose Ecosystem
Integrate Aspose.OCR for Java seamlessly with other Aspose products for a comprehensive and efficient Java solution.
Code Samples
Explore the code samples to learn how to seamlessly integrate Aspose.OCR for Java into your applications.
Installation
Post-installation, you can promptly commence using Aspose.OMR for Java, albeit with certain limitations. A temporary license lifts all trial version restrictions for 30 days. Utilize this period to initiate the development of a fully functional OCR application, allowing you to make an informed decision on purchasing Aspose.OCR for Java at a later stage.
Recognize text on scanned images in Java
Overcome the challenge of OCR applications lacking widespread scanners. Our API boasts powerful built-in image pre-processing filters that adeptly handle rotated, skewed, and noisy images. Combined with support for all image formats, it ensures reliable recognition even from smartphone photos. Most pre-processing and image correction are automated, requiring your intervention only in challenging cases.
Apply Automatic Image Corrections - Java
// Create instance of OCR API
AsposeOCR api = new AsposeOCR();
// Define pre-processing filters
PreprocessingFilter filters = new PreprocessingFilter();
filters.add(PreprocessingFilter.ToGrayscale());
filters.add(PreprocessingFilter.Rotate(-90));
// Pre-process image before recognition
BufferedImage imageRes = api.PreprocessImage(imagePath, filters);
// Recognize image
RecognitionResult result = api.RecognizePage(imageRes, set);
Extract text from photos in Java
Integrate text detection and recognition in your Java applications. Access precise results from photos with ease, enhancing your image processing capabilities. Elevate image processing capabilities, obtaining accurate results from photos.
Detect and recognize text on photo - Java
// Add a photo to the recognition batch
OcrInput images = new OcrInput(InputType.SingleImage);
images.add("photo.jpg");
// Set photo recognition mode
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setDetectAreasMode(DetectAreasMode.PHOTO);
// Extract text from a photo
ArrayList<RecognitionResult> results = api.Recognize(images, recognitionSettings);
results.forEach((result) -> {
System.out.println(result.recognition_text);
});
Resource Optimization in Java
Optical character recognition demands resources. Our API offers flexible ways to balance the classic time-price-quality triad. It allows you to restrict the number of threads utilized by the recognition engine. While this adjustment may lead to a slower recognition speed, it enables you to allocate resources for concurrent tasks like parallel image processing, web server operations, database management, or background data analysis.
- Choose between thorough recognition and fast recognition.
- Specify the number of threads allocated for recognition, or allow the library to automatically scale to the number of processor cores.
- Free up the CPU by offloading calculations to the GPU.
Balancing resources uasage
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setThreadsCount(2);
Fast Recognition with minimal setup
If you images are high-quality scans without skew or distortion, you can use the fastest recognition mode that consumes minimum possible resources using:
Fast Recognition OCR - Java
AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput images = new OcrInput(InputType.SingleImage);
images.add(os.path.join(self.dataDir, "source1.png"));
images.add(os.path.join(self.dataDir, "source2.png"));
// Fast recognize images
ArrayList<RecognitionResult> results = api.RecognizeFast(images);
results.forEach((result) -> {
System.out.println(result);
});