C# Класс Algorithmix.Preprocessing.Preprocessing

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
DOUBLE_ROTATE bool
MaskColor Color
MaxAspectRatio int
MinAspectRatio int
MinDimension int
MinTransparencyRatio double
log Logger

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

Метод Описание
AspectRatioFilter ( Bitmap shred ) : bool

Simple helper function test to filter extracted images based on their aspect ratio height/width

ExtractImages ( Bitmap Source, Bitmap Mask ) : List

Extracts all objects from the source image

FindBottomTransparent ( Byte>.Image myImg ) : int

Find the bottow row with non-transparent pixels

FindLeftTransparent ( Byte>.Image myImg ) : int

Find the leftmost column with non-transparent pixels

FindRightTransparent ( Byte>.Image myImg ) : int

Find the rightmost column with non-transparent pixels

FindTopTransparent ( Byte>.Image myImg ) : int

Find the top row of non-transparent pixels

FloodFill ( Bitmap image, int xpixel, int ypixel, double threshold, Bgr myColor ) : Bitmap

Flood fill in a BFS manner, so as not to overwhelm the stack

LabelConnectedComponents ( Bitmap &image ) : int

Lable Connected Components of the scan, Identify unique objects

Orient ( Bitmap blob ) : Bitmap

Rotates the blobs to be vertical

Orient_Hough ( Bitmap blob ) : Bitmap
Orient_Step2 ( Bitmap blob ) : Bitmap
RotateImg ( Bitmap bmp, float angle, Color bkColor ) : Bitmap

Rotate the image by angle degrees, with bkColor as new background Uses some magic with the translatetransform and pixel2d :P WOW!

TransparencyFilter ( Bitmap shred ) : bool

Simple helper function that will test to make sure that more than a certain percentage of the shred is non a transparent color.

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

Метод Описание
ApplyBlobExtractor ( Bitmap Mask, Bitmap Source ) : Bitmap>>.List

Applies the blob extraction feature of Aforge

ExtractSingleImage ( Bitmap TheBlob, Bitmap Source ) : Bitmap

Extracts a single object given the corresponding mask and rectangle

FilterBlob ( Bitmap mask ) : bool

Simple helper function to filter blobs. Currently works solely on size.

GetCropZone ( Byte>.Image myImg ) : Rectangle

Simple helper function for cropping the image after rotation

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

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

Simple helper function test to filter extracted images based on their aspect ratio height/width
public static AspectRatioFilter ( Bitmap shred ) : bool
shred System.Drawing.Bitmap the extracted shred
Результат bool

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

Extracts all objects from the source image
public static ExtractImages ( Bitmap Source, Bitmap Mask ) : List
Source System.Drawing.Bitmap the scan of all the shreds
Mask System.Drawing.Bitmap
Результат List

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

Find the bottow row with non-transparent pixels
public static FindBottomTransparent ( Byte>.Image myImg ) : int
myImg Byte>.Image the image to find the last row with non-transparent pixels
Результат int

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

Find the leftmost column with non-transparent pixels
public static FindLeftTransparent ( Byte>.Image myImg ) : int
myImg Byte>.Image the image to find the first column with non-transparent pixels
Результат int

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

Find the rightmost column with non-transparent pixels
public static FindRightTransparent ( Byte>.Image myImg ) : int
myImg Byte>.Image the image to find the last column with non-transparent pixels
Результат int

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

Find the top row of non-transparent pixels
public static FindTopTransparent ( Byte>.Image myImg ) : int
myImg Byte>.Image image to find top non-transparent pixels
Результат int

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

Flood fill in a BFS manner, so as not to overwhelm the stack
public static FloodFill ( Bitmap image, int xpixel, int ypixel, double threshold, Bgr myColor ) : Bitmap
image System.Drawing.Bitmap the image we wish to fill on
xpixel int the x pixel to sample from
ypixel int the y pixel to sample from
threshold double the threshold of difference
myColor Bgr
Результат System.Drawing.Bitmap

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

Lable Connected Components of the scan, Identify unique objects
public static LabelConnectedComponents ( Bitmap &image ) : int
image System.Drawing.Bitmap The mask
Результат int

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

Rotates the blobs to be vertical
public static Orient ( Bitmap blob ) : Bitmap
blob System.Drawing.Bitmap image blob to orient
Результат System.Drawing.Bitmap

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

public static Orient_Hough ( Bitmap blob ) : Bitmap
blob System.Drawing.Bitmap
Результат System.Drawing.Bitmap

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

public static Orient_Step2 ( Bitmap blob ) : Bitmap
blob System.Drawing.Bitmap
Результат System.Drawing.Bitmap

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

Rotate the image by angle degrees, with bkColor as new background Uses some magic with the translatetransform and pixel2d :P WOW!
public static RotateImg ( Bitmap bmp, float angle, Color bkColor ) : Bitmap
bmp System.Drawing.Bitmap the image to be rotated
angle float the angle to rotate by
bkColor Color background color for new background pixels
Результат System.Drawing.Bitmap

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

Simple helper function that will test to make sure that more than a certain percentage of the shred is non a transparent color.
public static TransparencyFilter ( Bitmap shred ) : bool
shred System.Drawing.Bitmap
Результат bool

Описание свойств

DOUBLE_ROTATE публичное статическое свойство

public static bool DOUBLE_ROTATE
Результат bool

MaskColor публичное статическое свойство

public static Color MaskColor
Результат Color

MaxAspectRatio публичное статическое свойство

public static int MaxAspectRatio
Результат int

MinAspectRatio публичное статическое свойство

public static int MinAspectRatio
Результат int

MinDimension публичное статическое свойство

public static int MinDimension
Результат int

MinTransparencyRatio публичное статическое свойство

public static double MinTransparencyRatio
Результат double

log публичное статическое свойство

public static Logger log
Результат Logger