C# Class Algorithmix.Utility

ファイルを表示 Open project: Algorithmix/Papyrus

Public Methods

Method Description
Absolute ( double input ) : double[]

Converts an array of positive and negative values to just their absolute values

Convolute ( double xx, double hh, int indicies ) : double[]

Performs 1D convolution an a given input array xx, with a convolution kernel hh

Distance ( Bgr color1, Bgr color2 ) : double

Determines the cartesian distance between two colors

Distance ( Color pixelA, Color pixelB ) : double

Returns the Cartesian Distance between from the first the second parameter

GetKernelIndicies ( double kernel, int startingKernelIndex ) : int[]

Generates the time indicies of kernel given the starting position

IntToBgr ( int color ) : Bgr

Takes an integer, returns a BGR color

IsBound ( Bitmap image, int xx, int yy ) : bool

Determines whether the given x and y coordinates are bound with in the given the given image

IsEqual ( Bgr color1, Bgr color2 ) : bool

Checks if two colors are equal

Max ( double array ) : int>.Tuple
Reverse ( double original ) : double[]
Reverse ( int original ) : int[]
SlopeFromPoints ( Point p1, Point p2 ) : double
Threshold ( double input, double threshold ) : double[]

Thresholds the input array by a factor of the maximum value. The Maximum value is defined as the maximum EXCLUDING the first and the Last - because the first and the last are implicit features All values that are less than factor*max(input) are set to zero, others are set to max

Method Details

Absolute() public static method

Converts an array of positive and negative values to just their absolute values
public static Absolute ( double input ) : double[]
input double values
return double[]

Convolute() public static method

Performs 1D convolution an a given input array xx, with a convolution kernel hh
public static Convolute ( double xx, double hh, int indicies ) : double[]
xx double series input
hh double convolution kernel
indicies int time index of the kernel
return double[]

Distance() public static method

Determines the cartesian distance between two colors
public static Distance ( Bgr color1, Bgr color2 ) : double
color1 Bgr First Color
color2 Bgr Second Color
return double

Distance() public static method

Returns the Cartesian Distance between from the first the second parameter
public static Distance ( Color pixelA, Color pixelB ) : double
pixelA Color Pixel of given color from
pixelB Color Pixel of given color to
return double

GetKernelIndicies() public static method

Generates the time indicies of kernel given the starting position
public static GetKernelIndicies ( double kernel, int startingKernelIndex ) : int[]
kernel double The convolution kernel
startingKernelIndex int the starting time of the kernel (-1 etc.)
return int[]

IntToBgr() public static method

Takes an integer, returns a BGR color
public static IntToBgr ( int color ) : Bgr
color int an integer between 0 and 0xFFFFFF inclusive
return Bgr

IsBound() public static method

Determines whether the given x and y coordinates are bound with in the given the given image
public static IsBound ( Bitmap image, int xx, int yy ) : bool
image System.Drawing.Bitmap Bit map image to checked
xx int X position of the pixel or Column
yy int Y position of the pixel or Row
return bool

IsEqual() public static method

Checks if two colors are equal
public static IsEqual ( Bgr color1, Bgr color2 ) : bool
color1 Bgr first color
color2 Bgr second color
return bool

Max() public static method

public static Max ( double array ) : int>.Tuple
array double
return int>.Tuple

Reverse() public static method

public static Reverse ( double original ) : double[]
original double
return double[]

Reverse() public static method

public static Reverse ( int original ) : int[]
original int
return int[]

SlopeFromPoints() public static method

public static SlopeFromPoints ( Point p1, Point p2 ) : double
p1 Point
p2 Point
return double

Threshold() public static method

Thresholds the input array by a factor of the maximum value. The Maximum value is defined as the maximum EXCLUDING the first and the Last - because the first and the last are implicit features All values that are less than factor*max(input) are set to zero, others are set to max
public static Threshold ( double input, double threshold ) : double[]
input double Array to be thresholded
threshold double Multiplier value, if this value is 0.5, then we threshold by half the max
return double[]