Skip to main content Skip to main content Windows Experience Devices Windows Developer Microsoft Edge Windows Insider Microsoft 365 Microsoft 365 Azure Copilot Windows Surface Xbox Deals Small Business Support Windows Apps Outlook OneDrive Microsoft Teams OneNote Microsoft Edge Moving from Skype to Teams Computers Shop Xbox Accessories VR & mixed reality Certified Refurbished Trade-in for cash Xbox Game Pass Ultimate PC Game Pass Xbox games PC games Microsoft AI Microsoft Security Dynamics 365 Microsoft 365 for business Microsoft Power Platform Windows 365 Small Business Digital Sovereignty Azure Microsoft Developer Microsoft Learn Support for AI marketplace apps Microsoft Tech Community Microsoft Marketplace Marketplace Rewards Visual Studio Microsoft Rewards Free downloads & security Education Gift cards Licensing Unlocked stories View Sitemap
September 18, 2014
Mobile

Microsoft OCR Library for Windows Runtime



This blog was written by Jelena Mojasevic, Program Manager at Microsoft.

We are pleased to announce that Microsoft OCR Library for Windows Runtime has been released as a NuGet package. The library empowers you to easily add text recognition capabilities in your Windows Phone 8/8.1 and Windows 8.1 Store apps.

OCR technology enables various scenarios – copying text from images, text search in images, translation… It was designed with flexibility and performance in mind, as it allows for OCR of high variety of image types and has numerous performance optimizations. The library runs entirely on client, supports 21 languages and enables processing images from various sources – camera, local file or network.

To get started, open your app project in Visual Studio and select PROJECT | Manage NuGet Packages, then search for Microsoft OCR. The documentation is available at MSDN in the same format as for Platform API. The library is free and there will be no fees for runtime licenses of commercial applications developed with the library.

The OCR Library extracts text and layout information from the image. When you add the OCR Library to an application, you control how your application interprets the returned text, for example you can recognize patterns such as email addresses, phone numbers, and URLs, and your app can launch common actions such as sending an email, making a phone call, or visiting a web site.

It’s really simple to run OCR on an image, demonstrated in code snippets below:

C#

 

OcrResult result = await ocrEngine.RecognizeAsync(height, width, pixels);

C# 2

The RecognizeAsync method’s arguments are the image dimensions and byte array of image pixels in BGRA format. The extracted text and layout info are contained within OcrResult:

if (result.Lines != null)

{

string recognizedText = "";

foreach (var line in result.Lines)

{

foreach (var word in line.Words)

{

recognizedText += word.Text + " ";

}

recognizedText += Environment.NewLine;

}

OcrText.Text = recognizedText;

}

For more info about the OCR Library, visit MSDN page and download OCR library sample app. See the NuGet documentation for all the ways you can download and install the NuGet package in your project.

If you’d like to share your feedback with the Microsoft OCR team, please send a mail.

Your Privacy Choices Opt-Out Icon Your Privacy Choices
Consumer Health Privacy Sitemap Contact Microsoft Privacy Manage cookies Terms of use Trademarks Safety & eco Recycling About our ads