Share via


The Bing Optical Character Recognition (OCR) Control

 

This article is obsolete. The Bing Optical Character Recognition (OCR) Control enables a Windows 8.1 device to read text from the outside world. It does this by taking a picture, sending the picture to a web service for analysis, and then returning the text and position data to the device. Your application can then interpret that text however you see fit.

Warning

The Bing OCR Control is deprecated as of March 12, 2014.

Uses of Bing OCR

When you embed the Bing OCR Control in an application, you control how your application interprets the text returned by the OCR Service. By linking to recognized patterns, such as e-mails addresses and URIs, you can link that text to common actions such as sending an e-mail or visiting a web site. You can also combine OCR with other services such as Bing Translator or Bing Maps to translate a restaurant menu or get directions to a show.

Bing OCR Basics

The Bing OCR Control is a XAML control that you can add to any XAML-based Windows Store application. End users must have Windows 8.1 or higher installed to view the control. Its default UI consists of a video viewing area. When the user clicks or taps on the video, the control captures the current image and sends it to the OCR Service for processing. The OCR Service returns a Response object that includes the identified text and its position in the image.

Bing OCR Subscription Requirements

Bing OCR is part of the Windows Azure Marketplace. To gain access to the OCR Service, you must subscribe to the OCR Control at The Windows Azure Data Marketplace, and then register your application. The subscription is free for the first 5,000 service calls per month.

When you are ready to publish your application, you can do so on the Marketplace.

Key API for Bing OCR

API

Description

OcrControl Class

The class that represents the XAML control.

OcrControl.StartPreviewAsync(String) Method

Starts the camera in preview mode. If the camera has been previously stopped, it resets the control and resumes frame capture.

OcrControl.CaptureFrame() Method

Captures a frame from the camera and sends it to the Bing OCR Service for processing. The default OcrControl UI calls this method when a user clicks or taps the preview screen in an application.

OcrControl.ResetAsync() Method

Closes the camera if it is running and resets the control to its starting state. If the control is waiting on a service response when this method is called, the returned response is ignored.

OcrControl.Completed Event

Raised by the CaptureFrameAsync() Method when the OCR Control receives a response from the Bing OCR Service. The service response is stored in the OcrCompletedEventArgs Class object associated with this event.

OcrControl.Failed Event

Raised when an error occurs in the control, such as when no camera is available, user has denied permissions to access the camera, or the control is unable to contact the Bing OCR Service. Any error messages from the control to the hosting application must come through this event.

OcrResult class

Contains the contents of the response returned by the OCR Service.

In this section