private void show_Click(object sender, EventArgs e)
        {
            //create forms and show
            comboBox_showcameras.Items.Clear();
            int t_count = 0;

            foreach (ListViewItem item in listView_CameraControl.Items)
            {
                if (item.Checked)
                {
                    FormCameras t_cameraForm = new FormCameras();
                    t_cameraForm.SetDeviceMonikerString(videoDevices[item.Index].MonikerString);
                    t_cameraForm.m_index = item.Index;

                    t_cameraForm.Show();
                    m_cameras.Add(t_cameraForm);

                    //add cameras into the comboBox_showcameras

                    comboBox_showcameras.Items.Add(item.SubItems[1].Text + "_" + item.Index);
                    comboBox_showcameras.SelectedIndex = 0;
                    t_count++;
                }
            }
            if (t_count > 0)
            {
                timer1.Enabled = true;
                //_cascadeClassifier = new CascadeClassifier(@".\\haarcascades\\" + "haarcascade_frontalface_alt2.xml");
                _cascadeClassifier = new CascadeClassifier(@"..\data\haarcascades\haarcascade_frontalface_alt2.xml");
            }
        }
Exemple #2
0
        private void show_Click(object sender, EventArgs e)
        {
            //create forms and show
            comboBox_showcameras.Items.Clear();
            int t_count = 0;

            foreach (ListViewItem item in listView_CameraControl.Items)
            {
                if (item.Checked)
                {
                    //if normal then show normal,
                    //else show FlirFileFormat
                    if (item.SubItems[1].Text.Contains("FLIR") && checkBox_thermalapi.Checked)//&& checkBox_thermalapi.Checked
                    {
                        MainWindow t_cameraForm = new MainWindow();
                        t_cameraForm.m_index = item.Index;

                        t_cameraForm.Show();
                        m_thermalcams.Add(t_cameraForm);
                    }
                    else
                    {
                        FormCameras t_cameraForm = new FormCameras();
                        t_cameraForm.SetDeviceMonikerString(videoDevices[item.Index].MonikerString);
                        t_cameraForm.m_index = item.Index;

                        t_cameraForm.Show();
                        m_cameras.Add(t_cameraForm);
                        comboBox_showcameras.Items.Add(item.SubItems[1].Text + "_" + item.Index);
                        //comboBox_showcameras.SelectedIndex = 0;
                    }

                    //add cameras into the comboBox_showcameras
                    t_count++;
                }
            }


            if (t_count > 0)
            {
                //timer1.Enabled = true;
                //_cascadeClassifier = new CascadeClassifier(@"..\data\haarcascades\haarcascade_frontalface_alt2.xml");
            }
        }