Click here to Skip to main content
Click here to Skip to main content

Multi-Platform OCR with LEADTOOLS 18

, 1 Feb 2013 CPOL
Multi-Platform OCR with LEADTOOLS 18.

Editorial Note

This article is in the Product Showcase section for our sponsors at CodeProject. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers.

Introduction

With the release of LEADTOOLS Version 18, also known as LEADTOOLS Anywhere™, LEAD Technologies has expanded its reach as the world’s leading imaging SDK by providing new multi-platform imaging libraries for iOS, OS X, Android and Linux. Viewers, annotations and markups, OCR, barcode, PDF, image formats, compression, image processing and more are just a sampling of what LEADTOOLS has to offer any developer, not just those targeting Windows.

Programmers using LEADTOOLS can experience a set of libraries that closely resemble each other on every development platform. This is a distinct advantage for developers whose goal is to create native versions of their apps on multiple platforms. Even if your plan is to develop for a single platform, LEADTOOLS provides a programmer friendly interface for every major platform out there, and the flexibility and peace of mind to easily expand in the future.

Key Features in LEADTOOLS Anywhere™ SDKs

  • Image Viewer Controls designed specifically for .NET, HTML5, WinRT, iOS, OS X and Android
  • Load, convert and save more than 150 image formats
    • Advanced bit depth, color space and compression support for common formats including PDF, PDF/A, JPEG, JPEG 2000, TIFF, JBIG2 and more
  • OCR to convert images to searchable text, PDF and DOC
  • Barcode reading and writing for QR, PDF417, Data Matrix, UPC/EAN and more
  • Comprehensive Annotation and Markup including geometric shapes, sticky note, redact, highlight and rubber stamp
  • Over 200 Image processing functions for enhancing, correcting and manipulating images

The OCR Code

In the examples that follow, we’ll show how to convert a platform-native image into a LEADTOOLS RasterImage, and then use the OCR engine to extract the searchable text. Alternatively, developers can use the RasterCodecs object to load and save their images. However, using LEAD’s conversion utilities is a powerful asset for existing applications because it requires minimal changes to your current code base.

.NET

System.Drawing.Bitmap bitmap = ... // 
// Get a LEADTOOLS RasterImage from the platform image
RasterImage rasterImage = RasterImageConverter.FromImage(bitmap);
// Create a LEADTOOLS OCR Document instance
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineAdvantage, false);
ocrEngine.Startup(null, null, null, Application.CommonAppDataPath);
IOcrDocument ocrDocument = ocrEngine.DocumentManager.CreateDocument();
// Add the page to the document and recognize it
IOcrPage ocrPage = ocrDocument.Pages.AddPage(rasterImage, null);
// Recognize the image as text
string text = ocrPage.RecognizeText(null);
// Do something with 'text'

WinRT

Windows.UI.Xaml.Media.ImageSource imageSource = ... //
// Get a LEADTOOLS RasterImage from the platform image
RasterImage rasterImage = RasterImageConverter.ConvertFromImageSource(imageSource, ConvertFromImageOptions.None);
// Create a LEADTOOLS OCR Document instance
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(null, null, string.Empty, Package.Current.InstalledLocation.Path);
IOcrDocument ocrDocument = ocrEngine.DocumentManager.CreateDocument();
// Add the page to the document and recognize it
IOcrPage ocrPage = ocrDocument.Pages.AddPage(rasterImage, null);
// Recognize the image as text
string text = ocrPage.RecognizeText(null);
// Do something with 'text'

iOS & OS X

UIImage* uiImage = ... //
// Get a LEADTOOLS RasterImage from the platform image
LTRasterImage* rasterImage = [LTRasterImageConverter convertFromImage:uiImage
     options:LTConvertFromImageOptions_None
       error:nil];
// Create a LEADTOOLS OCR Document instance
[ocrEngine startup:nil workDirectory:nil startupParameters:[[NSBundle mainBundle] bundlePath];
LTOcrDocument* ocrDocument = [ocrEngine.documentManager createDocument];
// Add the page to the document and recognize it
LTOcrPage* ocrPage = [ocrDocument.pages addPageWithImage:rasterImage
   target:nil
   selector:nil
   error:nil];
// Recognize the image as text
NSString* text = [ocrPage recognizeText:nil selector:nil error:nil];
// Do something with 'text'

Android

android.graphics.Bitmap bitmap = ... //
// Get a LEADTOOLS RasterImage from the platform image
RasterImage rasterImage = RasterImageConverter.convertFromBitmap(bitmap, ConvertFromImageOptions.NONE);
// Create a LEADTOOLS OCR Document instance
OcrEngine ocrEngine = OcrEngineManager.createEngine(OcrEngineType.Advantage);
ocrEngine.startup(null, "", null, this.getApplicationInfo().dataDir);
OcrDocument document = ocrEngine.getDocumentManager().createDocument();
// Add the page to the document and recognize it
OcrPage ocrPage = document.getPages().addPage(image, null);
// Recognize the image as text
String text = ocrPage.recognizeText(this);
// Do something with 'text'

Download the Full Examples

You can download fully functional demos which includes the features discussed above. To run these examples you will need the following:

Support

Need help getting this sample up and going? Contact our support team for free technical support! For pricing or licensing questions, you can contact our sales team (sales@leadtools.com) or call us at 704-332-5532.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

LEADTOOLS Support
Help desk / Support LEAD Technologies, Inc.
United States United States
With a rich history of over twenty years, LEAD has established itself as the world's leading provider of software development toolkits for document, medical, multimedia, raster and vector imaging. LEAD's flagship product, LEADTOOLS, holds the top position in every major country throughout the world and boasts a healthy, diverse customer base and strong list of corporate partners including some of the largest and most influential organizations from around the globe. For more information, contact sales@leadtools.com or support@leadtools.com.
Group type: Organisation (No members)


Follow on   Twitter   Google+

Comments and Discussions

 
QuestionMultimedia SDK??? Pinmemberxirisjohn27-Feb-13 11:41 
AnswerRe: Multimedia SDK??? PingroupLEADTOOLS Support7-Mar-13 4:32 
Hello,
Our Multimedia SDK v18 is released. You can download and try the free evaluation edition from our website.
 
We support creating MP4 files with H.264 or MPEG-4 video compression with AAC audio compression. We also support creating OGG files with Theora and Vorbis compressions. We do not support WebM. These static files can be streamed from the server to the client through the web server.
 
If you are looking for something different though, feel free to email us directly at
support@leadtools.com, and include full details regarding your application requirements.
LEADTOOLS Support
LEAD Technologies Inc.
LEADTOOLS Imaging SDK Home Page

QuestionLines Pinmembercocis4814-Feb-13 8:27 
QuestionDocument scanner Pinmembercocis487-Feb-13 10:32 
AnswerRe: Document scanner PingroupLEADTOOLS Support11-Feb-13 4:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141220.1 | Last Updated 1 Feb 2013
Article Copyright 2013 by LEADTOOLS Support
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid