Leaper Vision Toolkit
中文 / English 2.x
Data Structures | Enumerations
LPVOCRLib Module Reference

LPV OCR(Optical Character Recognition) Library, provides classes for character segmentation, recognition and verification. More...

Data Structures

interface  ILFontDatabase
 This interface represents a font database for character recognition. More...
 
interface  ILOCR
 This interface provide functionalities of character segmentation, recognition and verification. More...
 
interface  ILOCRChar
 This interface represents a single character and is used to access its properties. More...
 
interface  ILOCRLine
 This interface represents a single line of text and is used to access its properties. More...
 
interface  ILOCRResult
 This interface represents a OCR result instance and is used to access its properties. More...
 
class  LFontDatabase
 
class  LOCR
 
class  LOCRChar
 
class  LOCRLine
 
class  LOCRResult
 

Enumerations

enum  LPVOCRDrawFlags {
  LPVOCRDrawString = 1 , LPVOCRDrawRegion = 2 , LPVOCRDrawCenter = 4 , LPVOCRDrawIndex = 8 ,
  LPVOCRDrawByLine = 16 , LPVOCRDrawDefault = LPVOCRDrawString | LPVOCRDrawRegion , LPVOCRDrawAll = 0x0f
}
 This enumeration represents the flags to control the OCR results' drawing behavior. More...
 
enum  LPVOCRFeatures {
  LPVOCRFeaturePixel = 0x0001 , LPVOCRFeatureFGFraction = 0x0002 , LPVOCRFeatureCircularity = 0x0004 , LPVOCRFeatureConvexity = 0x0008 ,
  LPVOCRFeatureConvexityDefects = 0x0010 , LPVOCRFeatureOrientation = 0x0020 , LPVOCRFeatureInertia = 0x0040 , LPVOCRFeatureContourCount = 0x0080 ,
  LPVOCRFeatureHoleCount = 0x0100 , LPVOCRFeatureAspectRatio = 0x0200 , LPVOCRFeatureWidth = 0x0400 , LPVOCRFeatureHeight = 0x0800 ,
  LPVOCRFeatureZoomFactor = 0x1000 , LPVOCRFeatureDefault = LPVOCRFeaturePixel | LPVOCRFeatureAspectRatio , LPVOCRFeatureAll = 0xffff
}
 This enumeration represents the features available for recognition. More...
 
enum  LPVOCRPixelProjection { LPVOCRPixelProjNone = 0 , LPVOCRPixelProjHorizontal = 1 , LPVOCRPixelProjVertical = 2 , LPVOCRPixelProjHorizontalAndVertical = 3 }
 This enumeration represents the grid projection when calculating the pixel feature. More...
 
enum  LPVOCRPixelValue { LPVOCRPixelGrayscale = 0 , LPVOCRPixelGrayscaleNormalized = 1 , LPVOCRPixelBinary = 2 , LPVOCRPixelFGFraction = 3 }
 This enumeration represents how the pixel values are calculated in pixel feature. More...
 
enum  LPVOCRSegmentFlags {
  LPVOCRSegmentNone = 0x00 , LPVOCRSegmentLigature = 0x01 , LPVOCRSegmentStickyLines = 0x02 , LPVOCRSegmentStrongStickyLines = 0x04 ,
  LPVOCRSegmentTrimUnknownFragments = 0x08 , LPVOCRSegmentDefault = LPVOCRSegmentLigature | LPVOCRSegmentStickyLines | LPVOCRSegmentTrimUnknownFragments , LPVOCRSegmentAll = 0xff
}
 This enumeration represents the flags to control the line and character segmentation behavior. More...
 
enum  LPVOCVFlags {
  LPVOCVShape = 0x01 , LPVOCVGrayscale = 0x02 , LPVOCVMissingPart = 0x04 , LPVOCVGrayScaleMissingPart = 0x08 ,
  LPVOCVAll = 0xff
}
 This enumeration represents the verification flags for OCV. More...
 

Detailed Description

LPV OCR(Optical Character Recognition) Library, provides classes for character segmentation, recognition and verification.

This library provides classes for OCR/OCV tasks. Machine learning technology is involved for prediction. To include the definitions of the library's classes, use the following directive:

Example Code

C++ Snippets: OCRHandWritten.cpp
C# Snippets: OCRHandWritten.cs

Enumeration Type Documentation

◆ LPVOCRDrawFlags

This enumeration represents the flags to control the OCR results' drawing behavior.

Enumerator
LPVOCRDrawString 

Draw the recognized text

LPVOCRDrawRegion 

Draw the segmentation quadrangle region of the result

LPVOCRDrawCenter 

Draw the center point of the result

LPVOCRDrawIndex 

Draw the index of the result

LPVOCRDrawByLine 

Draw the result by lines or by characters(default).

LPVOCRDrawDefault 

Default draw flags, which draws the recognized text and region by characters

LPVOCRDrawAll 

Draw the OCR result with all components

◆ LPVOCRFeatures

This enumeration represents the features available for recognition.

Enumerator
LPVOCRFeaturePixel 

Pixel feature, which divides the sample image into grids then uses the averaging grayscale or binary value in individual block as feature

LPVOCRFeatureFGFraction 

Foreground fraction feature represents percentage of the foreground pixels(inside the character) in the entire image

LPVOCRFeatureCircularity 

Circularity feature, which calculates the circularity property of the character sample's contour, similar as LPVBlobCircularity

LPVOCRFeatureConvexity 

Convexity feature, which calculates the convexity property of the character sample's contour, similar as LPVBlobCircularity

LPVOCRFeatureConvexityDefects 

Convexity defects features represents the differences between the character sample's contour and its bounding convex hull

LPVOCRFeatureOrientation 

Orientation feature, which is the sine value of the major axis of the bounding convex hull of the character sample's contour. Note: this feature is not rotation-invariant.

LPVOCRFeatureInertia 

Inertia feature, which calculates the inertia property of the character sample's contour, similar as LPVBlobInertia

LPVOCRFeatureContourCount 

Contour-count feature, which uses the count of the character sample's contours as feature, for example, character i has 2 contours.

LPVOCRFeatureHoleCount 

Hole-count feature, which uses the count of the character sample's holes as feature, for example, character 8 has 2 holes.

LPVOCRFeatureAspectRatio 

Aspect ratio feature, which calculates the aspect ratio of the character's size, similar as LPVBlobAspectRatio

LPVOCRFeatureWidth 

Width feature, which use the width of the character as feature. Note: this feature is not scale-invariant.

LPVOCRFeatureHeight 

Height feature, which use the width of the character as feature. Note: this feature is not scale-invariant.

LPVOCRFeatureZoomFactor 

Zoom factor feature, which represents the scaling factor of the sample image to the unified size. Note: this feature is not scale-invariant.

LPVOCRFeatureDefault 

Default recognition features, uses pixel and aspect ratio features

LPVOCRFeatureAll 

Use all features

◆ LPVOCRPixelProjection

This enumeration represents the grid projection when calculating the pixel feature.

Enumerator
LPVOCRPixelProjNone 

No projection, the pixel feature outputs a @math_eq{columns \times rows} feature vector

LPVOCRPixelProjHorizontal 

Horizontal projection, the pixel feature reports averaging in each row which is a @math_eq{rows} feature vector

LPVOCRPixelProjVertical 

Vertical projection, the pixel feature reports averaging in each column which is a @math_eq{columns} feature vector

LPVOCRPixelProjHorizontalAndVertical 

Horizontal and vertical projection, which is the @math_eq{columns + rows} combination of those two projection.

◆ LPVOCRPixelValue

This enumeration represents how the pixel values are calculated in pixel feature.

Enumerator
LPVOCRPixelGrayscale 

Averaging the grayscale values of the pixels in the block

LPVOCRPixelGrayscaleNormalized 

Averaging the maximum normalized grayscale values of the pixels in the block

LPVOCRPixelBinary 

Averaging the binary values in the block, foreground(pixels inside the character) is 1, background is 0

LPVOCRPixelFGFraction 

Foreground fraction of individual blocks

◆ LPVOCRSegmentFlags

This enumeration represents the flags to control the line and character segmentation behavior.

Enumerator
LPVOCRSegmentNone 

None

LPVOCRSegmentLigature 

Separate the ligatures

LPVOCRSegmentStickyLines 

Separate the lines which are sticky but the connection parts are smaller than the stroke width

LPVOCRSegmentStrongStickyLines 

Separate the lines which are strongly sticky and the connection parts are larger than the stroke width

LPVOCRSegmentTrimUnknownFragments 

Trim the unknown fragments on the head or tail of each line

LPVOCRSegmentDefault 

Default segmentation flags

LPVOCRSegmentAll 

Enable all segmentations

◆ LPVOCVFlags

This enumeration represents the verification flags for OCV.

Enumerator
LPVOCVShape 

The difference between the shape of the character and the samples

LPVOCVGrayscale 

The difference between the grayscale of the character and the samples

LPVOCVMissingPart 

The fraction of the missing part

LPVOCVGrayScaleMissingPart 

The difference between the grayscale of the character's missing part and the samples

LPVOCVAll 

Verify all parts