C# Класс Action_Recognition_2._0.FeatureExtractor2D

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

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

Метод Описание
ExtractTrainingData ( string vidDir, string vidFileString, bool allFiles ) : void
FeatureExtractor2D ( ) : System
FeatureExtractor2D ( string path, int spSize, int tmpSize, int patches ) : System
SetProperties ( int spSize, int tmpSize, int patches ) : void

Function to change SpatialSize, TemporalSize, and NumPatches with a single call for the sake of convenience

ToMatrix ( Bitmap bm ) : Matrix

Copies the data from a Bitmap object into a Weka Matrix for purposes of matrix manipulation. Future consideration: Bitmap class's LockBits() function offers better performance for large-scale changes that SetPixel()

rgb2gray ( Bitmap bm ) : Bitmap

Row-wise iteration through the Bitmap, get the color from each pixel and change to grayscale. Refer to this link for explanation of conversion http://stackoverflow.com/questions/687261/converting-rgb-to-grayscale-intensity NOTE: In the future, consider converting Bitmap to Matrix here to set pixel value to integer instead of Color, essentially skipping the Color.FromArgb step

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

Метод Описание
FixFrame ( Bitmap map ) : Matrix

Grayscale and crop frames

GetBlock ( Matrix M, int xPos, int yPos, int tPos ) : Matrix[]

LoadClip ( string path ) : Matrix[]

Open the specified video and get the individual frames. Construct a 3D Matrix from the 2D matrices returned by the FixFrame function.

Reshape ( Matrix block, bool rowPacked ) : double[]

Takes a 3D Matrix (2D Matrix array) and copies the data into a single dimension vector (double array). Can be specified to copy data row - wise or column -wise from the input Matrix using the second parameter Functions differently from the Matlab version of Reshape in that this version assumes that the input Matrix will be reshaped into a single dimension. This functionality works for our purposes.

SetColumn ( Matrix m, int col, double vals ) : void

Sets a column of Matrix m specified by the index col to the values contained in the double array vals. Row dimension of Matrix m must match the length of array vals. Throws an exception if these dimensions do not match

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

ExtractTrainingData() публичный Метод

public ExtractTrainingData ( string vidDir, string vidFileString, bool allFiles ) : void
vidDir string
vidFileString string
allFiles bool
Результат void

FeatureExtractor2D() публичный Метод

public FeatureExtractor2D ( ) : System
Результат System

FeatureExtractor2D() публичный Метод

public FeatureExtractor2D ( string path, int spSize, int tmpSize, int patches ) : System
path string
spSize int
tmpSize int
patches int
Результат System

SetProperties() публичный Метод

Function to change SpatialSize, TemporalSize, and NumPatches with a single call for the sake of convenience
public SetProperties ( int spSize, int tmpSize, int patches ) : void
spSize int
tmpSize int
patches int
Результат void

ToMatrix() публичный Метод

Copies the data from a Bitmap object into a Weka Matrix for purposes of matrix manipulation. Future consideration: Bitmap class's LockBits() function offers better performance for large-scale changes that SetPixel()
public ToMatrix ( Bitmap bm ) : Matrix
bm System.Drawing.Bitmap
Результат Matrix

rgb2gray() публичный Метод

Row-wise iteration through the Bitmap, get the color from each pixel and change to grayscale. Refer to this link for explanation of conversion http://stackoverflow.com/questions/687261/converting-rgb-to-grayscale-intensity NOTE: In the future, consider converting Bitmap to Matrix here to set pixel value to integer instead of Color, essentially skipping the Color.FromArgb step
public rgb2gray ( Bitmap bm ) : Bitmap
bm System.Drawing.Bitmap
Результат System.Drawing.Bitmap