AUIAreaOfInterest interface
Sets the width and height of the recognition area via its aspect ratio. The document will be expected inside the recognition area. For the reason that the camera may have two different orientations, an area of interest can vary depending on the orientation.
The AreaOfInterest interface provides 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.
Constants
Name | Description |
---|---|
fill | The document should fit the whole frame, excluding buttons and margin. |
oneLine | An area of interest is calculated as 4:1. This constant should be used for one-line document. |
Methods
Name | Description |
---|---|
+ areaOfInterestWithAspectRatio: | Sets a single aspect ratio value for the area of interest. |
+ areaOfInterestWithPortraitAspectRatio: | Sets two aspect ratio values of the area of interest for different camera orientation. |
- initWithAspectRatio: | Returns a new instance of the AUIAreaOfInterest interface. The area of interest, initialized by this method, will be inverted on the camera orientation change. |
- initWithPortraitAspectRatio: | Initializes a new instance of the AUIAreaOfInterest interface. The area of interest, initialized by this method, will be inverted on the camera orientation change. |
3/2/2022 12:59:15 PM