2 careerhealth Careerhealth2016.01.26 19:01 questions

Use OpenCV2 to open the camera, how to determine the number of cameras
This is a small problem.
According to the OpenCV prospectus said, open the camera, you can use the following statement form:
VideoCapture:: VideoCapture (int device)
For the device, the manual has the following tips
Device - ID of the opened video capturing device (i.e. a camera index).
I want to ask is, the use of multiple cameras, how to determine the corresponding to each camera ID.
For example, when there are two cameras, I try a 0, a 1, by looking at the captured images, the camera ID, but I do not know whether this order is fixed. But it is very passive, but do not know the switch after the operation, and then run the program, whether the device number will change.
I want to have a certain method can see the camera corresponding to the ID, but not found, I hope someone can answer.

The 1 answer

Wangyaninglm   Ds   Rxr 2016.01.26 22:29

This estimate must see source code is how to operate, the official document which is what you are saying, did not mention more details

Wangyaninglm Addressed to share ah, this I have seen a lot of people asked
The day before reply
Careerhealth Thank you, this is one way, but now I see the source of the foundation is weak, difficult.
About a month ago reply
Csdn user default icon
Upload photo
Insert a picture