Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

[Opencv2.4.13]Two cameras hot plug, can't open the second camera

  1. working environment:Opencv2.4.13, VS2008, Camera(A and B)

  2. my question is: Connect A ----> Connect B: A,B both can be opened;Connect B ----> Connect A: B can be opened,but A can't.

  3. following is my code: when connect first camera:i use code VideoCapture videoCapture(0) when connect second camera:i use code VideoCapture videoCapture(1)
  4. B connect firstly then A.I check the opecv's code,i find that: when i call the videoCapture(1), the response of videoInput::getDevice is Camera B, not Camera A. It is so strange. Can somebody give me suggestion?

[Opencv2.4.13]Two cameras hot plug, can't open the second camera

  1. working environment:Opencv2.4.13, VS2008, Camera(A and B)

  2. my question is: Connect A ----> Connect B: A,B both can be opened;Connect B ----> Connect A: B can be opened,but A can't.

  3. following is my code: when connect first camera:i use code VideoCapture videoCapture(0) when connect second camera:i use code VideoCapture videoCapture(1)
  4. B connect firstly then A.I check the opecv's code,i find that: when i call the videoCapture(1), the response of videoInput::getDevice is Camera B, not Camera A. It is so strange. Can
  5. Usb device number can be dynamic changed. When I connect B, the B's device NO. is 0. Then I connect A, B's device change to 1 and A's device NO. is 0. I think Opencv have not take this situation into account.Can somebody give me suggestion?