Unique identification of OpenCV cameras

I am currently using opencv2.4.8with three cameras on Win 7 in C ++. I understand how to read from a camera through VideoCapture cap, etc., but I am having problems determining which camera is.

From what I can understand, it cap.open(int num)takes into the camera index. In my case, these are 0, 1, and 2.

    CAMA = 0 
    CAMB = 1 
    CAMC = 2

If, however, before starting the program, the camera with index 0 becomes disabled, it changes the camera index.

    CAMA //GONE
    CAMB = 0
    CAMC = 1

So, is there any way to remember which camera is (besides displaying each camera to the user every time ...)? Perhaps launched some kind of unique identifier for the camera, which can be read at restart?

USB device - Device Class guid, . ?

. , ?

+4
1

, , .

, , - OpenCV, OpenCV .

Windows DirectShow, API- . , . , , OpenCV.

+3

Source: https://habr.com/ru/post/1544389/


All Articles