Back to Aurora Vision Deep Learning website
You are here: Start » Computer Vision » Deep Learning » DL_ReadCharacters_Multiple
DL_ReadCharacters_Multiple
| Header: | AVLDL.h |
|---|---|
| Namespace: | avl |
| Module: | DL_OCR |
Performs optical character recognition using a pretrained deep learning model on multiple regions of interest.
Syntax
C++
C#
void avl::DL_ReadCharacters_Multiple ( const avl::Image& inImage, const atl::Array<avl::Rectangle2D>& inMultiRoi, atl::Optional<const avl::CoordinateSystem2D&> inRoiAlignment, const avl::ReadCharactersModelId& inModelId, const atl::Array<int>& inCharHeights, const float inWidthScale, const float inCharSpacing, atl::Optional<const atl::String&> inCharRange, const float inMinScore, const float inMinQuality, avl::Polarity::Type inPolarization, const float inContrastThreshold, const bool inCalculateCandidates, const bool inRemoveBoundaryCharacters, atl::Optional<int> inCanvasWidth, atl::Optional<int> inCanvasHeight, atl::Array <atl::Array<avl::OcrResult>> & outCharacters, atl::Array <atl::Array<atl::Array<avl::OcrCandidate>>> & outCandidates, atl::Array <atl::Array<avl::Region>> & outMasks, atl::Array<avl::Rectangle2D>& outAlignedRois, atl::Array<avl::Image>& diagCanvas )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | const Image& | Input image | ||
![]() |
inMultiRoi | const Array<Rectangle2D>& | Limits the areas where recognized characters are located | ||
![]() |
inRoiAlignment | Optional<const CoordinateSystem2D&> | NIL | ||
![]() |
inModelId | const ReadCharactersModelId& | () | Identifier of a Read Characters model | |
![]() |
inCharHeights | const Array<int>& | {35} | Average height of characters in pixels for each ROI | |
![]() |
inWidthScale | const float | 0.1 - 10.0 | 1.0f | Scales image width by the given factor |
![]() |
inCharSpacing | const float | -0.5 - ![]() |
0.0f | Distance between characters denoted as fraction of inCharHeight |
![]() |
inCharRange | Optional<const String&> | \"A-Z,a-z,0-9,\\\\\\\\,/,-\" | Limits the set of wanted characters | |
![]() |
inMinScore | const float | 0.0 - 1.0 | 0.5f | Sets a minimum required score for a character to be returned |
![]() |
inMinQuality | const float | 0.0 - 1.0 | 0.0f | Specifies the minimum quality threshold a character must meet to be returned. |
![]() |
inPolarization | Polarity::Type | Any | Sets a required polarity for a character to be returned | |
![]() |
inContrastThreshold | const float | -1.0 - 1.0 | 0.0f | Sets a threshold for a contrast of found characters |
![]() |
inCalculateCandidates | const bool | True | If set to true then outCandidates is calculated | |
![]() |
inRemoveBoundaryCharacters | const bool | False | If set to true characters that are not entirely contained in the ROI are filtered out | |
![]() |
inCanvasWidth | Optional<int> | 64 - ![]() |
8192 | Maximum width of internal canvas buffer. If not set, dynamic size mode is used, used only on CUDA execution. |
![]() |
inCanvasHeight | Optional<int> | 64 - 512 | 64 | Maximum height of internal canvas buffer. If not set, dynamic size mode is used, used only on CUDA execution. |
![]() |
outCharacters | Array <Array<OcrResult>> & | |||
![]() |
outCandidates | Array <Array<Array<OcrCandidate>>> & | Array of the most likely characters. The first element is the character from outCharacters | ||
![]() |
outMasks | Array <Array<Region>> & | Masks of found characters (in Extended model). Contains empty regions in case of using model not supporting masks (in Fast and Balanced model). | ||
![]() |
outAlignedRois | Array<Rectangle2D>& | Input rois after transformation | ||
![]() |
diagCanvas | Array<Image>& | Internal canvas images used for OCR |
Requirements
For input inImage only pixel formats are supported: 1⨯uint8, 3⨯uint8.
Read more about pixel formats in Image documentation.
Errors
List of possible exceptions:
| Error type | Description |
|---|---|
| DomainError | Empty image in DL_ReadCharacters_Multiple. |
| DomainError | inCharRange cannot be empty string. |
| DomainError | inModelDirectory cannot be empty string. |
| DomainError | Nonpositive dimensions of ROI in DL_ReadCharacters_Multiple |
| DomainError | The number of items in inCharHeights must be equal to the number of items in inRois in DL_ReadCharacters_Multiple. |
| DomainError | Too small ROI in DL_ReadCharacters_Multiple |
| DomainError | Values of inCharHeights in DL_ReadCharacters_Multiple must be at least equal to 8. |
| DomainError | Zero scale in ROI alignment in DL_ReadCharacters_Multiple |
| DomainError | Not supported inImage pixel format in DL_ReadCharacters_Multiple. Supported formats: 1xUInt8, 3xUInt8. |




