Chinese Simplified (简体中文)

Region Object (IRegion Interface)

This is a supplementary object. It is designed to store the information about the region of an ABBYY FineReader Engine block.

A region is represented as a set of rectangles:

  • positioned without intersections or overlaps
  • added in left-to-right or top-to-bottom order

Some examples of ABBYY FineReader Engine regions are shown below:

An empty Region object can be created by calling the IEngine::CreateRegion method, and then rectangles can be added to it one-by-one by calling the IRegion::AddRect method. We recommend that you add rectangles in top to bottom (or left to right) order, because the Region object is optimized for it, and this is the fastest way to add rectangles to it.

The Region object is a persistent object. This means that the object's current state can be written to persistent storage on disk. Later, the object can be re-created by reading the object's state from persistent storage. The following methods provide persistence of the object: SaveToFile, and LoadFromFile.

Properties

Name Type Description
Application Engine, read-only Returns the Engine object.
Bottom int, read-only Returns the coordinate of the bottom border of the specified rectangle.
BoundingRectangle FRRectangle, read-only Returns the minimum rectangle which contains the whole region.
Count int, read-only Stores the number of rectangles in the region.
IsEmpty VARIANT_BOOL, read-only Specifies whether the region is empty.
Left int, read-only Returns the coordinate of the left border of the specified rectangle.
Right int, read-only Returns the coordinate of the right border of the specified rectangle.
Top int, read-only Returns the coordinate of the top border of the specified rectangle.

Methods

Name Description
AddRect Adds an area to the region.
AddRegion Adds a new area to an existing region.
CopyFrom Initializes properties of the current object with values of similar properties of another object.
CutRect Cuts a rectangular area from a region.
HasIntersectionWithRect Calculates if the region intersects with the specified rectangle.
HasIntersectionWithRegion Calculates if the region intersects with the specified region.
IsEqual Calculates if the region is equal to the specified region.
IsPointInRegion Calculates if the specified point is inside the region.
IsRectInRegion Calculates if the specified rectangle is contained within the region.
IsRegionInRegion Calculates if the specified region is contained within the region.
LoadFromFile Restores the object's contents from a file on disk.
MakeEmpty Removes all the rectangles from the region.
SaveToFile Saves the object's contents into a file on disk.

Related objects

Object Diagram

Output parameter

This object is the output parameter of CreateRegion method of the Engine object.

Input parameter

This object is passed as an input parameter to the following methods:

Samples

This object is used in the Business Card Recognition code sample.

See also

Working with Properties

03.07.2024 8:50:10

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.