C# Class OcrLibrary.Helpers.Screenshot

Screenshot class to do some pre-processing before running the OCR algorithm
Inheritance: IDisposable
显示文件 Open project: sealuzh/PersonalAnalytics Class Usage Examples

Public Properties

Property Type Description
Image System.Drawing.Bitmap

Public Methods

Method Description
Crop ( ) : void

Crops the image (removes some toolbars)

Dispose ( ) : void

try to free up memory garbage collector

Resize ( ) : void

need to resize the image to 300dpi, otherwise tesseract will not be able to recognize anything TODO: often fails due to some memory problems (invalid parameter)

Save ( string name = "screenshot", bool forced = false ) : void

Helper function to save an image to the desktop

Screenshot ( Bitmap image ) : System
SubtractMedianBlur ( ) : void

Filter: Median Blur Subtract the medium blur (block size ~letter size) from the image

ToBinary ( ) : void

Filter: Threshold (Binary) Binarize the image (threshold)

ToGrayscale ( ) : void

Filter: Grayscale convert to grayscale

Method Details

Crop() public method

Crops the image (removes some toolbars)
public Crop ( ) : void
return void

Dispose() public method

try to free up memory garbage collector
public Dispose ( ) : void
return void

Resize() public method

need to resize the image to 300dpi, otherwise tesseract will not be able to recognize anything TODO: often fails due to some memory problems (invalid parameter)
public Resize ( ) : void
return void

Save() public method

Helper function to save an image to the desktop
public Save ( string name = "screenshot", bool forced = false ) : void
name string
forced bool
return void

Screenshot() public method

public Screenshot ( Bitmap image ) : System
image System.Drawing.Bitmap
return System

SubtractMedianBlur() public method

Filter: Median Blur Subtract the medium blur (block size ~letter size) from the image
public SubtractMedianBlur ( ) : void
return void

ToBinary() public method

Filter: Threshold (Binary) Binarize the image (threshold)
public ToBinary ( ) : void
return void

ToGrayscale() public method

Filter: Grayscale convert to grayscale
public ToGrayscale ( ) : void
return void

Property Details

Image public_oe property

public Bitmap,System.Drawing Image
return System.Drawing.Bitmap