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. | |
Manages a complete context for the font-dependent printed character reader implemented in EasyOCR.
Remarks:
License(s): EasyOCR or EasyOCR2
| None eVision.EOCR.__init__ | ( | self | ) |
| None eVision.EOCR.__init__ | ( | self, | |
| eVision.EOCR | other ) |
Constructs an OCR context.
Remarks:
By default, the Threshold property is set to 128.
| other | Another eVision.EOCR object to be copied in the new eVision.EOCR object. |
| 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.
| originX | Abscissa of the upper left corner of the bounding box of the character. |
| originY | Ordinate of the upper left corner of the bounding box of the character. |
| endX | Abscissa of the bottom right corner of the bounding box of the character. |
| endY | Ordinate of the bottom right corner of the bounding box of the character. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| originX | Abscissa of the upper left corner of the bounding box of the pattern. |
| originY | Ordinate of the upper left corner of the bounding box of the pattern. |
| width | Width of the bounding box of the pattern. |
| height | Height of the bounding box of the pattern. |
| code | Character code of the pattern. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| originX | Abscissa of the upper left corner of the bounding box of the pattern. |
| originY | Ordinate of the upper left corner of the bounding box of the pattern. |
| width | Width of the bounding box of the pattern. |
| height | Height of the bounding box of the pattern. |
| code | Character code of the pattern. |
| classes | Class of the pattern, as defined by eVision.EOCRClass. |
| float eVision.EOCR.AverageFirstCharDistance | ( | self | ) |
| None eVision.EOCR.BuildObjects | ( | self, | |
| eVision.EROIBW8 | None | sourceImage ) |
| int eVision.EOCR.CharGetDstX | ( | self, | |
| int | index ) |
Returns the abscissa of the lower right corner of a recognized character.
| index | Character number (in range 0..NumChars-1). |
| int eVision.EOCR.CharGetDstY | ( | self, | |
| int | index ) |
Returns the ordinate of the lower right corner of a recognized character.
| index | Character number (in range 0..NumChars-1). |
| int eVision.EOCR.CharGetHeight | ( | self, | |
| int | index ) |
Returns the height of a recognized character.
| index | Character number (in range 0..NumChars-1). |
| int eVision.EOCR.CharGetOrgX | ( | self, | |
| int | index ) |
Returns the abscissa of the upper left corner of a recognized character.
| index | Character number (in range 0..NumChars-1). |
| int eVision.EOCR.CharGetOrgY | ( | self, | |
| int | index ) |
Returns the ordinate of the upper left corner of a recognized character.
| index | Character number (in range 0..NumChars-1). |
| int eVision.EOCR.CharGetWidth | ( | self, | |
| int | index ) |
Returns the width of a recognized character.
| index | Character number (in range 0..NumChars-1). |
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| graphicContext | Handle of the device context on which to draw. |
| charIndex | Character index, in range 0..NumChars-1. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| charIndex | Character index, in range 0..NumChars-1. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| charIndex | Character index, in range 0..NumChars-1. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| charIndex | Character index, in range 0..NumChars-1. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| charIndex | Character index, in range 0..NumChars-1. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| panY | Vertical panning value expressed in pixels. By default, no panning occurs. |
| 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).
| graphicContext | Handle of the device context on which to draw. |
| 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).
| graphicContext | Handle of the device context on which to draw. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| 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).
| graphicContext | Handle of the device context on which to draw. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| 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).
| graphicContext | Handle of the device context on which to draw. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| 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).
| graphicContext | Handle of the device context on which to draw. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| panY | Vertical panning value expressed in pixels. By default, no panning occurs. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| selectionFlag | Tells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| selectionFlag | Tells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| selectionFlag | Tells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| selectionFlag | Tells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| 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.
| graphicContext | Handle of the device context on which to draw. |
| selectionFlag | Tells how the selected/unselected state of the objects is handled, as defined by eVision.ESelectionFlag. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0 (default), the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| panY | Vertical panning value expressed in pixels. By default, no panning occurs. |
| None eVision.EOCR.Dump | ( | self | ) |
| 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.
| 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.
| 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.
| sourceImage | Pointer to the source image/ROI. This parameter is not used and kept only for compatibility purposes. |
| 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).
| index | Character number (in range 0..NumChars-1). |
| int eVision.EOCR.GetFirstCharCode | ( | self, | |
| int | index ) |
Returns the code of the pattern that matches at best a recognized character.
| index | Character number (in range 0..NumChars-1). |
| 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.
| index | Character number (in range 0..NumChars-1). |
| 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.
| ctypes.c_void_p eVision.EOCR.GetPatternBitmapUnTyped | ( | self, | |
| int | index ) |
| int eVision.EOCR.GetPatternClass | ( | self, | |
| int | index ) |
Returns the class of a given pattern in the current font.
| index | Pattern number (in range 0..NumPatterns-1). |
| int eVision.EOCR.GetPatternCode | ( | self, | |
| int | index ) |
Returns the character code of a given pattern in the current font.
| index | Pattern number (in range 0..NumPatterns-1). |
| int eVision.EOCR.GetSecondCharCode | ( | self, | |
| int | index ) |
Returns the code of the pattern that matches at second best a recognized character.
| index | Character number (in range 0..NumChars-1). |
| 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.
| index | Character number (in range 0..NumChars-1). |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| charIndex | Index of the character to be hit. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| charIndex | Index of the character to be hit. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| charIndex | Index of the character to be hit. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| charIndex | Index of the character to be hit. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| charIndex | Index of the character to be hit. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| panY | Vertical panning value expressed in pixels. By default, no panning occurs. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| 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.
| cursorX | Current cursor coordinates. |
| cursorY | Current cursor coordinates. |
| zoomX | Horizontal zooming factor. By default, true scale is used. |
| zoomY | Vertical zooming factor. If set to 0, the default value, the horizontal zooming factor is used instead, so as to provide isotropic zooming. |
| panX | Horizontal panning value expressed in pixels. By default, no panning occurs. |
| panY | Vertical panning value expressed in pixels. By default, no panning occurs. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| charIndex | Index of the character (ASCII or Unicode) to learn. |
| code | Character code of the pattern. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| charIndex | Index of the character (ASCII or Unicode) to learn. |
| code | Character code of the pattern. |
| classes | Class of the pattern, as defined by eVision.EOCRClass. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| charIndex | Index of the character (ASCII or Unicode) to learn. |
| code | Character code of the pattern. |
| classes | Class of the pattern, as defined by eVision.EOCRClass. |
| autoSegmentation | Boolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false). |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| text | String containing character codes of the patterns. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| text | String containing character codes of the patterns. |
| singleClass | If specified, all the characters of the string are associated with the same class(es), that is specified by singleClass. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| text | String containing character codes of the patterns. |
| singleClass | If specified, all the characters of the string are associated with the same class(es), that is specified by singleClass. |
| autoSegmentation | Boolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false). |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| text | String containing character codes of the patterns. |
| classes | If specified, the i-th character of the string is associated with the class specified by the i-th element of the vector classes. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| text | String containing character codes of the patterns. |
| classes | If specified, the i-th character of the string is associated with the class specified by the i-th element of the vector classes. |
| autoSegmentation | Boolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false). |
| eVision.ELineSpacingMode eVision.EOCR.LineSpacingMode | ( | self | ) |
Line spacing mode to sort the character boxes into lines.
Default mode is eVision.ELineSpacingMode.Overlap.
| eVision.EOCR.LineSpacingMode | ( | self, | |
| eVision.ELineSpacingMode | value ) |
Line spacing mode to sort the character boxes into lines.
Default mode is eVision.ELineSpacingMode.Overlap.
| 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.
| serializer | The serializer. |
| None eVision.EOCR.Load | ( | self, | |
| str | path ) |
Loads the eVision.EOCR object configuration.
Remarks:
The given eVision.ESerializer must have been created for reading.
| path | The path from which to load the configuration. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| classes | Logical mask obtained by combining the values of eVision.EOCRClass, to specify to what classes the character may belong. |
| index | Character number (in range 0..NumChars-1). |
| shiftX | Horizontal translation applied to the character. |
| shiftY | Vertical translation applied to the character. |
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| patternWidth | Width of the normalized pattern representation, in pixels. |
| 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.
| patternWidth | Width of the normalized pattern representation, in pixels. |
| patternHeight | Height of the normalized pattern representation, in pixels. |
| 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.
| 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.
| int eVision.EOCR.NumChars | ( | self | ) |
Number of recognized characters.
| int eVision.EOCR.NumPatterns | ( | self | ) |
Number of patterns in the current font.
| int eVision.EOCR.PatternHeight | ( | self | ) |
Current pattern height, as set at the last eVision.EOCR.NewFont or eVision.EOCR.Load operation.
| int eVision.EOCR.PatternWidth | ( | self | ) |
Current pattern width, as set at the last eVision.EOCR.NewFont or eVision.EOCR.Load operation.
| 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.
| sourceImage | Pointer to the source image/ROI. |
| maximumNumberOfCharacters | Maximum number of characters to be read. |
| classes | Pointer 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. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| maximumNumberOfCharacters | Maximum number of characters to be read. |
| classes | Pointer 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. |
| autoSegmentation | Boolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false). |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| maximumNumberOfCharacters | Maximum number of characters to be read. |
| classes | Pointer 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. |
| 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.
| sourceImage | Pointer to the source image/ROI. |
| maximumNumberOfCharacters | Maximum number of characters to be read. |
| classes | Pointer 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. |
| autoSegmentation | Boolean indicating whether the calculation of the true threshold has to be forced (default true) or bypassed (false). |
| 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,
| sourceImage | Pointer to the source image/ROI. |
| maximumNumberOfCharacters | Maximum number of characters to be read. |
| classes | Pointer 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. |
| 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,
| sourceImage | Pointer to the source image/ROI. |
| maximumNumberOfCharacters | Maximum number of characters to be read. |
| classes | Pointer 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. |
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| None eVision.EOCR.RemovePattern | ( | self, | |
| int | index ) |
Removes a given pattern from the current font.
| index | Index of the pattern to be removed from the current font. |
| 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.
| serializer | The serializer. |
| None eVision.EOCR.Save | ( | self, | |
| str | path ) |
Saves the eVision.EOCR object configuration.
Remarks:
The given eVision.ESerializer must have been created for writing.
| path | The path from which to save the configuration. |
| eVision.ESegmentationMode eVision.EOCR.SegmentationMode | ( | self | ) |
Segmentation mode.
Remarks:
The segmentation parameters must be the same for both learning and recognition process.
| eVision.EOCR.SegmentationMode | ( | self, | |
| eVision.ESegmentationMode | value ) |
Segmentation mode.
Remarks:
The segmentation parameters must be the same for both learning and recognition process.
| None eVision.EOCR.SetPatternClass | ( | self, | |
| int | index, | ||
| int | classIdx ) |
Sets the class of a given pattern in the current font.
| index | Pattern number (in range 0..NumPatterns-1). |
| classIdx | The class. |
| None eVision.EOCR.SetPatternCode | ( | self, | |
| int | index, | ||
| int | code ) |
Sets the character code of a given pattern in the current font.
| index | Pattern number (in range 0..NumPatterns-1). |
| code | The character code. |
| eVision.EShiftingMode eVision.EOCR.ShiftingMode | ( | self | ) |
Shifting mode to use to compare characters to the template.
| eVision.EOCR.ShiftingMode | ( | self, | |
| eVision.EShiftingMode | value ) |
Shifting mode to use to compare characters to the template.
| 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.
| 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.
| 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.
| 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.
| eVision.EOCRColor eVision.EOCR.TextColor | ( | self | ) |
Text color.
Remarks:
The segmentation parameters must be the same for both learning and recognition process.
| eVision.EOCR.TextColor | ( | self, | |
| eVision.EOCRColor | value ) |
Text color.
Remarks:
The segmentation parameters must be the same for both learning and recognition process.
| 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.
| 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.
| 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.