Region Object (IRegion Interface)
This is a supplementary object. It is designed to store the information about the region of an ABBYY FlexiCapture SDK block.
A region is represented as a set of rectangles positioned one under another in such a way that the top line of the lower rectangle is the bottom line of the upper one (so that the rectangles do not overlap). Some examples of correct and incorrect ABBYY FlexiCapture SDK regions are shown on the following figure:
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 AddRect method. We recommend that you add rectangles in top to bottom order, because the Region object is optimized for it, and this is the fastest way to add rectangles to it.
Properties
Name | Type | Description |
---|---|---|
Bottom | Integer, read-only | Returns the coordinate of the bottom border of the specified rectangle. |
BoundingRectangle | Rectangle, read-only | Returns the minimum bounding rectangle of the region. |
Count | Integer, read-only | Stores the number of rectangles in the region. |
IsEmpty | Boolean, read-only | Checks if the region is empty. |
Left | Integer, read-only | Returns the coordinate of the left border of the specified rectangle. |
Right | Integer, read-only | Returns the coordinate of the right border of the specified rectangle. |
Top | Integer, read-only | Returns the coordinate of the top border of the specified rectangle. |
Methods
Name | Description |
---|---|
AddRect | Adds an area to the region. |
CopyFrom | Initializes properties of the current object with values of similar properties of another object. |
HasIntersectionWithRect | Checks if the supplied rectangle has intersection with the current region. |
HasIntersectionWithRegion | Checks if the supplied region has intersection with the current region. |
IsEqual | Checks if the regions are equal. |
IsPointInRegion | Checks if the supplied point is inside the current region. |
IsRectInRegion | Checks if the supplied rectangle is inside the current region. |
IsRegionInRegion | Checks if the supplied region is inside the current region. |
LoadFromFile | Restores the object contents from a file on disk. |
LoadFromMemory | Restores the object contents from the global memory. |
MakeEmpty | Removes all rectangles from the region. |
SaveToFile | Saves the object contents into a file on disk. |
SaveToMemory | Saves the object contents into the global memory. |
Output parameter
This object is the output parameter of the following methods and properties:
- CreateRegion method of the Engine object
- Region property of the Block object
- Region property of the BlockDefinition object
- Region property of the RecognizedCharacterInfo object
- MarkingRegion property of the TextRecognitionParams object
- ClipRegion property of the ImageModification object
- Region property of the TextRegion object
Input parameter
This object is the input parameter of the following methods:
- MatchBlock method and Region property of the Block object
- AddNew method of the BlockDefinitions object
- FilterColor, FillRegionWithColor, InvertRegion methods of the ImageProcessingTools object
- ClipRegion property of the ImageModification object
- DetectBlocks method of the PageDefinition object
See also
15.08.2023 13:19:30