eVision Python API
Loading...
Searching...
No Matches
eVision.EOCR Class Reference

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

Public Member Functions

None __init__ (self)
 Constructs an OCR context.
None __init__ (self, eVision.EOCR other)
 Constructs an OCR context.
int GetFirstCharCode (self, int index)
 Returns the code of the pattern that matches at best a recognized character.
int GetSecondCharCode (self, int index)
 Returns the code of the pattern that matches at second best a recognized character.
float GetFirstCharDistance (self, int index)
 Computes the degree of similarity between the best matching pattern and a recognized character.
float GetSecondCharDistance (self, int index)
 Computes the degree of similarity between the second best matching pattern and a recognized character.
float GetConfidenceRatio (self, int index)
 Returns the degree of confidence in the recognized character.
int CharGetOrgX (self, int index)
 Returns the abscissa of the upper left corner of a recognized character.
int CharGetOrgY (self, int index)
 Returns the ordinate of the upper left corner of a recognized character.
int CharGetDstX (self, int index)
 Returns the abscissa of the lower right corner of a recognized character.
int CharGetDstY (self, int index)
 Returns the ordinate of the lower right corner of a recognized character.
int CharGetWidth (self, int index)
 Returns the width of a recognized character.
int CharGetHeight (self, int index)
 Returns the height of a recognized character.
None BuildObjects (self, eVision.EROIBW8|None sourceImage)
 Segments the source image, i.e.
None FindAllChars (self, eVision.EROIBW8|None sourceImage)
 Locates the characters by filtering the objects according to their size, and grouping them if the segmentation mode is set to eVision.ESegmentationMode.RepasteObjects.
None FindAllChars (self)
 Locates the characters by filtering the objects according to their size, and grouping them if the segmentation mode is set to eVision.ESegmentationMode.RepasteObjects.
None MatchChar (self, eVision.EROIBW8|None sourceImage, int classes, int index, int shiftX, int shiftY)
 Reads a single character, i.e.
str ReadText (self, eVision.EROIBW8|None sourceImage, int maximumNumberOfCharacters, int classes, bool autoSegmentation)
 Reads one or more rows of characters, i.e.
str ReadText (self, eVision.EROIBW8|None sourceImage, int maximumNumberOfCharacters, int classes)
 Reads one or more rows of characters, i.e.
str ReadText (self, eVision.EROIBW8|None sourceImage, int maximumNumberOfCharacters, list[int] classes, bool autoSegmentation)
 Reads one or more rows of characters, i.e.
str ReadText (self, eVision.EROIBW8|None sourceImage, int maximumNumberOfCharacters, list[int] classes)
 Reads one or more rows of characters, i.e.
str Recognize (self, eVision.EROIBW8|None sourceImage, int maximumNumberOfCharacters, int classes)
 Achieves all processing phases (blob analysis, character segmentation and pattern recognition) in a single operation.
str Recognize (self, eVision.EROIBW8|None sourceImage, int maximumNumberOfCharacters, list[int] classes)
 Achieves all processing phases (blob analysis, character segmentation and pattern recognition) in a single operation.
int HitChars (self, int cursorX, int cursorY, float zoomX, float zoomY, float panX, float panY)
 Returns the index of the character under the cursor.
int HitChars (self, int cursorX, int cursorY, float zoomX, float zoomY, float panX)
 Returns the index of the character under the cursor.
int HitChars (self, int cursorX, int cursorY, float zoomX, float zoomY)
 Returns the index of the character under the cursor.
int HitChars (self, int cursorX, int cursorY, float zoomX)
 Returns the index of the character under the cursor.
int HitChars (self, int cursorX, int cursorY)
 Returns the index of the character under the cursor.
bool HitChar (self, int cursorX, int cursorY, int charIndex, float zoomX, float zoomY, float panX, float panY)
 Returns true if the cursor is placed over the character specified by charIndex.
bool HitChar (self, int cursorX, int cursorY, int charIndex, float zoomX, float zoomY, float panX)
 Returns true if the cursor is placed over the character specified by charIndex.
bool HitChar (self, int cursorX, int cursorY, int charIndex, float zoomX, float zoomY)
 Returns true if the cursor is placed over the character specified by charIndex.
bool HitChar (self, int cursorX, int cursorY, int charIndex, float zoomX)
 Returns true if the cursor is placed over the character specified by charIndex.
bool HitChar (self, int cursorX, int cursorY, int charIndex)
 Returns true if the cursor is placed over the character specified by charIndex.
None LearnPattern (self, eVision.EROIBW8|None sourceImage, int charIndex, int code, int classes, bool autoSegmentation)
 Adds a new pattern to the font.
None LearnPattern (self, eVision.EROIBW8|None sourceImage, int charIndex, int code, int classes)
 Adds a new pattern to the font.
None LearnPattern (self, eVision.EROIBW8|None sourceImage, int charIndex, int code)
 Adds a new pattern to the font.
None LearnPatterns (self, eVision.EROIBW8|None sourceImage, str text, int singleClass, bool autoSegmentation)
 Adds all the patterns from the source image to the font.
None LearnPatterns (self, eVision.EROIBW8|None sourceImage, str text, int singleClass)
 Adds all the patterns from the source image to the font.
None LearnPatterns (self, eVision.EROIBW8|None sourceImage, str text)
 Adds all the patterns from the source image to the font.
None LearnPatterns (self, eVision.EROIBW8|None sourceImage, str text, list[int] classes, bool autoSegmentation)
 Adds all the patterns from the source image to the font.
None LearnPatterns (self, eVision.EROIBW8|None sourceImage, str text, list[int] classes)
 Adds all the patterns from the source image to the font.
None AddPatternFromImage (self, eVision.EROIBW8|None sourceImage, int originX, int originY, int width, int height, int code, int classes)
 Adds a new pattern to the font.
None AddPatternFromImage (self, eVision.EROIBW8|None sourceImage, int originX, int originY, int width, int height, int code)
 Adds a new pattern to the font.
None NewFont (self, int patternWidth, int patternHeight)
 Empties the contents of the font and sets the size of the pattern array to be used from then on.
None NewFont (self, int patternWidth)
 Empties the contents of the font and sets the size of the pattern array to be used from then on.
None NewFont (self)
 Empties the contents of the font and sets the size of the pattern array to be used from then on.
None RemovePattern (self, int index)
 Removes a given pattern from the current font.
int GetPatternCode (self, int index)
 Returns the character code of a given pattern in the current font.
None SetPatternCode (self, int index, int code)
 Sets the character code of a given pattern in the current font.
int GetPatternClass (self, int index)
 Returns the class of a given pattern in the current font.
None SetPatternClass (self, int index, int classIdx)
 Sets the class of a given pattern in the current font.
eVision.EImageBW8|None GetPatternBitmap (self, int index)
 Returns a pointer to an image holding the pattern of the given index.
ctypes.c_void_p GetPatternBitmapUnTyped (self, int index)
None EmptyChars (self)
 Empties the list of known characters.
None AddChar (self, int originX, int originY, int endX, int endY)
 Add a character coordinates to the list.
None DrawChar (self, eVision.EDrawAdapter|None graphicContext, int charIndex, float zoomX, float zoomY, float panX, float panY)
 Draws the bounding box of a given character.
None DrawChar (self, eVision.EDrawAdapter|None graphicContext, int charIndex, float zoomX, float zoomY, float panX)
 Draws the bounding box of a given character.
None DrawChar (self, eVision.EDrawAdapter|None graphicContext, int charIndex, float zoomX, float zoomY)
 Draws the bounding box of a given character.
None DrawChar (self, eVision.EDrawAdapter|None graphicContext, int charIndex, float zoomX)
 Draws the bounding box of a given character.
None DrawChar (self, eVision.EDrawAdapter|None graphicContext, int charIndex)
 Draws the bounding box of a given character.
None DrawChars (self, eVision.EDrawAdapter|None graphicContext, float zoomX, float zoomY, float panX, float panY)
 Draws the bounding boxes of all characters in the image.
None DrawChars (self, eVision.EDrawAdapter|None graphicContext, float zoomX, float zoomY, float panX)
 Draws the bounding boxes of all characters in the image.
None DrawChars (self, eVision.EDrawAdapter|None graphicContext, float zoomX, float zoomY)
 Draws the bounding boxes of all characters in the image.
None DrawChars (self, eVision.EDrawAdapter|None graphicContext, float zoomX)
 Draws the bounding boxes of all characters in the image.
None DrawChars (self, eVision.EDrawAdapter|None graphicContext)
 Draws the bounding boxes of all characters in the image.
None DrawObjects (self, eVision.EDrawAdapter|None graphicContext, eVision.ESelectionFlag selectionFlag, float zoomX, float zoomY, float panX, float panY)
 Draws segmented objects.
None DrawObjects (self, eVision.EDrawAdapter|None graphicContext, eVision.ESelectionFlag selectionFlag, float zoomX, float zoomY, float panX)
 Draws segmented objects.
None DrawObjects (self, eVision.EDrawAdapter|None graphicContext, eVision.ESelectionFlag selectionFlag, float zoomX, float zoomY)
 Draws segmented objects.
None DrawObjects (self, eVision.EDrawAdapter|None graphicContext, eVision.ESelectionFlag selectionFlag, float zoomX)
 Draws segmented objects.
None DrawObjects (self, eVision.EDrawAdapter|None graphicContext, eVision.ESelectionFlag selectionFlag)
 Draws segmented objects.
None DrawObjects (self, eVision.EDrawAdapter|None graphicContext)
 Draws segmented objects.
None Load (self, eVision.ESerializer|None serializer)
 Loads the eVision.EOCR object configuration.
None Load (self, str path)
 Loads the eVision.EOCR object configuration.
None Save (self, eVision.ESerializer|None serializer)
 Saves the eVision.EOCR object configuration.
None Save (self, str path)
 Saves the eVision.EOCR object configuration.
None Dump (self)
int PatternWidth (self)
 Current pattern width, as set at the last eVision.EOCR.NewFont or eVision.EOCR.Load operation.
int PatternHeight (self)
 Current pattern height, as set at the last eVision.EOCR.NewFont or eVision.EOCR.Load operation.
eVision.EMatchingMode MatchingMode (self)
 Matching mode to use to compare characters to the template.
 MatchingMode (self, eVision.EMatchingMode value)
 Matching mode to use to compare characters to the template.
eVision.EShiftingMode ShiftingMode (self)
 Shifting mode to use to compare characters to the template.
 ShiftingMode (self, eVision.EShiftingMode value)
 Shifting mode to use to compare characters to the template.
int ShiftXTolerance (self)
 Horizontal translation tolerance around the nominal position when the character positions are explicitly specified.
 ShiftXTolerance (self, int value)
 Horizontal translation tolerance around the nominal position when the character positions are explicitly specified.
int ShiftYTolerance (self)
 Vertical translation tolerance around the nominal position when the character positions are explicitly specified.
 ShiftYTolerance (self, int value)
 Vertical translation tolerance around the nominal position when the character positions are explicitly specified.
eVision.EOCRColor TextColor (self)
 Text color.
 TextColor (self, eVision.EOCRColor value)
 Text color.
int Threshold (self)
 Threshold mode used for image segmentation.
 Threshold (self, int value)
 Threshold mode used for image segmentation.
float RelativeThreshold (self)
 Relative threshold used for image segmentation.
 RelativeThreshold (self, float value)
 Relative threshold used for image segmentation.
int MinCharWidth (self)
 Minimum character width.
 MinCharWidth (self, int value)
 Minimum character width.
int MaxCharWidth (self)
 Maximum character width.
 MaxCharWidth (self, int value)
 Maximum character width.
int MinCharHeight (self)
 Minimum character height.
 MinCharHeight (self, int value)
 Minimum character height.
int MaxCharHeight (self)
 Maximum character height.
 MaxCharHeight (self, int value)
 Maximum character height.
int CharSpacing (self)
 Spacing that separates characters.
 CharSpacing (self, int value)
 Spacing that separates characters.
eVision.ELineSpacingMode LineSpacingMode (self)
 Line spacing mode to sort the character boxes into lines.
 LineSpacingMode (self, eVision.ELineSpacingMode value)
 Line spacing mode to sort the character boxes into lines.
int NoiseArea (self)
 Noise area.
 NoiseArea (self, int value)
 Noise area.
eVision.ESegmentationMode SegmentationMode (self)
 Segmentation mode.
 SegmentationMode (self, eVision.ESegmentationMode value)
 Segmentation mode.
bool CutLargeChars (self)
 Flag indicating whether the large chars cutting mode is used.
 CutLargeChars (self, bool value)
 Flag indicating whether the large chars cutting mode is used.
float RelativeSpacing (self)
 Relative spacing value.
 RelativeSpacing (self, float value)
 Relative spacing value.
bool RemoveNarrowOrFlat (self)
 Flag indicating whether the characters are discarded when either dimension falls below the minimum value.
 RemoveNarrowOrFlat (self, bool value)
 Flag indicating whether the characters are discarded when either dimension falls below the minimum value.
bool RemoveBorder (self)
 Flag indicating whether all blobs touching the ROI edges are automatically discarded.
 RemoveBorder (self, bool value)
 Flag indicating whether all blobs touching the ROI edges are automatically discarded.
bool CompareAspectRatio (self)
 Flag indicating whether the character aspect ratio is used to compute the recognition score.
 CompareAspectRatio (self, bool value)
 Flag indicating whether the character aspect ratio is used to compute the recognition score.
int NumChars (self)
 Number of recognized characters.
float AverageFirstCharDistance (self)
int NumPatterns (self)
 Number of patterns in the current font.
int TrueThreshold (self)
 Absolute threshold level when using a single threshold.

Detailed Description

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

Remarks:

License(s): EasyOCR or EasyOCR2

Constructor & Destructor Documentation

◆ __init__() [1/2]

None eVision.EOCR.__init__ ( self)

Constructs an OCR context.

Remarks:

By default, the Threshold property is set to 128.

◆ __init__() [2/2]

None eVision.EOCR.__init__ ( self,
eVision.EOCR other )

Constructs an OCR context.

Remarks:

By default, the Threshold property is set to 128.

Parameters
otherAnother eVision.EOCR object to be copied in the new eVision.EOCR object.

Member Function Documentation

◆ AddChar()

None eVision.EOCR.AddChar ( self,
int originX,
int originY,
int endX,
int endY )

Add a character coordinates to the list.

Remarks:

It is to use when you know the exact position of the characters to be recognized, to bypass the segmentation step, for efficiency or reliability purposes. To use this feature, simply specify the character positions by successive calls to AddChar. When this is done, the remainder of the OCR processing steps can take place. To empty the list of known characters, call eVision.EOCR.EmptyChars.

Parameters
originXAbscissa of the upper left corner of the bounding box of the character.
originYOrdinate of the upper left corner of the bounding box of the character.
endXAbscissa of the bottom right corner of the bounding box of the character.
endYOrdinate of the bottom right corner of the bounding box of the character.

◆ AddPatternFromImage() [1/2]

None eVision.EOCR.AddPatternFromImage ( self,
eVision.EROIBW8 | None sourceImage,
int originX,
int originY,
int width,
int height,
int code )

Adds a new pattern to the font.

Remarks:

The pattern is extracted from an image by specifying a bounding rectangle.

Parameters
sourceImagePointer to the source image/ROI.
originXAbscissa of the upper left corner of the bounding box of the pattern.
originYOrdinate of the upper left corner of the bounding box of the pattern.
widthWidth of the bounding box of the pattern.
heightHeight of the bounding box of the pattern.
codeCharacter code of the pattern.

◆ AddPatternFromImage() [2/2]

None eVision.EOCR.AddPatternFromImage ( self,
eVision.EROIBW8 | None sourceImage,
int originX,
int originY,
int width,
int height,
int code,
int classes )

Adds a new pattern to the font.

Remarks:

The pattern is extracted from an image by specifying a bounding rectangle.

Parameters
sourceImagePointer to the source image/ROI.
originXAbscissa of the upper left corner of the bounding box of the pattern.
originYOrdinate of the upper left corner of the bounding box of the pattern.
widthWidth of the bounding box of the pattern.
heightHeight of the bounding box of the pattern.
codeCharacter code of the pattern.
classesClass of the pattern, as defined by eVision.EOCRClass.

◆ AverageFirstCharDistance()

float eVision.EOCR.AverageFirstCharDistance ( self)

◆ BuildObjects()

None eVision.EOCR.BuildObjects ( self,
eVision.EROIBW8 | None sourceImage )

Segments the source image, i.e.

detects and labels the objects.

Remarks:

An object is a connected set of pixels above or below Threshold (according to TextColor).

Parameters
sourceImagePointer to the source image/ROI.

◆ CharGetDstX()

int eVision.EOCR.CharGetDstX ( self,
int index )

Returns the abscissa of the lower right corner of a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ CharGetDstY()

int eVision.EOCR.CharGetDstY ( self,
int index )

Returns the ordinate of the lower right corner of a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ CharGetHeight()

int eVision.EOCR.CharGetHeight ( self,
int index )

Returns the height of a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ CharGetOrgX()

int eVision.EOCR.CharGetOrgX ( self,
int index )

Returns the abscissa of the upper left corner of a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ CharGetOrgY()

int eVision.EOCR.CharGetOrgY ( self,
int index )

Returns the ordinate of the upper left corner of a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ CharGetWidth()

int eVision.EOCR.CharGetWidth ( self,
int index )

Returns the width of a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ CharSpacing() [1/2]

int eVision.EOCR.CharSpacing ( self)

Spacing that separates characters.

Remarks:

When two objects are separated by a vertical gap larger or equal than the spacing, they are considered to belong to distinct characters. Note that two objects can still be separated if their merging will be wider than eVision.EOCR.MaxCharWidth. The segmentation parameters must be the same for both learning and recognition process.

◆ CharSpacing() [2/2]

eVision.EOCR.CharSpacing ( self,
int value )

Spacing that separates characters.

Remarks:

When two objects are separated by a vertical gap larger or equal than the spacing, they are considered to belong to distinct characters. Note that two objects can still be separated if their merging will be wider than eVision.EOCR.MaxCharWidth. The segmentation parameters must be the same for both learning and recognition process.

◆ CompareAspectRatio() [1/2]

bool eVision.EOCR.CompareAspectRatio ( self)

Flag indicating whether the character aspect ratio is used to compute the recognition score.

Remarks:

When true, the character aspect ratio is used to compute the recognition score.

◆ CompareAspectRatio() [2/2]

eVision.EOCR.CompareAspectRatio ( self,
bool value )

Flag indicating whether the character aspect ratio is used to compute the recognition score.

Remarks:

When true, the character aspect ratio is used to compute the recognition score.

◆ CutLargeChars() [1/2]

bool eVision.EOCR.CutLargeChars ( self)

Flag indicating whether the large chars cutting mode is used.

Remarks:

If true, candidate characters larger than MaxWidth are split into as many parts as required. If false, large characters are discarded. The segmentation parameters must be the same for both learning and recognition process.

◆ CutLargeChars() [2/2]

eVision.EOCR.CutLargeChars ( self,
bool value )

Flag indicating whether the large chars cutting mode is used.

Remarks:

If true, candidate characters larger than MaxWidth are split into as many parts as required. If false, large characters are discarded. The segmentation parameters must be the same for both learning and recognition process.

◆ DrawChar() [1/5]

None eVision.EOCR.DrawChar ( self,
eVision.EDrawAdapter | None graphicContext,
int charIndex )

Draws the bounding box of a given character.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used.

Parameters
graphicContextHandle of the device context on which to draw.
charIndexCharacter index, in range 0..NumChars-1.

◆ DrawChar() [2/5]

None eVision.EOCR.DrawChar ( self,
eVision.EDrawAdapter | None graphicContext,
int charIndex,
float zoomX )

Draws the bounding box of a given character.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used.

Parameters
graphicContextHandle of the device context on which to draw.
charIndexCharacter index, in range 0..NumChars-1.
zoomXHorizontal zooming factor. By default, true scale is used.

◆ DrawChar() [3/5]

None eVision.EOCR.DrawChar ( self,
eVision.EDrawAdapter | None graphicContext,
int charIndex,
float zoomX,
float zoomY )

Draws the bounding box of a given character.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used.

Parameters
graphicContextHandle of the device context on which to draw.
charIndexCharacter index, in range 0..NumChars-1.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.

◆ DrawChar() [4/5]

None eVision.EOCR.DrawChar ( self,
eVision.EDrawAdapter | None graphicContext,
int charIndex,
float zoomX,
float zoomY,
float panX )

Draws the bounding box of a given character.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used.

Parameters
graphicContextHandle of the device context on which to draw.
charIndexCharacter index, in range 0..NumChars-1.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.

◆ DrawChar() [5/5]

None eVision.EOCR.DrawChar ( self,
eVision.EDrawAdapter | None graphicContext,
int charIndex,
float zoomX,
float zoomY,
float panX,
float panY )

Draws the bounding box of a given character.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used.

Parameters
graphicContextHandle of the device context on which to draw.
charIndexCharacter index, in range 0..NumChars-1.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

◆ DrawChars() [1/5]

None eVision.EOCR.DrawChars ( self,
eVision.EDrawAdapter | None graphicContext )

Draws the bounding boxes of all characters in the image.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all characters (to vary the colors, draw the objects separately using the eVision.EOCR.DrawChar method instead).

Parameters
graphicContextHandle of the device context on which to draw.

◆ DrawChars() [2/5]

None eVision.EOCR.DrawChars ( self,
eVision.EDrawAdapter | None graphicContext,
float zoomX )

Draws the bounding boxes of all characters in the image.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all characters (to vary the colors, draw the objects separately using the eVision.EOCR.DrawChar method instead).

Parameters
graphicContextHandle of the device context on which to draw.
zoomXHorizontal zooming factor. By default, true scale is used.

◆ DrawChars() [3/5]

None eVision.EOCR.DrawChars ( self,
eVision.EDrawAdapter | None graphicContext,
float zoomX,
float zoomY )

Draws the bounding boxes of all characters in the image.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all characters (to vary the colors, draw the objects separately using the eVision.EOCR.DrawChar method instead).

Parameters
graphicContextHandle of the device context on which to draw.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.

◆ DrawChars() [4/5]

None eVision.EOCR.DrawChars ( self,
eVision.EDrawAdapter | None graphicContext,
float zoomX,
float zoomY,
float panX )

Draws the bounding boxes of all characters in the image.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all characters (to vary the colors, draw the objects separately using the eVision.EOCR.DrawChar method instead).

Parameters
graphicContextHandle of the device context on which to draw.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.

◆ DrawChars() [5/5]

None eVision.EOCR.DrawChars ( self,
eVision.EDrawAdapter | None graphicContext,
float zoomX,
float zoomY,
float panX,
float panY )

Draws the bounding boxes of all characters in the image.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all characters (to vary the colors, draw the objects separately using the eVision.EOCR.DrawChar method instead).

Parameters
graphicContextHandle of the device context on which to draw.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

◆ DrawObjects() [1/6]

None eVision.EOCR.DrawObjects ( self,
eVision.EDrawAdapter | None graphicContext )

Draws segmented objects.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all objects. Optionally, only the selected or deselected objects can be drawn.

Parameters
graphicContextHandle of the device context on which to draw.

◆ DrawObjects() [2/6]

None eVision.EOCR.DrawObjects ( self,
eVision.EDrawAdapter | None graphicContext,
eVision.ESelectionFlag selectionFlag )

Draws segmented objects.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all objects. Optionally, only the selected or deselected objects can be drawn.

Parameters
graphicContextHandle of the device context on which to draw.
selectionFlagTells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag.

◆ DrawObjects() [3/6]

None eVision.EOCR.DrawObjects ( self,
eVision.EDrawAdapter | None graphicContext,
eVision.ESelectionFlag selectionFlag,
float zoomX )

Draws segmented objects.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all objects. Optionally, only the selected or deselected objects can be drawn.

Parameters
graphicContextHandle of the device context on which to draw.
selectionFlagTells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag.
zoomXHorizontal zooming factor. By default, true scale is used.

◆ DrawObjects() [4/6]

None eVision.EOCR.DrawObjects ( self,
eVision.EDrawAdapter | None graphicContext,
eVision.ESelectionFlag selectionFlag,
float zoomX,
float zoomY )

Draws segmented objects.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all objects. Optionally, only the selected or deselected objects can be drawn.

Parameters
graphicContextHandle of the device context on which to draw.
selectionFlagTells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.

◆ DrawObjects() [5/6]

None eVision.EOCR.DrawObjects ( self,
eVision.EDrawAdapter | None graphicContext,
eVision.ESelectionFlag selectionFlag,
float zoomX,
float zoomY,
float panX )

Draws segmented objects.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all objects. Optionally, only the selected or deselected objects can be drawn.

Parameters
graphicContextHandle of the device context on which to draw.
selectionFlagTells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.

◆ DrawObjects() [6/6]

None eVision.EOCR.DrawObjects ( self,
eVision.EDrawAdapter | None graphicContext,
eVision.ESelectionFlag selectionFlag,
float zoomX,
float zoomY,
float panX,
float panY )

Draws segmented objects.

Remarks:

Drawing is done in the device context associated to the desired window. The current pen is used for all objects. Optionally, only the selected or deselected objects can be drawn.

Parameters
graphicContextHandle of the device context on which to draw.
selectionFlagTells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

◆ Dump()

None eVision.EOCR.Dump ( self)

◆ EmptyChars()

None eVision.EOCR.EmptyChars ( self)

Empties the list of known characters.

Remarks:

It is to use when you know the exact position of the characters to be recognized. See member eVision.EOCR.AddChar.

◆ FindAllChars() [1/2]

None eVision.EOCR.FindAllChars ( self)

Locates the characters by filtering the objects according to their size, and grouping them if the segmentation mode is set to eVision.ESegmentationMode.RepasteObjects.

Remarks:

The characters are sorted from left to right. This operation must be performed after a call to eVision.EOCR.BuildObjects and before a call to eVision.EOCR.ReadText.

◆ FindAllChars() [2/2]

None eVision.EOCR.FindAllChars ( self,
eVision.EROIBW8 | None sourceImage )

Locates the characters by filtering the objects according to their size, and grouping them if the segmentation mode is set to eVision.ESegmentationMode.RepasteObjects.

Remarks:

The characters are sorted from left to right. This operation must be performed after a call to eVision.EOCR.BuildObjects and before a call to eVision.EOCR.ReadText.

Parameters
sourceImagePointer to the source image/ROI. This parameter is not used and kept only for compatibility purposes.

◆ GetConfidenceRatio()

float eVision.EOCR.GetConfidenceRatio ( self,
int index )

Returns the degree of confidence in the recognized character.

Remarks:

A value of 100 % means there is no difference between the recognized character and the best matching pattern. A value of 0 % means there is no way to distinguish between the best and second best matching pattern. The computation of the confidence ratio is based on the first and second characters distance parameters (see eVision.EOCR.GetFirstCharDistance and eVision.EOCR.GetSecondCharDistance).

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ GetFirstCharCode()

int eVision.EOCR.GetFirstCharCode ( self,
int index )

Returns the code of the pattern that matches at best a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ GetFirstCharDistance()

float eVision.EOCR.GetFirstCharDistance ( self,
int index )

Computes the degree of similarity between the best matching pattern and a recognized character.

Remarks:

Returns 0 for a perfect match and 1 for a total mismatch.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ GetPatternBitmap()

eVision.EImageBW8 | None eVision.EOCR.GetPatternBitmap ( self,
int index )

Returns a pointer to an image holding the pattern of the given index.

This image should not be modified.

◆ GetPatternBitmapUnTyped()

ctypes.c_void_p eVision.EOCR.GetPatternBitmapUnTyped ( self,
int index )

◆ GetPatternClass()

int eVision.EOCR.GetPatternClass ( self,
int index )

Returns the class of a given pattern in the current font.

Parameters
indexPattern number (in range 0..NumPatterns-1).

◆ GetPatternCode()

int eVision.EOCR.GetPatternCode ( self,
int index )

Returns the character code of a given pattern in the current font.

Parameters
indexPattern number (in range 0..NumPatterns-1).

◆ GetSecondCharCode()

int eVision.EOCR.GetSecondCharCode ( self,
int index )

Returns the code of the pattern that matches at second best a recognized character.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ GetSecondCharDistance()

float eVision.EOCR.GetSecondCharDistance ( self,
int index )

Computes the degree of similarity between the second best matching pattern and a recognized character.

Remarks:

Returns 0 for a perfect match and 1 for a total mismatch.

Parameters
indexCharacter number (in range 0..NumChars-1).

◆ HitChar() [1/5]

bool eVision.EOCR.HitChar ( self,
int cursorX,
int cursorY,
int charIndex )

Returns true if the cursor is placed over the character specified by charIndex.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
charIndexIndex of the character to be hit.

◆ HitChar() [2/5]

bool eVision.EOCR.HitChar ( self,
int cursorX,
int cursorY,
int charIndex,
float zoomX )

Returns true if the cursor is placed over the character specified by charIndex.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
charIndexIndex of the character to be hit.
zoomXHorizontal zooming factor. By default, true scale is used.

◆ HitChar() [3/5]

bool eVision.EOCR.HitChar ( self,
int cursorX,
int cursorY,
int charIndex,
float zoomX,
float zoomY )

Returns true if the cursor is placed over the character specified by charIndex.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
charIndexIndex of the character to be hit.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming.

◆ HitChar() [4/5]

bool eVision.EOCR.HitChar ( self,
int cursorX,
int cursorY,
int charIndex,
float zoomX,
float zoomY,
float panX )

Returns true if the cursor is placed over the character specified by charIndex.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
charIndexIndex of the character to be hit.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.

◆ HitChar() [5/5]

bool eVision.EOCR.HitChar ( self,
int cursorX,
int cursorY,
int charIndex,
float zoomX,
float zoomY,
float panX,
float panY )

Returns true if the cursor is placed over the character specified by charIndex.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
charIndexIndex of the character to be hit.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

◆ HitChars() [1/5]

int eVision.EOCR.HitChars ( self,
int cursorX,
int cursorY )

Returns the index of the character under the cursor.

If the cursor is not located on any character, then eVision.EOCR.NumChars is returned.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.

◆ HitChars() [2/5]

int eVision.EOCR.HitChars ( self,
int cursorX,
int cursorY,
float zoomX )

Returns the index of the character under the cursor.

If the cursor is not located on any character, then eVision.EOCR.NumChars is returned.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
zoomXHorizontal zooming factor. By default, true scale is used.

◆ HitChars() [3/5]

int eVision.EOCR.HitChars ( self,
int cursorX,
int cursorY,
float zoomX,
float zoomY )

Returns the index of the character under the cursor.

If the cursor is not located on any character, then eVision.EOCR.NumChars is returned.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming.

◆ HitChars() [4/5]

int eVision.EOCR.HitChars ( self,
int cursorX,
int cursorY,
float zoomX,
float zoomY,
float panX )

Returns the index of the character under the cursor.

If the cursor is not located on any character, then eVision.EOCR.NumChars is returned.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.

◆ HitChars() [5/5]

int eVision.EOCR.HitChars ( self,
int cursorX,
int cursorY,
float zoomX,
float zoomY,
float panX,
float panY )

Returns the index of the character under the cursor.

If the cursor is not located on any character, then eVision.EOCR.NumChars is returned.

Remarks:

If zooming and/or panning were used when drawing the ROI, the same values must be used with this method.

Parameters
cursorXCurrent cursor coordinates.
cursorYCurrent cursor coordinates.
zoomXHorizontal zooming factor. By default, true scale is used.
zoomYVertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming.
panXHorizontal panning value expressed in pixels. By default, no panning occurs.
panYVertical panning value expressed in pixels. By default, no panning occurs.

◆ LearnPattern() [1/3]

None eVision.EOCR.LearnPattern ( self,
eVision.EROIBW8 | None sourceImage,
int charIndex,
int code )

Adds a new pattern to the font.

Remarks:

The pattern is selected by its index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
charIndexIndex of the character (ASCII or Unicode) to learn.
codeCharacter code of the pattern.

◆ LearnPattern() [2/3]

None eVision.EOCR.LearnPattern ( self,
eVision.EROIBW8 | None sourceImage,
int charIndex,
int code,
int classes )

Adds a new pattern to the font.

Remarks:

The pattern is selected by its index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
charIndexIndex of the character (ASCII or Unicode) to learn.
codeCharacter code of the pattern.
classesClass of the pattern, as defined by eVision.EOCRClass.

◆ LearnPattern() [3/3]

None eVision.EOCR.LearnPattern ( self,
eVision.EROIBW8 | None sourceImage,
int charIndex,
int code,
int classes,
bool autoSegmentation )

Adds a new pattern to the font.

Remarks:

The pattern is selected by its index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
charIndexIndex of the character (ASCII or Unicode) to learn.
codeCharacter code of the pattern.
classesClass of the pattern, as defined by eVision.EOCRClass.
autoSegmentationBoolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false).

◆ LearnPatterns() [1/5]

None eVision.EOCR.LearnPatterns ( self,
eVision.EROIBW8 | None sourceImage,
str text )

Adds all the patterns from the source image to the font.

Remarks:

Patterns are ordered by their index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
textString containing character codes of the patterns.

◆ LearnPatterns() [2/5]

None eVision.EOCR.LearnPatterns ( self,
eVision.EROIBW8 | None sourceImage,
str text,
int singleClass )

Adds all the patterns from the source image to the font.

Remarks:

Patterns are ordered by their index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
textString containing character codes of the patterns.
singleClassIf specified, all the characters of the string are associated with the same class(es), that is specified by singleClass.

◆ LearnPatterns() [3/5]

None eVision.EOCR.LearnPatterns ( self,
eVision.EROIBW8 | None sourceImage,
str text,
int singleClass,
bool autoSegmentation )

Adds all the patterns from the source image to the font.

Remarks:

Patterns are ordered by their index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
textString containing character codes of the patterns.
singleClassIf specified, all the characters of the string are associated with the same class(es), that is specified by singleClass.
autoSegmentationBoolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false).

◆ LearnPatterns() [4/5]

None eVision.EOCR.LearnPatterns ( self,
eVision.EROIBW8 | None sourceImage,
str text,
list[int] classes )

Adds all the patterns from the source image to the font.

Remarks:

Patterns are ordered by their index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
textString containing character codes of the patterns.
classesIf specified, the i-th character of the string is associated with the class specified by the i-th element of the vector classes.

◆ LearnPatterns() [5/5]

None eVision.EOCR.LearnPatterns ( self,
eVision.EROIBW8 | None sourceImage,
str text,
list[int] classes,
bool autoSegmentation )

Adds all the patterns from the source image to the font.

Remarks:

Patterns are ordered by their index value, as assigned by the eVision.EOCR.FindAllChars process.

Parameters
sourceImagePointer to the source image/ROI.
textString containing character codes of the patterns.
classesIf specified, the i-th character of the string is associated with the class specified by the i-th element of the vector classes.
autoSegmentationBoolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false).

◆ LineSpacingMode() [1/2]

eVision.ELineSpacingMode eVision.EOCR.LineSpacingMode ( self)

Line spacing mode to sort the character boxes into lines.

Default mode is eVision.ELineSpacingMode.Overlap.

◆ LineSpacingMode() [2/2]

eVision.EOCR.LineSpacingMode ( self,
eVision.ELineSpacingMode value )

Line spacing mode to sort the character boxes into lines.

Default mode is eVision.ELineSpacingMode.Overlap.

◆ Load() [1/2]

None eVision.EOCR.Load ( self,
eVision.ESerializer | None serializer )

Loads the eVision.EOCR object configuration.

Remarks:

The given eVision.ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ Load() [2/2]

None eVision.EOCR.Load ( self,
str path )

Loads the eVision.EOCR object configuration.

Remarks:

The given eVision.ESerializer must have been created for reading.

Parameters
pathThe path from which to load the configuration.

◆ MatchChar()

None eVision.EOCR.MatchChar ( self,
eVision.EROIBW8 | None sourceImage,
int classes,
int index,
int shiftX,
int shiftY )

Reads a single character, i.e.

finds the best match between the patterns in the font and the given character.

Remarks:

A shift can be apply to the character. This operation can only be performed after a call to eVision.EOCR.FindAllChars.

Parameters
sourceImagePointer to the source image/ROI.
classesLogical mask obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong.
indexCharacter number (in range 0..NumChars-1).
shiftXHorizontal translation applied to the character.
shiftYVertical translation applied to the character.

◆ MatchingMode() [1/2]

eVision.EMatchingMode eVision.EOCR.MatchingMode ( self)

Matching mode to use to compare characters to the template.

Remarks:

By default, the root-mean-square error method is used. These modes are meant to be used without thresholding, that is when one of the eVision.EOCRColor.DarkOnLight and eVision.EOCRColor.LightOnDark colors are used.

◆ MatchingMode() [2/2]

eVision.EOCR.MatchingMode ( self,
eVision.EMatchingMode value )

Matching mode to use to compare characters to the template.

Remarks:

By default, the root-mean-square error method is used. These modes are meant to be used without thresholding, that is when one of the eVision.EOCRColor.DarkOnLight and eVision.EOCRColor.LightOnDark colors are used.

◆ MaxCharHeight() [1/2]

int eVision.EOCR.MaxCharHeight ( self)

Maximum character height.

Remarks:

A character larger than the maximum width or higher than the maximum height is discarded. The segmentation parameters must be the same for both learning and recognition process.

◆ MaxCharHeight() [2/2]

eVision.EOCR.MaxCharHeight ( self,
int value )

Maximum character height.

Remarks:

A character larger than the maximum width or higher than the maximum height is discarded. The segmentation parameters must be the same for both learning and recognition process.

◆ MaxCharWidth() [1/2]

int eVision.EOCR.MaxCharWidth ( self)

Maximum character width.

Remarks:

A character larger than the maximum width or higher than the maximum height is discarded. The segmentation parameters must be the same for both learning and recognition process.

◆ MaxCharWidth() [2/2]

eVision.EOCR.MaxCharWidth ( self,
int value )

Maximum character width.

Remarks:

A character larger than the maximum width or higher than the maximum height is discarded. The segmentation parameters must be the same for both learning and recognition process.

◆ MinCharHeight() [1/2]

int eVision.EOCR.MinCharHeight ( self)

Minimum character height.

Remarks:

A character both narrower than the minimum width and lower than the minimum height is discarded by default (see eVision.EOCR.RemoveNarrowOrFlat). The segmentation parameters must be the same for both learning and recognition process.

◆ MinCharHeight() [2/2]

eVision.EOCR.MinCharHeight ( self,
int value )

Minimum character height.

Remarks:

A character both narrower than the minimum width and lower than the minimum height is discarded by default (see eVision.EOCR.RemoveNarrowOrFlat). The segmentation parameters must be the same for both learning and recognition process.

◆ MinCharWidth() [1/2]

int eVision.EOCR.MinCharWidth ( self)

Minimum character width.

Remarks:

A character both narrower than the minimum width and lower than the minimum height is discarded by default (see eVision.EOCR.RemoveNarrowOrFlat). The segmentation parameters must be the same for both learning and recognition process.

◆ MinCharWidth() [2/2]

eVision.EOCR.MinCharWidth ( self,
int value )

Minimum character width.

Remarks:

A character both narrower than the minimum width and lower than the minimum height is discarded by default (see eVision.EOCR.RemoveNarrowOrFlat). The segmentation parameters must be the same for both learning and recognition process.

◆ NewFont() [1/3]

None eVision.EOCR.NewFont ( self)

Empties the contents of the font and sets the size of the pattern array to be used from then on.

Remarks:

A larger pattern array improves the recognition sensitivity, at the expense of increased processing time.

◆ NewFont() [2/3]

None eVision.EOCR.NewFont ( self,
int patternWidth )

Empties the contents of the font and sets the size of the pattern array to be used from then on.

Remarks:

A larger pattern array improves the recognition sensitivity, at the expense of increased processing time.

Parameters
patternWidthWidth of the normalized pattern representation, in pixels.

◆ NewFont() [3/3]

None eVision.EOCR.NewFont ( self,
int patternWidth,
int patternHeight )

Empties the contents of the font and sets the size of the pattern array to be used from then on.

Remarks:

A larger pattern array improves the recognition sensitivity, at the expense of increased processing time.

Parameters
patternWidthWidth of the normalized pattern representation, in pixels.
patternHeightHeight of the normalized pattern representation, in pixels.

◆ NoiseArea() [1/2]

int eVision.EOCR.NoiseArea ( self)

Noise area.

Remarks:

When a blob has an area smaller than this value, it is ignored. The segmentation parameters must be the same for both learning and recognition process.

◆ NoiseArea() [2/2]

eVision.EOCR.NoiseArea ( self,
int value )

Noise area.

Remarks:

When a blob has an area smaller than this value, it is ignored. The segmentation parameters must be the same for both learning and recognition process.

◆ NumChars()

int eVision.EOCR.NumChars ( self)

Number of recognized characters.

◆ NumPatterns()

int eVision.EOCR.NumPatterns ( self)

Number of patterns in the current font.

◆ PatternHeight()

int eVision.EOCR.PatternHeight ( self)

Current pattern height, as set at the last eVision.EOCR.NewFont or eVision.EOCR.Load operation.

◆ PatternWidth()

int eVision.EOCR.PatternWidth ( self)

Current pattern width, as set at the last eVision.EOCR.NewFont or eVision.EOCR.Load operation.

◆ ReadText() [1/4]

str eVision.EOCR.ReadText ( self,
eVision.EROIBW8 | None sourceImage,
int maximumNumberOfCharacters,
int classes )

Reads one or more rows of characters, i.e.

finds the best match between the patterns in the font and the segmented characters.

Remarks:

This operation can only be performed after a call to eVision.EOCR.FindAllChars.

Parameters
sourceImagePointer to the source image/ROI.
maximumNumberOfCharactersMaximum number of characters to be read.
classesPointer to an array of logical masks obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. Each mask value in the array applies to the corresponding character.

◆ ReadText() [2/4]

str eVision.EOCR.ReadText ( self,
eVision.EROIBW8 | None sourceImage,
int maximumNumberOfCharacters,
int classes,
bool autoSegmentation )

Reads one or more rows of characters, i.e.

finds the best match between the patterns in the font and the segmented characters.

Remarks:

This operation can only be performed after a call to eVision.EOCR.FindAllChars.

Parameters
sourceImagePointer to the source image/ROI.
maximumNumberOfCharactersMaximum number of characters to be read.
classesPointer to an array of logical masks obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. Each mask value in the array applies to the corresponding character.
autoSegmentationBoolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false).

◆ ReadText() [3/4]

str eVision.EOCR.ReadText ( self,
eVision.EROIBW8 | None sourceImage,
int maximumNumberOfCharacters,
list[int] classes )

Reads one or more rows of characters, i.e.

finds the best match between the patterns in the font and the segmented characters.

Remarks:

This operation can only be performed after a call to eVision.EOCR.FindAllChars.

Parameters
sourceImagePointer to the source image/ROI.
maximumNumberOfCharactersMaximum number of characters to be read.
classesPointer to an array of logical masks obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. Each mask value in the array applies to the corresponding character.

◆ ReadText() [4/4]

str eVision.EOCR.ReadText ( self,
eVision.EROIBW8 | None sourceImage,
int maximumNumberOfCharacters,
list[int] classes,
bool autoSegmentation )

Reads one or more rows of characters, i.e.

finds the best match between the patterns in the font and the segmented characters.

Remarks:

This operation can only be performed after a call to eVision.EOCR.FindAllChars.

Parameters
sourceImagePointer to the source image/ROI.
maximumNumberOfCharactersMaximum number of characters to be read.
classesPointer to an array of logical masks obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. Each mask value in the array applies to the corresponding character.
autoSegmentationBoolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false).

◆ Recognize() [1/2]

str eVision.EOCR.Recognize ( self,
eVision.EROIBW8 | None sourceImage,
int maximumNumberOfCharacters,
int classes )

Achieves all processing phases (blob analysis, character segmentation and pattern recognition) in a single operation.

Remarks:

This method does the same as a sequence of eVision.EOCR.BuildObjects``/``eVision.EOCR.FindAllChars``/``eVision.EOCR.ReadText,

Parameters
sourceImagePointer to the source image/ROI.
maximumNumberOfCharactersMaximum number of characters to be read.
classesPointer to an array of logical mask obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. Each mask value in the array applies to the corresponding character.

◆ Recognize() [2/2]

str eVision.EOCR.Recognize ( self,
eVision.EROIBW8 | None sourceImage,
int maximumNumberOfCharacters,
list[int] classes )

Achieves all processing phases (blob analysis, character segmentation and pattern recognition) in a single operation.

Remarks:

This method does the same as a sequence of eVision.EOCR.BuildObjects``/``eVision.EOCR.FindAllChars``/``eVision.EOCR.ReadText,

Parameters
sourceImagePointer to the source image/ROI.
maximumNumberOfCharactersMaximum number of characters to be read.
classesPointer to an array of logical mask obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. Each mask value in the array applies to the corresponding character.

◆ RelativeSpacing() [1/2]

float eVision.EOCR.RelativeSpacing ( self)

Relative spacing value.

Remarks:

This value is the ratio of the width of the spaces between characters and the character width. For example, characters 25 pixels wide separated by 10 pixels gaps correspond to a relative spacing of 10/25 = 0.4. The default value of this parameter is 0, corresponding to no spacing. This parameter is relevant only when the CutLargeChars mode is enabled. The segmentation parameters must be the same for both learning and recognition process.

◆ RelativeSpacing() [2/2]

eVision.EOCR.RelativeSpacing ( self,
float value )

Relative spacing value.

Remarks:

This value is the ratio of the width of the spaces between characters and the character width. For example, characters 25 pixels wide separated by 10 pixels gaps correspond to a relative spacing of 10/25 = 0.4. The default value of this parameter is 0, corresponding to no spacing. This parameter is relevant only when the CutLargeChars mode is enabled. The segmentation parameters must be the same for both learning and recognition process.

◆ RelativeThreshold() [1/2]

float eVision.EOCR.RelativeThreshold ( self)

Relative threshold used for image segmentation.

Remarks:

The RelativeThreshold is the fraction of the image pixels that will be set below the threshold. Only used when the eVision.EOCR.Threshold property is set to eVision.EThresholdMode.Relative. The default value is 0.5.

◆ RelativeThreshold() [2/2]

eVision.EOCR.RelativeThreshold ( self,
float value )

Relative threshold used for image segmentation.

Remarks:

The RelativeThreshold is the fraction of the image pixels that will be set below the threshold. Only used when the eVision.EOCR.Threshold property is set to eVision.EThresholdMode.Relative. The default value is 0.5.

◆ RemoveBorder() [1/2]

bool eVision.EOCR.RemoveBorder ( self)

Flag indicating whether all blobs touching the ROI edges are automatically discarded.

Remarks:

If true, all blobs touching the ROI edges are automatically discarded. By default, this feature is turned on. The segmentation parameters must be the same for both learning and recognition process.

◆ RemoveBorder() [2/2]

eVision.EOCR.RemoveBorder ( self,
bool value )

Flag indicating whether all blobs touching the ROI edges are automatically discarded.

Remarks:

If true, all blobs touching the ROI edges are automatically discarded. By default, this feature is turned on. The segmentation parameters must be the same for both learning and recognition process.

◆ RemoveNarrowOrFlat() [1/2]

bool eVision.EOCR.RemoveNarrowOrFlat ( self)

Flag indicating whether the characters are discarded when either dimension falls below the minimum value.

Remarks:

If true, characters are discarded if either their width or their height is smaller than the minimum value. By default, this feature is disabled (only smaller characters in both height and width are discarded: the condition could be written NarrowAndFlat). The segmentation parameters must be the same for both learning and recognition process.

◆ RemoveNarrowOrFlat() [2/2]

eVision.EOCR.RemoveNarrowOrFlat ( self,
bool value )

Flag indicating whether the characters are discarded when either dimension falls below the minimum value.

Remarks:

If true, characters are discarded if either their width or their height is smaller than the minimum value. By default, this feature is disabled (only smaller characters in both height and width are discarded: the condition could be written NarrowAndFlat). The segmentation parameters must be the same for both learning and recognition process.

◆ RemovePattern()

None eVision.EOCR.RemovePattern ( self,
int index )

Removes a given pattern from the current font.

Parameters
indexIndex of the pattern to be removed from the current font.

◆ Save() [1/2]

None eVision.EOCR.Save ( self,
eVision.ESerializer | None serializer )

Saves the eVision.EOCR object configuration.

Remarks:

The given eVision.ESerializer must have been created for writing.

Parameters
serializerThe serializer.

◆ Save() [2/2]

None eVision.EOCR.Save ( self,
str path )

Saves the eVision.EOCR object configuration.

Remarks:

The given eVision.ESerializer must have been created for writing.

Parameters
pathThe path from which to save the configuration.

◆ SegmentationMode() [1/2]

eVision.ESegmentationMode eVision.EOCR.SegmentationMode ( self)

Segmentation mode.

Remarks:

The segmentation parameters must be the same for both learning and recognition process.

◆ SegmentationMode() [2/2]

eVision.EOCR.SegmentationMode ( self,
eVision.ESegmentationMode value )

Segmentation mode.

Remarks:

The segmentation parameters must be the same for both learning and recognition process.

◆ SetPatternClass()

None eVision.EOCR.SetPatternClass ( self,
int index,
int classIdx )

Sets the class of a given pattern in the current font.

Parameters
indexPattern number (in range 0..NumPatterns-1).
classIdxThe class.

◆ SetPatternCode()

None eVision.EOCR.SetPatternCode ( self,
int index,
int code )

Sets the character code of a given pattern in the current font.

Parameters
indexPattern number (in range 0..NumPatterns-1).
codeThe character code.

◆ ShiftingMode() [1/2]

eVision.EShiftingMode eVision.EOCR.ShiftingMode ( self)

Shifting mode to use to compare characters to the template.

◆ ShiftingMode() [2/2]

eVision.EOCR.ShiftingMode ( self,
eVision.EShiftingMode value )

Shifting mode to use to compare characters to the template.

◆ ShiftXTolerance() [1/2]

int eVision.EOCR.ShiftXTolerance ( self)

Horizontal translation tolerance around the nominal position when the character positions are explicitly specified.

Remarks:

By default, no shifting is allowed (ShiftX = 0). The tolerance can be used in two ways: either each character is moved individually until the best match is found, or the set of characters is matched as a whole, until the best average error is reached. See eVision.EOCR.ShiftingMode.

◆ ShiftXTolerance() [2/2]

eVision.EOCR.ShiftXTolerance ( self,
int value )

Horizontal translation tolerance around the nominal position when the character positions are explicitly specified.

Remarks:

By default, no shifting is allowed (ShiftX = 0). The tolerance can be used in two ways: either each character is moved individually until the best match is found, or the set of characters is matched as a whole, until the best average error is reached. See eVision.EOCR.ShiftingMode.

◆ ShiftYTolerance() [1/2]

int eVision.EOCR.ShiftYTolerance ( self)

Vertical translation tolerance around the nominal position when the character positions are explicitly specified.

Remarks:

By default, no shifting is allowed (ShiftY = 0). The tolerance can be used in two ways: either each character is moved individually until the best match is found, or the set of characters is matched as a whole, until the best average error is reached. See eVision.EOCR.ShiftingMode.

◆ ShiftYTolerance() [2/2]

eVision.EOCR.ShiftYTolerance ( self,
int value )

Vertical translation tolerance around the nominal position when the character positions are explicitly specified.

Remarks:

By default, no shifting is allowed (ShiftY = 0). The tolerance can be used in two ways: either each character is moved individually until the best match is found, or the set of characters is matched as a whole, until the best average error is reached. See eVision.EOCR.ShiftingMode.

◆ TextColor() [1/2]

eVision.EOCRColor eVision.EOCR.TextColor ( self)

Text color.

Remarks:

The segmentation parameters must be the same for both learning and recognition process.

◆ TextColor() [2/2]

eVision.EOCR.TextColor ( self,
eVision.EOCRColor value )

Text color.

Remarks:

The segmentation parameters must be the same for both learning and recognition process.

◆ Threshold() [1/2]

int eVision.EOCR.Threshold ( self)

Threshold mode used for image segmentation.

Remarks:

Threshold value as defined by the EThresholdMode enum. By default, the "minimum residue" mode is used to determine the threshold value. In case of an absolute threshold, the threshold value is given instead.

◆ Threshold() [2/2]

eVision.EOCR.Threshold ( self,
int value )

Threshold mode used for image segmentation.

Remarks:

Threshold value as defined by the EThresholdMode enum. By default, the "minimum residue" mode is used to determine the threshold value. In case of an absolute threshold, the threshold value is given instead.

◆ TrueThreshold()

int eVision.EOCR.TrueThreshold ( self)

Absolute threshold level when using a single threshold.

Remarks:

This value is valid only when the eVision.EOCR.BuildObjects or eVision.EOCR.ReadText method has been called beforehand.