C# Класс Algorithmix.Forensics.OCR

Наследование: DisposableObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Charactors ( ) : Tesseract.Charactor[]

Returns an array of Tesseract Charactors after running the Scan Method

Cost ( Emgu.CV.OCR.Tesseract chars ) : long

Calculates the cost by summing the unique cost of each word

IsEmpty ( Shred shreds ) : void

Determines runs OCR and determines if a shred is empty or not

OCR ( Accuracy accuracy = Accuracy.High, string language = "eng", bool enableTimer = false ) : System

Initialize a new OCR Object. This object is a wrapper for the Emgu Tesseract Wrapper to give a level of abstraction necessary for scanning shreds

OverallCost ( ) : long

Returns the of cos

ParallelDetectOrientation ( Bitmap regs, Bitmap revs, Accuracy mode = Accuracy.High, string lang = "eng", bool enableTimer = false ) : Tuple[]

Parallelized OCR Orientation Confidence Detector, this method will run ocr on an image and its corresponding reversed images and return the confidence and both the ocrdata objects

ParallelRecognize ( IEnumerable images, int length, Accuracy mode = Accuracy.High, string lang = "eng", bool enableTimer = false ) : OcrData[]

Parallelized Recognize Function takes in a list or array of images, A specified length and for each image returns an OCRData object

Preprocess ( byte>.Image image ) : byte>.Image

OCR Preprocessing, currently this involves binary threholding a gray scaled image using the Otsu Method

Recognize ( Bitmap original, Accuracy mode = Accuracy.High, string lang = "eng", bool enableTimer = false ) : OcrData

Execute OCR on a given image, this static member will process the image, Safely open, execute and dispose a Tesseract Object and store the result in a new OcrData object.

Scan ( byte>.Image image ) : string

Given a Color image, it is coverted to grayscale OCR-ed and returned

Scan ( byte>.Image image ) : string

Invokes Tesseract OCR Recognize on given image Stores the resulting data in the Text,Confidence and ScanTime data members

ShredOcr ( Shred shreds, string lang = "eng" ) : void

Given an array of shreds, we OCR them all and save results to the shred object

StripNewLine ( string text ) : string
Text ( ) : string

Getter for the text generated after running the Scan Method

Защищенные методы

Метод Описание
DisposeObject ( ) : void

Disposes all the necessary objects

Приватные методы

Метод Описание
Elapsed ( ) : long

Retrieve the time elapsed from the diagnostics Timer

Start ( ) : bool

Explicitly starts the diagnostics timer

Stop ( ) : void

Stops the diagnostics timer

Описание методов

Charactors() публичный Метод

Returns an array of Tesseract Charactors after running the Scan Method
public Charactors ( ) : Tesseract.Charactor[]
Результат Tesseract.Charactor[]

Cost() публичный статический Метод

Calculates the cost by summing the unique cost of each word
public static Cost ( Emgu.CV.OCR.Tesseract chars ) : long
chars Emgu.CV.OCR.Tesseract Tesseract OCR Charactor results
Результат long

DisposeObject() защищенный Метод

Disposes all the necessary objects
protected DisposeObject ( ) : void
Результат void

IsEmpty() публичный статический Метод

Determines runs OCR and determines if a shred is empty or not
public static IsEmpty ( Shred shreds ) : void
shreds Shred A list of Shred Objects
Результат void

OCR() публичный Метод

Initialize a new OCR Object. This object is a wrapper for the Emgu Tesseract Wrapper to give a level of abstraction necessary for scanning shreds
public OCR ( Accuracy accuracy = Accuracy.High, string language = "eng", bool enableTimer = false ) : System
accuracy Accuracy Desired Accuracy setting
language string Language of text on image used for OCR model
enableTimer bool Set enable Timer to true to measure scan time for diagnostic purposes
Результат System

OverallCost() публичный Метод

Returns the of cos
public OverallCost ( ) : long
Результат long

ParallelDetectOrientation() публичный статический Метод

Parallelized OCR Orientation Confidence Detector, this method will run ocr on an image and its corresponding reversed images and return the confidence and both the ocrdata objects
public static ParallelDetectOrientation ( Bitmap regs, Bitmap revs, Accuracy mode = Accuracy.High, string lang = "eng", bool enableTimer = false ) : Tuple[]
regs System.Drawing.Bitmap Images with default regular orientation
revs System.Drawing.Bitmap Images with reversed orientation to default
mode Accuracy OCR accuracy mode
lang string OCR languages
enableTimer bool Enable timer for diagnostic purposes
Результат Tuple[]

ParallelRecognize() публичный статический Метод

Parallelized Recognize Function takes in a list or array of images, A specified length and for each image returns an OCRData object
public static ParallelRecognize ( IEnumerable images, int length, Accuracy mode = Accuracy.High, string lang = "eng", bool enableTimer = false ) : OcrData[]
images IEnumerable Array or List of Bitmaps
length int Number of items to be Recognized from the array
mode Accuracy Accuracy Mode
lang string Desired OCR Language
enableTimer bool Enables OCR Scan Timer if true
Результат OcrData[]

Preprocess() публичный Метод

OCR Preprocessing, currently this involves binary threholding a gray scaled image using the Otsu Method
public Preprocess ( byte>.Image image ) : byte>.Image
image byte>.Image Image to be preprocessed
Результат byte>.Image

Recognize() публичный статический Метод

Execute OCR on a given image, this static member will process the image, Safely open, execute and dispose a Tesseract Object and store the result in a new OcrData object.
public static Recognize ( Bitmap original, Accuracy mode = Accuracy.High, string lang = "eng", bool enableTimer = false ) : OcrData
original System.Drawing.Bitmap Image to be OCR-ed
mode Accuracy Accuracy setting
lang string Language of text for OCR Language Model
enableTimer bool Measure the Scantime for Diagnostic purposes
Результат OcrData

Scan() публичный Метод

Given a Color image, it is coverted to grayscale OCR-ed and returned
public Scan ( byte>.Image image ) : string
image byte>.Image Source Image to be OCR-ed
Результат string

Scan() публичный Метод

Invokes Tesseract OCR Recognize on given image Stores the resulting data in the Text,Confidence and ScanTime data members
public Scan ( byte>.Image image ) : string
image byte>.Image Source Image to be OCR-ed
Результат string

ShredOcr() публичный статический Метод

Given an array of shreds, we OCR them all and save results to the shred object
public static ShredOcr ( Shred shreds, string lang = "eng" ) : void
shreds Shred Array of initialized shred objects
lang string Desired OCR langauge
Результат void

StripNewLine() публичный статический Метод

public static StripNewLine ( string text ) : string
text string
Результат string

Text() публичный Метод

Getter for the text generated after running the Scan Method
public Text ( ) : string
Результат string