isConsideredLine method
Determines if the current Artifact is considered a line based on its aspect ratio.
This method calculates the aspect ratio of the Artifact's content and checks if it falls within a specific range to determine if it should be considered a line.
Returns:
- true if the aspect ratio is less than
_lineAspectRatioMinor greater than_lineAspectRatioMax, indicating that the Artifact is likely representing a line. - false otherwise, suggesting the Artifact is not representing a line.
The aspect ratio is calculated by the aspectRatioOfContent() method as height divided by width. Therefore:
- A very small aspect ratio indicates a tall, narrow Artifact.
- A very large aspect ratio indicates a wide, short Artifact. Both of these cases are considered to be line-like in this context.
This method is useful in image processing or OCR tasks where distinguishing between line-like structures and other shapes is important.
Implementation
bool isConsideredLine() {
final double ar = aspectRatioOfContent();
return ar < _lineAspectRatioMin || ar > _lineAspectRatioMax;
}