public void TrackRedVedio(String videoFile, String outputFile, String targetFile) { VideoCapture capture = new VideoCapture(videoFile); Mat image = new Mat(); OpenCvSharp.CPlusPlus.Size dsize = new OpenCvSharp.CPlusPlus.Size(capture.FrameWidth, capture.FrameHeight); VideoWriter writer = new VideoWriter(outputFile, FourCC.MJPG, fps, dsize, true); int k = 0; List <string> targetList = new List <string>(); while (capture.Read(image)) { if (k % 1 == 0) { double[] target; Mat res = TrackR(image, out target); writer.Write(res); targetList.Add(k + " " + target[0] + " " + target[1]); } k++; // if (k == 100) // break; } ; writer.Release(); Console.WriteLine(k); IOTools.WriteListToTxt(targetList, targetFile); }
public void StopRecord() { isRecording = false; IOTools.WriteListToTxt(dataList, Conf.filepath + "RFData.txt"); }