The API returns the extracted text, along with information about the location of the detected text in the original image. The API does not provide a precise layout of the text on the page. The text is primarily useful for adding to a text index for search and retrieval of the original document.

Optimize OCR Results

In general, OCR results are better for high quality images, and where the text is at high contrast (sharp, dark font on a white background).

When you take a picture of text or a document with a handheld camera, the OCR results are better in diffuse lighting. Natural light is diffuse, so photos taken in natural light are generally better for OCR. When this is not possible, try to ensure that the camera is not between the light source and the text, because this positioning can cause glare or cast shadows on the text. For example, if you want to photograph a business card under an overhead light, hold the camera and card perpendicular to the floor, so that the light is above both, rather than laying the card on a table.

Additionally, if you need to use a flash, ensure that the camera is far enough away that the text does not get washed out or saturated.

The image resolution can have an impact on the OCR results. Higher resolution images have more detail, and OCR might interpret background distortions as possible text. In this case, a high resolution picture with a lot of tiny details might give poorer results. However, when the image resolution is too low, the font becomes less sharp and the image becomes pixelated. The quality of your camera affects the ideal size and you might need to test to find the best results settings.

In all cases, use the appropriate mode for your data. For example, if you take a picture of a document or business card, use document_photo, and if you want to identify the text in a picture of road signs, use scene_photo.

The document_scan mode is best for document scans obtained with a good quality scanner, and for computer-generated images. If the page is not flat when scanned, you might get better results by using the document_photo mode.

Haven OnDemand uses cookies to enhance and improve the experience it provides. By continuing to use this site or pressing Continue,
we will assume that you accept receiving all cookies. If you would like to change which cookies are set, you can change your settings.