I am trying to learn image processing, but it is a pain because of camera selection.
In C# Winform, I am trying to get video capture by using the camera. When I use integrated webcam, everything works fine.
However, when i pick USB connected webcam, nothing happens in the app, it shows nothing, then gives an error.
The integrated webcam index as '
0
' and usb webcam is '
1
'.
The error I am getting is:
System.NullReferenceException: 'Nesne başvurusu bir nesnenin örneğine ayarlanmadı.'
private void btnStart_Click(object sender, EventArgs e)
{
if (capture == null)
{
capture = new VideoCapture(1);
}
capture.ImageGrabbed += Capture_ImageGrabbed;
capture.Start();
}
If I choose '
0
' there is no problem but if I pick '
1
', nothing happens.
What I have tried:
I tried using
AforgeDirectShow
library, It works, but I want to do this with emgu CV. In principle, there should be no problem.
Also, I do not want to have an extra library for future apps which will be really memory consumer.
I go through whole web sites, there is almost the same problem, but nothing works for me.
Is there an effect of having usb 2.0 or 3.0?