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.