Beispiel #1
0
        private void CloseVideoWriters()
        {
            lock (lockObj)
            {
                if (videoWriterKinectColor != null && videoWriterKinectColor.IsOpen)
                {
                    videoWriterKinectColor.Close();
                    filesLastRecording.Add(currFilePathBase + "_Color.avi");
                }
                if (videoWriterKinectDepth != null && videoWriterKinectDepth.IsOpen)
                {
                    videoWriterKinectDepth.Close();
                    //videoWriterKinectDepthTmp.Close();
                    filesLastRecording.Add(currFilePathBase + "_Depth.avi");
                }
                if (bufferBody != null)
                {
                    float[][] bodyData = bufferBody.ToArray();
                    csmatio.types.MLSingle       bodyDataMat    = new csmatio.types.MLSingle("bodyData", bodyData);
                    List <csmatio.types.MLArray> lstBodyDataMat = new List <csmatio.types.MLArray>();
                    lstBodyDataMat.Add(bodyDataMat);
                    csmatio.io.MatFileWriter writer = new csmatio.io.MatFileWriter(currFilePathBase + "_Body.mat", lstBodyDataMat, true);
                    bufferBody = null;      // clear memory
                    filesLastRecording.Add(currFilePathBase + "_Body.mat");
                }

                if (videoWriterPS3Eye != null && videoWriterPS3Eye.IsOpen)
                {
                    videoWriterPS3Eye.Close();
                    filesLastRecording.Add(currFilePathBase + "_PS3Eye.avi");
                }
            }
        }
Beispiel #2
0
        public void StopAccRecording()
        {
            isRecording = false;

            if (bufferAcc.Count > 0)
            {
                int[][] accData = bufferAcc.ToArray();

                csmatio.types.MLInt32        accDataMat   = new csmatio.types.MLInt32("accData", accData);
                List <csmatio.types.MLArray> lstAccDatMat = new List <csmatio.types.MLArray>();
                lstAccDatMat.Add(accDataMat);
                csmatio.io.MatFileWriter writer = new csmatio.io.MatFileWriter(filePathAcc, lstAccDatMat, true);
                fileLastRecording = filePathAcc;

                bufferAcc.Clear();
            }
        }
        private void CloseVideoWriters()
        {
            lock (lockObj)
            {
                if (videoWriterKinectColor != null && videoWriterKinectColor.IsOpen)
                {
                    videoWriterKinectColor.Close();
                    filesLastRecording.Add(currFilePathBase + "_Color.avi");
                }
                if (videoWriterKinectDepth != null && videoWriterKinectDepth.IsOpen)
                {
                    videoWriterKinectDepth.Close();
                    //videoWriterKinectDepthTmp.Close();
                    filesLastRecording.Add(currFilePathBase + "_Depth.avi");
                }
                if (bufferBody != null)
                {
                    float[][] bodyData = bufferBody.ToArray();
                    csmatio.types.MLSingle bodyDataMat = new csmatio.types.MLSingle("bodyData", bodyData);
                    List<csmatio.types.MLArray> lstBodyDataMat = new List<csmatio.types.MLArray>();
                    lstBodyDataMat.Add(bodyDataMat);
                    csmatio.io.MatFileWriter writer = new csmatio.io.MatFileWriter(currFilePathBase + "_Body.mat", lstBodyDataMat, true);
                    bufferBody = null;      // clear memory
                    filesLastRecording.Add(currFilePathBase + "_Body.mat");
                }

                if (videoWriterPS3Eye != null && videoWriterPS3Eye.IsOpen)
                {
                    videoWriterPS3Eye.Close();
                    filesLastRecording.Add(currFilePathBase + "_PS3Eye.avi");
                }
            }
        }
        public void StopAccRecording()
        {
            isRecording = false;

            if (bufferAcc.Count > 0)
            {
                int[][] accData = bufferAcc.ToArray();

                csmatio.types.MLInt32 accDataMat = new csmatio.types.MLInt32("accData", accData);
                List<csmatio.types.MLArray> lstAccDatMat = new List<csmatio.types.MLArray>();
                lstAccDatMat.Add(accDataMat);
                csmatio.io.MatFileWriter writer = new csmatio.io.MatFileWriter(filePathAcc, lstAccDatMat, true);
                fileLastRecording = filePathAcc;

                bufferAcc.Clear();
            }
        }