Action_Recognition_2._0.FeatureExtractor2D.LoadClip C# (CSharp) Method

LoadClip() private method

Open the specified video and get the individual frames. Construct a 3D Matrix from the 2D matrices returned by the FixFrame function.
private LoadClip ( string path ) : Matrix[]
path string
return Matrix[]
        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;
        }