C# Class VietOCR.NET.Utilities.ImageHelper

Common image processing routines.
Show file Open project: nguyenq/VietOCR3.NET

Public Methods

Method Description
AutoCrop ( Bitmap source, double tolerance ) : Bitmap

Autocrops an image.

Brighten ( Image bmp, float value ) : Image

Brightens an image.

CloneImage ( Bitmap bmp ) : Bitmap

Clones a bitmap using DrawImage.

Contrast ( Image bmp, float value ) : Image

Constrasts an image. http://bobpowell.net/image_contrast.aspx

ConvertGrayscale ( Image input ) : Image

Converts an image to 8bpp indexed grayscale. http://www.codeproject.com/Articles/70442/C-RGB-to-Palette-Based-bit-Greyscale-Bitmap-Clas

ConvertMonochrome ( Bitmap img ) : Bitmap

Converts an image to monochrome. http://bobpowell.net/onebit.aspx

Crop ( Image image, Rectangle cropArea ) : Image

Crops an image.

GaussianBlur ( Bitmap sourceBitmap ) : Bitmap
GetClipboardImage ( ) : Image

Gets an Image from Clipboard.

InvertColor ( Bitmap img ) : Bitmap

Inverts color of an image. http://mariusbancila.ro/blog/2009/11/13/using-colormatrix-for-creating-negative-image/

RemoveLines ( Bitmap image ) : Bitmap

Remove lines or borders using Leptonica library.

Rescale ( Image image, int dpiX, int dpiY ) : Image

Rescales an image.

Rotate ( Image image, double angle ) : Bitmap

Rotates an image.

Sharpen ( Bitmap image ) : Bitmap

Sharpens an image. http://stackoverflow.com/questions/903632/sharpen-on-a-bitmap-using-c-sharp

Protected Methods

Method Description
SetIndexedPixel ( int x, int y, BitmapData bmd, bool pixel ) : void

Private Methods

Method Description
ConvolutionFilter ( Bitmap sourceBitmap, double filterMatrix, double factor = 1, int bias ) : Bitmap

http://softwarebydefault.com/2013/06/09/image-blur-filters/

colorWithinTolerance ( Color a, Color b, double tolerance ) : bool

Determines color distance. http://stackoverflow.com/questions/10678015/how-to-auto-crop-an-image-white-border-in-java

Method Details

AutoCrop() public static method

Autocrops an image.
public static AutoCrop ( Bitmap source, double tolerance ) : Bitmap
source System.Drawing.Bitmap
tolerance double range from 0.0 to 1.0
return System.Drawing.Bitmap

Brighten() public static method

Brightens an image.
public static Brighten ( Image bmp, float value ) : Image
bmp Image
value float
return Image

CloneImage() public static method

Clones a bitmap using DrawImage.
public static CloneImage ( Bitmap bmp ) : Bitmap
bmp System.Drawing.Bitmap
return System.Drawing.Bitmap

Contrast() public static method

Constrasts an image. http://bobpowell.net/image_contrast.aspx
public static Contrast ( Image bmp, float value ) : Image
bmp Image
value float
return Image

ConvertGrayscale() public static method

Converts an image to 8bpp indexed grayscale. http://www.codeproject.com/Articles/70442/C-RGB-to-Palette-Based-bit-Greyscale-Bitmap-Clas
public static ConvertGrayscale ( Image input ) : Image
input Image
return Image

ConvertMonochrome() public static method

Converts an image to monochrome. http://bobpowell.net/onebit.aspx
public static ConvertMonochrome ( Bitmap img ) : Bitmap
img System.Drawing.Bitmap
return System.Drawing.Bitmap

Crop() public static method

Crops an image.
public static Crop ( Image image, Rectangle cropArea ) : Image
image Image
cropArea System.Drawing.Rectangle
return Image

GaussianBlur() public static method

public static GaussianBlur ( Bitmap sourceBitmap ) : Bitmap
sourceBitmap System.Drawing.Bitmap
return System.Drawing.Bitmap

GetClipboardImage() public static method

Gets an Image from Clipboard.
public static GetClipboardImage ( ) : Image
return Image

InvertColor() public static method

Inverts color of an image. http://mariusbancila.ro/blog/2009/11/13/using-colormatrix-for-creating-negative-image/
public static InvertColor ( Bitmap img ) : Bitmap
img System.Drawing.Bitmap
return System.Drawing.Bitmap

RemoveLines() public static method

Remove lines or borders using Leptonica library.
public static RemoveLines ( Bitmap image ) : Bitmap
image System.Drawing.Bitmap
return System.Drawing.Bitmap

Rescale() public static method

Rescales an image.
public static Rescale ( Image image, int dpiX, int dpiY ) : Image
image Image
dpiX int
dpiY int
return Image

Rotate() public static method

Rotates an image.
public static Rotate ( Image image, double angle ) : Bitmap
image Image
angle double
return System.Drawing.Bitmap

SetIndexedPixel() protected static method

protected static SetIndexedPixel ( int x, int y, BitmapData bmd, bool pixel ) : void
x int
y int
bmd System.Drawing.Imaging.BitmapData
pixel bool
return void

Sharpen() public static method

Sharpens an image. http://stackoverflow.com/questions/903632/sharpen-on-a-bitmap-using-c-sharp
public static Sharpen ( Bitmap image ) : Bitmap
image System.Drawing.Bitmap
return System.Drawing.Bitmap