i am trying to use 3 cameras to capture photos however i am unable to produce all 3 of it. i have 2 external webcam ( Microsoft Cinema Webcam ) and 1 internal laptop camera , i used my previous laptop and it works perfectly however when i tried to use another laptop it is unable to work.
I tried some ways like testing each camera and i found out that i can use only 2 webcam at the same time using my program despite having 3 at the other laptop.
I am unable to make my laptop camera work . Any idea how?
Any idea how to get this work?
namespace Camera { public partial class CameraOutput : Form { private Capture _capture, _capture2, _capture3; private bool captureInProgress; private bool saveToFile; private Font font = new Font("Calibri", 14); public CameraOutput() { InitializeComponent(); } private void ProcessFrame(Object sender, EventArgs arg) { Image<Bgr, Byte> ImageFrame = _capture.QueryFrame(); Image<Bgr, Byte> ImageFrame2 = _capture2.QueryFrame(); Image<Bgr, Byte> ImageFrame3 = _capture3.QueryFrame(); CamImageBox.Image = ImageFrame; CamImageBox2.Image = ImageFrame3; CamImageBox3.Image = ImageFrame2; //image_Form1 = Image.FromFile(@"C:\center90\center90(1).jpg"); if (saveToFile) { ImageFrame.Save(@"C:\Users\L31101\Desktop\Camera\Camera\bin\Debug\left\left.jpg"); ImageFrame3.Save(@"C:\Users\L31101\Desktop\Camera\Camera\bin\Debug\center\center.jpg"); ImageFrame2.Save(@"C:\Users\L31101\Desktop\Camera\Camera\bin\Debug\right\right.jpg"); //System.Drawing.Image img = ImageFrame3.ToBitmap(); //image_Form1 = img; CameraCoordinates form2 = new CameraCoordinates(ImageFrame3.ToBitmap(),ImageFrame.ToBitmap(),ImageFrame2.ToBitmap()); form2.Show(); saveToFile = !saveToFile; } } private void CameraOutput_Load(object sender, EventArgs e) { #region if capture is not created, create it now pictureBox1.Enabled = true; if (_capture == null) { try { _capture = new Capture(1); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } if (_capture2 == null) { try { _capture2 = new Capture(2); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } if (_capture3 == null) { try { _capture3 = new Capture(3); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } #endregion if (_capture != null) { if (pictureBox1.Enabled == false) { Application.Idle -= ProcessFrame; } else { Application.Idle += ProcessFrame; } captureInProgress = !captureInProgress; } if (_capture2 != null) { if (pictureBox1.Enabled == false) { Application.Idle -= ProcessFrame; } else { Application.Idle += ProcessFrame; } captureInProgress = !captureInProgress; } if (_capture3 != null) { if (pictureBox1.Enabled == false) { Application.Idle -= ProcessFrame; } else { Application.Idle += ProcessFrame; } captureInProgress = !captureInProgress; } } private void ReleaseData() { if (_capture != null) _capture.Dispose(); if (_capture2 != null) _capture.Dispose(); if (_capture3 != null) _capture.Dispose(); } Image image_Form1; public Image Image_Form1 { get { return image_Form1; } set { image_Form1 = value; } } private void pictureBox1_Click(object sender, EventArgs e) { saveToFile = !saveToFile; MessageBox.Show("Done"); }