C# Class Algorithmix.Shred

Inheritance: INode
Show file Open project: Algorithmix/Papyrus Class Usage Examples

Public Properties

Property Type Description
BUFFER int
Chamfer List
Convolution List
ConvolutionKernel double[]
Filepath string
Id long
Luminousity List
OCR_EMPTY_THRESHOLD int
Offsets List
SAMPLE_SIZE int
Sparsity List
THRESHOLD double
Thresholded List

Public Methods

Method Description
AddOcrData ( OcrData results ) : void

Standard Add OCR will filter a shred if it is empty

AddOcrData ( OcrData results, long orienationConfidence, bool isUpsideDown ) : void

Set OCR Results, and Orientation Confidence on an Object

Factory ( List files, bool runOcr = true ) : List
Factory ( string prefix, string directory, bool runOcr = true ) : List

Factory Method loads a bunch of shreds from a directory given a prefix to match

Flatten ( List list ) : void
GetBitmap ( Orientation orientation = Orientation.Regular ) : Bitmap

Load a bitmap image of the shred with a specific orientation

GetChamfer ( Direction direction, Orientation orientation = Orientation.Regular ) : int[]
GetConvolution ( Direction direction, Orientation orientation = Orientation.Regular ) : double[]
GetLuminousity ( Direction direction, Orientation orientation = Orientation.Regular ) : double[]
GetSparsity ( Direction direction, Orientation orientation = Orientation.Regular ) : long
GetThresholded ( Direction direction, Orientation orientation = Orientation.Regular ) : double[]
IsLeaf ( ) : bool
Leaf ( ) : Shred
Left ( ) : INode
LeftEdge ( ) : Edge
LeftShred ( ) : Shred
Load ( string filepath ) : Shred

Deserialize binary shred on disk into memory

MatchData ( ) : MatchData
Mirror ( ) : void
OrphanChildren ( ) : void
Parent ( ) : INode
Parent ( INode parent ) : void
Right ( ) : INode
RightEdge ( ) : Edge
RightShred ( ) : Shred
Root ( ) : INode
Root ( INode representative ) : void
Save ( Shred shred, string filename ) : void

Serialize Shred to binary file on disk

Shred ( string filepath, bool ignoreTopBottom = true ) : System

Create a shred object given a filepath to a bitmap image

Size ( ) : int
ToJson ( JsonTextWriter writer ) : void
VisualizeChamfers ( Direction direction, Orientation orientation = Orientation.Regular ) : void

Plots a trace of the Chamfering

VisualizeLuminousity ( Direction direction, Orientation orientation = Orientation.Regular ) : void

Plots a trace of the Luminousity

VisualizeThresholded ( Direction direction, Orientation orientation = Orientation.Regular ) : void

Plots a trace of the threshold

Private Methods

Method Description
Create ( string file, bool ignoreTopAndBottom = true ) : Shred
Index ( Direction direction, Orientation orientation ) : int

Helper for converting Orientation + Direction into an index number

InitializeINode ( ) : void
WriteLeaf ( Shred shred, JsonTextWriter writer ) : void

Method Details

AddOcrData() public method

Standard Add OCR will filter a shred if it is empty
public AddOcrData ( OcrData results ) : void
results OcrData Shreds Ocr Data
return void

AddOcrData() public method

Set OCR Results, and Orientation Confidence on an Object
public AddOcrData ( OcrData results, long orienationConfidence, bool isUpsideDown ) : void
results OcrData The Orientation Results from the OCR execution
orienationConfidence long Absolute Orientation Confidence
isUpsideDown bool Indicates if True orientation is different than the current
return void

Factory() public static method

public static Factory ( List files, bool runOcr = true ) : List
files List
runOcr bool
return List

Factory() public static method

Factory Method loads a bunch of shreds from a directory given a prefix to match
public static Factory ( string prefix, string directory, bool runOcr = true ) : List
prefix string prefix to match within shred folder
directory string path where folder is located
runOcr bool Run Optical Character Recognition for Page Text and Orientation Detection
return List

Flatten() public method

public Flatten ( List list ) : void
list List
return void

GetBitmap() public method

Load a bitmap image of the shred with a specific orientation
public GetBitmap ( Orientation orientation = Orientation.Regular ) : Bitmap
orientation Orientation Specific Orientation, regular or reversed, default is regular
return System.Drawing.Bitmap

GetChamfer() public method

public GetChamfer ( Direction direction, Orientation orientation = Orientation.Regular ) : int[]
direction Direction
orientation Orientation
return int[]

GetConvolution() public method

public GetConvolution ( Direction direction, Orientation orientation = Orientation.Regular ) : double[]
direction Direction
orientation Orientation
return double[]

GetLuminousity() public method

public GetLuminousity ( Direction direction, Orientation orientation = Orientation.Regular ) : double[]
direction Direction
orientation Orientation
return double[]

GetSparsity() public method

public GetSparsity ( Direction direction, Orientation orientation = Orientation.Regular ) : long
direction Direction
orientation Orientation
return long

GetThresholded() public method

public GetThresholded ( Direction direction, Orientation orientation = Orientation.Regular ) : double[]
direction Direction
orientation Orientation
return double[]

IsLeaf() public method

public IsLeaf ( ) : bool
return bool

Leaf() public method

public Leaf ( ) : Shred
return Shred

Left() public method

public Left ( ) : INode
return INode

LeftEdge() public method

public LeftEdge ( ) : Edge
return Edge

LeftShred() public method

public LeftShred ( ) : Shred
return Shred

Load() public static method

Deserialize binary shred on disk into memory
public static Load ( string filepath ) : Shred
filepath string filepath of the deserialized shred
return Shred

MatchData() public method

public MatchData ( ) : MatchData
return MatchData

Mirror() public method

public Mirror ( ) : void
return void

OrphanChildren() public method

public OrphanChildren ( ) : void
return void

Parent() public method

public Parent ( ) : INode
return INode

Parent() public method

public Parent ( INode parent ) : void
parent INode
return void

Right() public method

public Right ( ) : INode
return INode

RightEdge() public method

public RightEdge ( ) : Edge
return Edge

RightShred() public method

public RightShred ( ) : Shred
return Shred

Root() public method

public Root ( ) : INode
return INode

Root() public method

public Root ( INode representative ) : void
representative INode
return void

Save() public static method

Serialize Shred to binary file on disk
public static Save ( Shred shred, string filename ) : void
shred Shred Shred Object
filename string Destination File path
return void

Shred() public method

Create a shred object given a filepath to a bitmap image
public Shred ( string filepath, bool ignoreTopBottom = true ) : System
filepath string destination path of the shred image
ignoreTopBottom bool Default is true, set to false to scan top and bottom aswell
return System

Size() public method

public Size ( ) : int
return int

ToJson() public method

public ToJson ( JsonTextWriter writer ) : void
writer JsonTextWriter
return void

VisualizeChamfers() public method

Plots a trace of the Chamfering
public VisualizeChamfers ( Direction direction, Orientation orientation = Orientation.Regular ) : void
direction Direction Direction to be traced
orientation Orientation Orientation to be traced
return void

VisualizeLuminousity() public method

Plots a trace of the Luminousity
public VisualizeLuminousity ( Direction direction, Orientation orientation = Orientation.Regular ) : void
direction Direction Direction to be traced
orientation Orientation Orientation to be traced
return void

VisualizeThresholded() public method

Plots a trace of the threshold
public VisualizeThresholded ( Direction direction, Orientation orientation = Orientation.Regular ) : void
direction Direction Direction to be traced
orientation Orientation Orientation to be traced
return void

Property Details

BUFFER public static property

public static int BUFFER
return int

Chamfer public property

public List Chamfer
return List

Convolution public property

public List Convolution
return List

ConvolutionKernel public static property

public static double[] ConvolutionKernel
return double[]

Filepath public property

public string Filepath
return string

Id public property

public long Id
return long

Luminousity public property

public List Luminousity
return List

OCR_EMPTY_THRESHOLD public static property

public static int OCR_EMPTY_THRESHOLD
return int

Offsets public property

public List Offsets
return List

SAMPLE_SIZE public static property

public static int SAMPLE_SIZE
return int

Sparsity public property

public List Sparsity
return List

THRESHOLD public static property

public static double THRESHOLD
return double

Thresholded public property

public List Thresholded
return List