cvCreateCameraCapture: fix using preffered interface
The provided interface id must be removed from the index. Otherwise, the underlying implementations are using a wrong camera id. Example: VideoCapture(800) fails because PvAPI tries to open a camera on position 800
This commit is contained in:
parent
68f8d1cef0
commit
fbcf5f0918
@ -129,6 +129,9 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
// interpret preferred interface (0 = autodetect)
|
||||
int pref = (index / 100) * 100;
|
||||
|
||||
// remove pref from index
|
||||
index -= pref;
|
||||
|
||||
// local variable to memorize the captured device
|
||||
CvCapture *capture = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user