private Matrix[] LoadClip(string path)
{
FrameGrabber frames = new FrameGrabber(path); //grab frames from video at the specified path
Matrix[] M; //Array of 2D matrices built from the frames in the video loaded. Essentially a 3D matrix
int count = frames.FrameCount; //number of frames in the video
Matrix fixedFrame = FixFrame((Bitmap)frames.GetFrame(0)); //fix the first frame. Used for initialization of M
M = new Matrix[count];
for (int i = 0; i < count; i++) //call FixFrame on each frame in the video and fill the matrix with these frames
{
fixedFrame = FixFrame((Bitmap)frames.GetFrame(i));
M[i] = fixedFrame;
}
return M;
}