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:
OcrResult result = await ocrEngine.RecognizeAsync(height, width, pixels);
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.