EOCR2 Class

Manages a complete context for the font-dependent printed character reader implemented in EasyOCR2.

Namespace: Euresys::Open_eVision

Methods

Reads reference characters from disk and adds them to the database used for text recognition. The characters can be read from a trueType (.ttf/.ttc) file or from an EasyOCR2 database file.
Adds the EOCR2Classifier for the given specific symbol combination during the recognition instead of the one set by EOCR2.
Clears the reference character database from this EOCR2 instance.
Clear the current detected text if it exists.
Finds the text in an image as follows:
(1) Detects potential characters in the image following the given text polarity.
(2) Fits bounding boxes to the detected characters, following the given topology and character width/height.
(3) Extracts the detected characters from the image.
The detected characters are output as an EOCR2Text structure.
Draws the bounding boxes found by the topology detection algorithm.
Draws the bounding boxes found by the topology detection algorithm with the current pen.
Draws the recognized text next to the character bounding box in the image.
Draws the recognized text next to the character bounding box in the image with the current pen.
Draws the blobs found by the segmentation algorithm.
Draws the blobs found by the segmentation algorithm with the current pen.
Constructs an EOCR2 context.
Sets which character types are expected when EOCR2::EnabledTopology is false. The set of expected character types is represented by a bitwise combination of different EasyOCR2CharacterFilter.
Sets the EOCR2CharacterDatabase used for recognizing text.
Sets the expected character height in pixels.
Sets the CharsMaxFragmentation parameter for the segmentation algorithm. This will determine the minimum size a blob should be in order to be considered a potential character. A high setting will allow only larger blobs, a low setting will also allow smaller blobs.
The minimum blob size to be considered a potential character is defined as:
CharsMaxFragmentation * CharsHeight * CharsWidth
Sets the CharSpacingBias parameter for the topology fitting algorithm, which optimizes the spacing of the bounding boxes to optimally fit the detected blobs. This will determine whether the method is biased toward finding narrow spacing, wide spacing or is neutral.
Sets the CharsWidthBias parameter for the topology fitting algorithm, which optimizes the width of the bounding boxes to optimally fit the detected blobs. This will determine whether the method is biased toward finding narrow boxes, wide boxes or is neutral.
Sets the range of expected character widths in pixels.
Sets the EOCR2Classifier parameter for the recognition algorithm. This will determine which classifier will be used for the recognition.
Gets the EOCR2Classifier for the given specific symbol combination during the recognition instead of the one set by EOCR2.
Sets the DetectionDelta parameter for the segmentation algorithm. This will determine the range of grayscale-values used to determine the stability of a blob. A low setting will make the algorithm more sensitive to noise, a high setting will make the algorithm insensitive to blobs with low contrast to the background.
Sets the EOCR2DetectionMethod parameter for the topology fitting algorithm, which will place textboxes on the segmentation results, matching the given topology.
Sets whether EOCR2 detection should split or not segmented blobs into multiple characters if they are wider than the given character width range parameter. The default setting for this parameter is false and it is only applicable when the topology is not required or when the detectionMethod is set to EOCR2DetectionMethod_Proportional.
Sets whether the topology is required or not. If it is, EOCR2 will try to detect the topology accordingly with the EOCR2DetectionMethod parameter. The default setting for this parameter is true and topology has to be given with EOCR2.
Sets/Gets whether EOCR2 uses a GPU to accelerate its processing.
Sets whether EOCR2 allows or not the detection of characters whose size (width and height) is out of the size parameters if they are in the vicinity of characters in valid size range. The default setting for this parameter is true and it is only applicable when the topology is not required.
Sets whether EOCR2 segmentation should do or not do an extra pass to determine the best threshold using the EOCR2SegmentationMethod_Global segmentation method. The default setting for this parameter is false and it is only applicable when the segmentation method is set to EOCR2SegmentationMethod_Global.
Sets/Gets the fraction of the image pixels that will be set below the threshold used when the segmentation method is set to EOCR2SegmentationMethod_Global. It is only used when the GlobalSegmentationThresholdMode value is EThresholdMode_Relative .
Sets/Gets the EThresholdMode used when the segmentation method is set to EOCR2SegmentationMethod_Global. From the EThresholdMode, a threshold will be computed during the segmentation. While using EasyOCR2TextPolarity_WhiteOnBlack, pixels above or equal to the threshold will be segmented. While using EasyOCR2TextPolarity_BlackOnWhite, pixels under the threshold will be segmented.
Sets/gets the GPUs to use when computing.
Sets the maxVariation parameter for the segmentation algorithm. This parameter determines how stable a blob in the image should be in order to be considered a potential character, a region with clearly defined edges is generally considered stable while a blurry region is not. A high setting allows more unstable blobs, a low setting allows only very stable blobs.
Sets the NumDetectionPasses parameter for the topology fitting algorithm, which will place textboxes on the segmentation results (blobs), matching the given topology. The first pass will consider all blobs, subsequent passes will only consider those blobs that are inside the textboxes from the previous pass, sometimes resulting in a more optimal fit.
Outputs an EOCR2Text structure containing the detailed detection and recognition results.
Sets the range of expected spaces between words as a fraction of the character width.
Sets whether EOCR2 groups or does not group the blobs believed to belong to the same character. The default setting for this parameter is true and it is only applicable when the topology is not required.
Sets the EOCR2SegmentationMethod parameter for the segmentation algorithm, which will detect blobs in the image.
Sets the TextAngleRange parameter for the topology fitting algorithm, which will attempt to find the angle of the text in the image with respect to the horizontal. This will determine the center of the range of angles that will be tested, defined as:
TextAngleRange.min() <= angle <= TextAngleRange.max()
Sets the TextPolarity parameter for the segmentation algorithm. This will determine whether the algorithm searches for light blobs in a dark background or for dark blobs in a light background.
Time-out for the EOCR2::Read, EOCR2::Detect and EOCR2::Recognize methods.
Sets the topology of the text that should be found in the image. A modified version of Regex expressions are used, where:
.(dot) represents any character (not including a space).
L represents a letter.
Lu represents an uppercase letter.
Ll represents a lowercase letter.
N represents a digit.
P represents a punctuation character !"#&'()*,-./:;<>?[\]_{|}~
S represents the symbols $+-<=>|~
\n represents a line break.
' ' (space) represents a space between two words.
Combinations can be made, for example: [LN] represents an alpha-numeric character.
To specify multiple characters, simply add {n} at the end for n characters. If the amount of characters is uncertain, specify {n,m} for a minimum of n characters and a maximum of m characters.
The topology "[LuN]{3,5}PN{4} \n .{5} LL" represents a text comprised of 2 lines:
The first line has 1 word composed of 3 to 5 uppercase alpha-numeric characters, followed by a punctuation character and 4 numbers.
The second line has 2 words. The first word comprises of 5 wildcard characters, the second word has 2 alphabetic characters (upper- or lowercase).
Tests the cursor position for the presence of a character. If one is present under the cursor, it returns true and fills the EOCR2Char object passed as parameter.
Tests the cursor position for the presence of a line. If one is present under the cursor, it returns true and fills the EOCR2Line object passed as parameter.
Tests the cursor position for the presence of a text. If one is present under the cursor, it returns true and fills the EOCR2Text object passed as parameter.
Tests the cursor position for the presence of a word. If one is present under the cursor, it returns true and fills the EOCR2Word object passed as parameter.
Learns reference characters from a given EOCR2Text/EOCR2Line/EOCR2Word/EOCR2Char instance, containing user-specified character codes.
Loads a model, containing parameter settings used for all operations in EOCR2, from disk.
Assignment operator, copies another EOCR2 instance to this one.
Performs all steps required for reading text from an image:
(1) Detects potential characters in the image following the given text polarity and character width/height.
(2) Fits bounding boxes to the detected characters, following the given topology and character width/height.
(3) Recognizes the detected characters using the given reference character database.
The read text is output as a string.
Recognizes the characters in a given EOCR2Text instance, based on a given reference font.
Removes the EOCR2Classifier for the given specific symbol combination during the recognition so the one set by EOCR2 will be used.
Saves the model to disk, containing the current parameter setting used for all operations in EOCR2.
Saves the current reference character database to disk.
Sets which character types are expected when EOCR2::EnabledTopology is false. The set of expected character types is represented by a bitwise combination of different EasyOCR2CharacterFilter.
Sets the EOCR2CharacterDatabase used for recognizing text.
Sets the expected character height in pixels.
Sets the CharsMaxFragmentation parameter for the segmentation algorithm. This will determine the minimum size a blob should be in order to be considered a potential character. A high setting will allow only larger blobs, a low setting will also allow smaller blobs.
The minimum blob size to be considered a potential character is defined as:
CharsMaxFragmentation * CharsHeight * CharsWidth
Sets the CharSpacingBias parameter for the topology fitting algorithm, which optimizes the spacing of the bounding boxes to optimally fit the detected blobs. This will determine whether the method is biased toward finding narrow spacing, wide spacing or is neutral.
Sets the CharsWidthBias parameter for the topology fitting algorithm, which optimizes the width of the bounding boxes to optimally fit the detected blobs. This will determine whether the method is biased toward finding narrow boxes, wide boxes or is neutral.
Sets the range of expected character widths in pixels.
Sets the EOCR2Classifier parameter for the recognition algorithm. This will determine which classifier will be used for the recognition.
Sets the DetectionDelta parameter for the segmentation algorithm. This will determine the range of grayscale-values used to determine the stability of a blob. A low setting will make the algorithm more sensitive to noise, a high setting will make the algorithm insensitive to blobs with low contrast to the background.
Sets the EOCR2DetectionMethod parameter for the topology fitting algorithm, which will place textboxes on the segmentation results, matching the given topology.
Sets whether EOCR2 detection should split or not segmented blobs into multiple characters if they are wider than the given character width range parameter. The default setting for this parameter is false and it is only applicable when the topology is not required or when the detectionMethod is set to EOCR2DetectionMethod_Proportional.
Sets whether the topology is required or not. If it is, EOCR2 will try to detect the topology accordingly with the EOCR2DetectionMethod parameter. The default setting for this parameter is true and topology has to be given with EOCR2.
Sets/Gets whether EOCR2 uses a GPU to accelerate its processing.
Sets whether EOCR2 allows or not the detection of characters whose size (width and height) is out of the size parameters if they are in the vicinity of characters in valid size range. The default setting for this parameter is true and it is only applicable when the topology is not required.
Sets whether EOCR2 segmentation should do or not do an extra pass to determine the best threshold using the EOCR2SegmentationMethod_Global segmentation method. The default setting for this parameter is false and it is only applicable when the segmentation method is set to EOCR2SegmentationMethod_Global.
Sets/Gets the fraction of the image pixels that will be set below the threshold used when the segmentation method is set to EOCR2SegmentationMethod_Global. It is only used when the GlobalSegmentationThresholdMode value is EThresholdMode_Relative .
Sets/Gets the EThresholdMode used when the segmentation method is set to EOCR2SegmentationMethod_Global. From the EThresholdMode, a threshold will be computed during the segmentation. While using EasyOCR2TextPolarity_WhiteOnBlack, pixels above or equal to the threshold will be segmented. While using EasyOCR2TextPolarity_BlackOnWhite, pixels under the threshold will be segmented.
Sets/gets the GPUs to use when computing.
Sets the maxVariation parameter for the segmentation algorithm. This parameter determines how stable a blob in the image should be in order to be considered a potential character, a region with clearly defined edges is generally considered stable while a blurry region is not. A high setting allows more unstable blobs, a low setting allows only very stable blobs.
Sets the NumDetectionPasses parameter for the topology fitting algorithm, which will place textboxes on the segmentation results (blobs), matching the given topology. The first pass will consider all blobs, subsequent passes will only consider those blobs that are inside the textboxes from the previous pass, sometimes resulting in a more optimal fit.
Sets the range of expected spaces between words as a fraction of the character width.
Sets whether EOCR2 groups or does not group the blobs believed to belong to the same character. The default setting for this parameter is true and it is only applicable when the topology is not required.
Sets the EOCR2SegmentationMethod parameter for the segmentation algorithm, which will detect blobs in the image.
Sets the TextAngleRange parameter for the topology fitting algorithm, which will attempt to find the angle of the text in the image with respect to the horizontal. This will determine the center of the range of angles that will be tested, defined as:
TextAngleRange.min() <= angle <= TextAngleRange.max()
Sets the TextPolarity parameter for the segmentation algorithm. This will determine whether the algorithm searches for light blobs in a dark background or for dark blobs in a light background.
Time-out for the EOCR2::Read, EOCR2::Detect and EOCR2::Recognize methods.
Sets the topology of the text that should be found in the image. A modified version of Regex expressions are used, where:
.(dot) represents any character (not including a space).
L represents a letter.
Lu represents an uppercase letter.
Ll represents a lowercase letter.
N represents a digit.
P represents a punctuation character !"#&'()*,-./:;<>?[\]_{|}~
S represents the symbols $+-<=>|~
\n represents a line break.
' ' (space) represents a space between two words.
Combinations can be made, for example: [LN] represents an alpha-numeric character.
To specify multiple characters, simply add {n} at the end for n characters. If the amount of characters is uncertain, specify {n,m} for a minimum of n characters and a maximum of m characters.
The topology "[LuN]{3,5}PN{4} \n .{5} LL" represents a text comprised of 2 lines:
The first line has 1 word composed of 3 to 5 uppercase alpha-numeric characters, followed by a punctuation character and 4 numbers.
The second line has 2 words. The first word comprises of 5 wildcard characters, the second word has 2 alphabetic characters (upper- or lowercase).

EOCR2 Class

Manages a complete context for the font-dependent printed character reader implemented in EasyOCR2.

Namespace: Euresys.Open_eVision

Properties

Sets which character types are expected when EOCR2::EnabledTopology is false. The set of expected character types is represented by a bitwise combination of different EasyOCR2CharacterFilter.
Sets the EOCR2CharacterDatabase used for recognizing text.
Sets the expected character height in pixels.
Sets the CharsMaxFragmentation parameter for the segmentation algorithm. This will determine the minimum size a blob should be in order to be considered a potential character. A high setting will allow only larger blobs, a low setting will also allow smaller blobs.
The minimum blob size to be considered a potential character is defined as:
CharsMaxFragmentation * CharsHeight * CharsWidth
Sets the CharSpacingBias parameter for the topology fitting algorithm, which optimizes the spacing of the bounding boxes to optimally fit the detected blobs. This will determine whether the method is biased toward finding narrow spacing, wide spacing or is neutral.
Sets the CharsWidthBias parameter for the topology fitting algorithm, which optimizes the width of the bounding boxes to optimally fit the detected blobs. This will determine whether the method is biased toward finding narrow boxes, wide boxes or is neutral.
Sets the range of expected character widths in pixels.
Sets the EOCR2Classifier parameter for the recognition algorithm. This will determine which classifier will be used for the recognition.
Sets the DetectionDelta parameter for the segmentation algorithm. This will determine the range of grayscale-values used to determine the stability of a blob. A low setting will make the algorithm more sensitive to noise, a high setting will make the algorithm insensitive to blobs with low contrast to the background.
Sets the EOCR2DetectionMethod parameter for the topology fitting algorithm, which will place textboxes on the segmentation results, matching the given topology.
Sets whether EOCR2 detection should split or not segmented blobs into multiple characters if they are wider than the given character width range parameter. The default setting for this parameter is false and it is only applicable when the topology is not required or when the detectionMethod is set to Proportional.
Sets whether the topology is required or not. If it is, EOCR2 will try to detect the topology accordingly with the EOCR2DetectionMethod parameter. The default setting for this parameter is true and topology has to be given with EOCR2.
Sets/Gets whether EOCR2 uses a GPU to accelerate its processing.
Sets whether EOCR2 allows or not the detection of characters whose size (width and height) is out of the size parameters if they are in the vicinity of characters in valid size range. The default setting for this parameter is true and it is only applicable when the topology is not required.
Sets whether EOCR2 segmentation should do or not do an extra pass to determine the best threshold using the Global segmentation method. The default setting for this parameter is false and it is only applicable when the segmentation method is set to Global.
Sets/Gets the fraction of the image pixels that will be set below the threshold used when the segmentation method is set to Global. It is only used when the GlobalSegmentationThresholdMode value is Relative .
Sets/Gets the EThresholdMode used when the segmentation method is set to Global. From the EThresholdMode, a threshold will be computed during the segmentation. While using WhiteOnBlack, pixels above or equal to the threshold will be segmented. While using BlackOnWhite, pixels under the threshold will be segmented.
Sets/gets the GPUs to use when computing.
Sets the maxVariation parameter for the segmentation algorithm. This parameter determines how stable a blob in the image should be in order to be considered a potential character, a region with clearly defined edges is generally considered stable while a blurry region is not. A high setting allows more unstable blobs, a low setting allows only very stable blobs.
Sets the NumDetectionPasses parameter for the topology fitting algorithm, which will place textboxes on the segmentation results (blobs), matching the given topology. The first pass will consider all blobs, subsequent passes will only consider those blobs that are inside the textboxes from the previous pass, sometimes resulting in a more optimal fit.
Outputs an EOCR2Text structure containing the detailed detection and recognition results.
Sets the range of expected spaces between words as a fraction of the character width.
Sets whether EOCR2 groups or does not group the blobs believed to belong to the same character. The default setting for this parameter is true and it is only applicable when the topology is not required.
Sets the EOCR2SegmentationMethod parameter for the segmentation algorithm, which will detect blobs in the image.
Sets the TextAngleRange parameter for the topology fitting algorithm, which will attempt to find the angle of the text in the image with respect to the horizontal. This will determine the center of the range of angles that will be tested, defined as:
TextAngleRange.min() <= angle <= TextAngleRange.max()
Sets the TextPolarity parameter for the segmentation algorithm. This will determine whether the algorithm searches for light blobs in a dark background or for dark blobs in a light background.
Time-out for the EOCR2::Read, EOCR2::Detect and EOCR2::Recognize methods.
Sets the topology of the text that should be found in the image. A modified version of Regex expressions are used, where:
.(dot) represents any character (not including a space).
L represents a letter.
Lu represents an uppercase letter.
Ll represents a lowercase letter.
N represents a digit.
P represents a punctuation character !"#&'()*,-./:;<>?[\]_{|}~
S represents the symbols $+-<=>|~
\n represents a line break.
' ' (space) represents a space between two words.
Combinations can be made, for example: [LN] represents an alpha-numeric character.
To specify multiple characters, simply add {n} at the end for n characters. If the amount of characters is uncertain, specify {n,m} for a minimum of n characters and a maximum of m characters.
The topology "[LuN]{3,5}PN{4} \n .{5} LL" represents a text comprised of 2 lines:
The first line has 1 word composed of 3 to 5 uppercase alpha-numeric characters, followed by a punctuation character and 4 numbers.
The second line has 2 words. The first word comprises of 5 wildcard characters, the second word has 2 alphabetic characters (upper- or lowercase).

Methods

Reads reference characters from disk and adds them to the database used for text recognition. The characters can be read from a trueType (.ttf/.ttc) file or from an EasyOCR2 database file.
Adds the EOCR2Classifier for the given specific symbol combination during the recognition instead of the one set by EOCR2.
Clears the reference character database from this EOCR2 instance.
Clear the current detected text if it exists.
Finds the text in an image as follows:
(1) Detects potential characters in the image following the given text polarity.
(2) Fits bounding boxes to the detected characters, following the given topology and character width/height.
(3) Extracts the detected characters from the image.
The detected characters are output as an EOCR2Text structure.
Draws the bounding boxes found by the topology detection algorithm.
Draws the bounding boxes found by the topology detection algorithm with the current pen.
Draws the recognized text next to the character bounding box in the image.
Draws the recognized text next to the character bounding box in the image with the current pen.
Draws the blobs found by the segmentation algorithm.
Draws the blobs found by the segmentation algorithm with the current pen.
Constructs an EOCR2 context.
Gets the EOCR2Classifier for the given specific symbol combination during the recognition instead of the one set by EOCR2.
Tests the cursor position for the presence of a character. If one is present under the cursor, it returns true and fills the EOCR2Char object passed as parameter.
Tests the cursor position for the presence of a line. If one is present under the cursor, it returns true and fills the EOCR2Line object passed as parameter.
Tests the cursor position for the presence of a text. If one is present under the cursor, it returns true and fills the EOCR2Text object passed as parameter.
Tests the cursor position for the presence of a word. If one is present under the cursor, it returns true and fills the EOCR2Word object passed as parameter.
Learns reference characters from a given EOCR2Text/EOCR2Line/EOCR2Word/EOCR2Char instance, containing user-specified character codes.
Loads a model, containing parameter settings used for all operations in EOCR2, from disk.
Assignment operator, copies another EOCR2 instance to this one.
Performs all steps required for reading text from an image:
(1) Detects potential characters in the image following the given text polarity and character width/height.
(2) Fits bounding boxes to the detected characters, following the given topology and character width/height.
(3) Recognizes the detected characters using the given reference character database.
The read text is output as a string.
Recognizes the characters in a given EOCR2Text instance, based on a given reference font.
Removes the EOCR2Classifier for the given specific symbol combination during the recognition so the one set by EOCR2 will be used.
Saves the model to disk, containing the current parameter setting used for all operations in EOCR2.
Saves the current reference character database to disk.