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
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:
- AnalyzeRegion, SynthesizeBusinessCard, SynthesizeBusinessCardEx methods of the FRPage object
- RemoveColorObjects, RemoveMotionBlur, RemoveGarbage, SmoothImage, SaveImageRegionTo methods of the ImageDocument object
- AddNew method of the CheckmarkGroup object
- AddNew method of the SeparatorGroup object
- Add, InsertAt methods of the RegionsCollection object
- SetImageData method of the TrainingImage object
- AddClipRegion, AddInvertRegion, AddPaintRegion, AddRemoveGarbageRegion, AddReplaceBlackPixelsRegion, AddReplaceWhitePixelsRegion methods of the ImageModification object
Samples
This object is used in the BCR code sample.
See also
7/3/2024 8:50:25 AM