AreaOfInterest class

Sets the width and height of the recognition area via its aspect ratio. The document will be expected inside the recognition area.

The AreaOfInterest class methods provide two ways to define an area of interest:

  • via one universal aspect ratio value — an area of interest will be represented by a rectangle with defined aspect ratio in a portrait orientation. In case the end-user changes a camera orientation during capture, the area of interest, set by this method, will be inverted. I.e., if an aspect ratio is set to 2, an area of interest rectangle will have an aspect ratio 2 in a portrait orientation and an aspect ratio 0.5 in a landscape orientation.
  • explicitly defining aspect ratio value for each camera orientation — an area of interest will be defined for each orientation. Setting separate values for different orientation types allow you to invert or save unchanged the area of interest if the end-user changes the camera orientation. I.e., if both aspect ratio values are set to 2, the area of interest rectangle will stay unchanged on the camera orientation change. If an aspect ratio for portrait orientation is set to 2 and an aspect ratio for landscape orientation is set to 0.5, the area of interest rectangle will be inverted, as if it was set via one universal aspect ratio value.

 Note: Aspect ratio value, used for setting the area of interest, is calculated by division of the document width to its height in a portrait orientation. That means, a document width is always at a short side of the device screen and a document height is always at a long side of the device screen.

The area of interest can be set as one of predefined constants or defined manually by the methods of this class.

class AreaOfInterest

Methods

Name Description
withAspectRatio Sets a single aspect ratio value for the area of interest.
withAspectRatioForOrientations Sets two aspect ratio values of the area of interest for different camera orientation.

Constants

Name Description
FILL The document should fit the whole frame, excluding buttons and margin.
ONE_LINE An area of interest is calculated as 4:1. This constant should be used for one-line document.

02.03.2022 12:59:15

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.