Back to FabImage Library website
You are here: Start » Function Reference » Computer Vision » Optical Character Recognition » ExtractText2

ExtractText2
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | OCR |
Ready-to-use tool for extracting and splitting text elements to single characters.
Syntax
C++
C#
void fil::ExtractText2 ( const fil::Image& inImage, const fil::Rectangle2D& inRoi, const fil::CoordinateSystem2D& inRoiAlignment, const fil::Polarity::Type inPolarity, const int inCharWidth, ftl::Optional<int> inStrokeWidth, ftl::Optional<int> inMinWordGap, ftl::Array<fil::Region>& outCharacters, ftl::Array<fil::Region>& diagAlignedCharacters )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inImage | const Image& | An input image with text | ||
![]() |
inRoi | const Rectangle2D& | Location of the text | ||
![]() |
inRoiAlignment | const CoordinateSystem2D& | Adjusts the region of interest to the position of the inspected object | ||
![]() |
inPolarity | const Polarity::Type | Text polarity | ||
![]() |
inCharWidth | const int | 5 - 200 | 50 | Width of a single character in pixels |
![]() |
inStrokeWidth | Optional<int> | 1 - 50 | NIL | Width of the stroke of the letters in pixels |
![]() |
inMinWordGap | Optional<int> | 1 - 200 | NIL | Width of the smallest gap between letters that is to be treated as a space in pixels |
![]() |
outCharacters | Array<Region>& | Regions representing individual characters aligned to the ROI | ||
![]() |
diagAlignedCharacters | Array<Region>& | Regions representing individual characters aligned to the Image |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | inPolarity must be specified as Dark or Bright in ExtractText2. |
DomainError | inRoi is to narrow to fit a single character in ExtractText2. |
DomainError | It is impossible for inStrokeWidth to be greater than inCharWidth in ExtractText2. |