unsafe private void timer1_Tick(object sender, EventArgs e) { Bitmap back = new Bitmap(640, 480, 3 * 640, System.Drawing.Imaging.PixelFormat.Format24bppRgb, new IntPtr(DSB.DSBridge.getCachedRGB())); prevBox.Image = back; toolStripStatusLabel1.Text = "RGBFrame: " + DSB.DSBridge.getRGBCount() + " DepthFrame: " + DSB.DSBridge.getDepthCount(); int val = DSBridge.getCaptureProgress(); if (val >= 0) { progressBar1.Value = val; } else { progressBar1.Value = 0; if (val == -1) { post("Capture finished"); DSBridge.resetVideoCapture(); dismissButton.Enabled = true; savePCDButton.Enabled = true; } } }
private void savePCDButton_Click(object sender, EventArgs e) { String n_dir = Directory.GetCurrentDirectory() + @"\datasets\p" + person.Value + @"\g" + gesture.Value + @"\uncropped\"; String x_dir = Directory.GetCurrentDirectory() + @"\datasets\p" + person.Value + @"\g" + gesture.Value + @"\cropped\"; if (!Directory.Exists(n_dir)) { Directory.CreateDirectory(n_dir); Directory.CreateDirectory(x_dir); } DSBridge.saveToPCDs((int)person.Value, (int)gesture.Value); dismissButton.Enabled = false; savePCDButton.Enabled = false; capture.Enabled = true; string str = person.Value.ToString(); string str2 = gesture.Value.ToString(); string str3 = frameCountPicker.Value.ToString(); this.gesture.Value++; Process pc2 = new Process(); pc2.StartInfo.FileName = "pc2.exe"; pc2.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; pc2.StartInfo.Arguments = n_dir.Replace("\\", "\\\\") + " " + str + " " + str2 + " " + str3 + " " + x_dir.Replace("\\", "\\\\"); pc2.Start(); // pc2.WaitForExit(); // pc2.CloseMainWindow(); // pc2.Close(); this.timer2.Start(); }