C# Class Algorithmix.Preprocessing.Preprocessing

Afficher le fichier Open project: Algorithmix/Papyrus

Méthodes publiques

Свойство Type Description
DOUBLE_ROTATE bool
MaskColor Color
MaxAspectRatio int
MinAspectRatio int
MinDimension int
MinTransparencyRatio double
log Logger

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

AspectRatioFilter() public static méthode

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
Résultat bool

ExtractImages() public static méthode

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
Résultat List

FindBottomTransparent() public static méthode

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
Résultat int

FindLeftTransparent() public static méthode

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
Résultat int

FindRightTransparent() public static méthode

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
Résultat int

FindTopTransparent() public static méthode

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
Résultat int

FloodFill() public static méthode

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
Résultat System.Drawing.Bitmap

LabelConnectedComponents() public static méthode

Lable Connected Components of the scan, Identify unique objects
public static LabelConnectedComponents ( Bitmap &image ) : int
image System.Drawing.Bitmap The mask
Résultat int

Orient() public static méthode

Rotates the blobs to be vertical
public static Orient ( Bitmap blob ) : Bitmap
blob System.Drawing.Bitmap image blob to orient
Résultat System.Drawing.Bitmap

Orient_Hough() public static méthode

public static Orient_Hough ( Bitmap blob ) : Bitmap
blob System.Drawing.Bitmap
Résultat System.Drawing.Bitmap

Orient_Step2() public static méthode

public static Orient_Step2 ( Bitmap blob ) : Bitmap
blob System.Drawing.Bitmap
Résultat System.Drawing.Bitmap

RotateImg() public static méthode

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
Résultat System.Drawing.Bitmap

TransparencyFilter() public static méthode

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
Résultat bool

Property Details

DOUBLE_ROTATE public_oe static_oe property

public static bool DOUBLE_ROTATE
Résultat bool

MaskColor public_oe static_oe property

public static Color MaskColor
Résultat Color

MaxAspectRatio public_oe static_oe property

public static int MaxAspectRatio
Résultat int

MinAspectRatio public_oe static_oe property

public static int MinAspectRatio
Résultat int

MinDimension public_oe static_oe property

public static int MinDimension
Résultat int

MinTransparencyRatio public_oe static_oe property

public static double MinTransparencyRatio
Résultat double

log public_oe static_oe property

public static Logger log
Résultat Logger