Bands class

Manages a collection of text bands identified in an image, providing methods for processing, merging, sorting, and extracting text from these bands.

This class handles the organization of text artifacts into horizontal bands, with capabilities to merge, remove empty bands, sort, and extract text content. It supports operations like identifying artifacts, adjusting their locations, and preparing text bands for further analysis.

Constructors

Bands([List<Band> bands = const <Band>[]])
Initializes a new empty Bands collection.

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Gets the number of bands in the collection.
no setter
list List<Band>
List of text bands identified in the image.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalArtifacts int
Gets the number of characters across all bands in the collection.
no setter

Methods

add(Band band) → void
Adds a new band to the collection.
areBandAlmostOnTheSameHorizontalRow(Band a, Band b) bool
Determines if two bands are approximately on the same horizontal row.
clear() → void
Clears all bands from the collection.
getBandsOnTheSameRelativeRow() List<List<Band>>
Return groups of band that are relatively on the same aligned row
getText() String
Returns the concatenated text content of all bands in the collection.
mergeBandsHorizontally() → void
Groups artifacts into horizontal bands based on their vertical positions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEmptyBands() → void
Removes bands that have no artifacts from the collection.
shouldMergeBands(Band bandWest, Band bandEast) bool
Determines whether two bands should be merged based on their horizontal proximity.
sortTopLeftToBottomRight() → void
Sorts bands from top to bottom and left to right based on their original positions.
toString() String
A string representation of this object.
inherited
tryMergeBands(List<Band> bandOnPossibleRow) bool
Attempts to merge adjacent bands that are close enough horizontally.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getBandsOfArtifacts(Artifact matrixSourceImage, List<IntRect> regions, bool innerSplit) Bands
Processes and transforms a collection of artifacts from source image regions into organized bands.
sortVerticallyThenHorizontally(List<Band> list, {double threshold = 5.0}) → void
Sorts a list of bands vertically then horizontally with a threshold for vertical alignment.