1

I had several cameras connected to my PC. In my applicaion I need to choose one of them. But I couldn't find how to do this. Is there any function for listing all connected cameras?

Eugene
  • 1,037
  • 4
  • 20
  • 34
  • http://stackoverflow.com/questions/10471938/detect-the-number-of-webcams-cameras-on-pc-with-opencv – m47h Sep 25 '13 at 14:28
  • @m47h And if I need the list of cameras' names, what shall I do? – Eugene Sep 25 '13 at 14:42
  • opencv doesnt provide any methods for this. But to list the names you can try these two links http://stackoverflow.com/questions/4286223/how-to-get-a-list-of-video-capture-devices-web-cameras-on-windows-c and http://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c – user2727765 Sep 25 '13 at 15:00

1 Answers1

-1
CvCapture* capture;
capture = cvCaptureFromCAM( 0 );

cvCaptureFromCAM will allow you to choose different cameras- start at 0. Then just take notes regarding which camera corresponds to which number.

elCunado
  • 49
  • 5
  • 1
    I know this, the question is in that how to find what camera has a certain number? – Eugene Sep 25 '13 at 19:20
  • This is not the way it is done today, use [VideoCapture](http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture) instead – m47h Sep 26 '13 at 09:43