Can't connect to external usb camera

Hello,

I use a Motic USB-camera for microscopy incl image software. Because the functionality I’d like to have isnt’t given in the software, I started to write some python code. I installed opencv and tried different indices in “cv.VideoCapture(0…20)”-function, but I can’t connect to camera. The camera is listed in my device manager (Win 10), so driver are installed:
Unbenannt

Is it possible to adress the camera with ids shown in the device manager? I tried “cv.VideoCapture(USB\VID_232F&PID_0101&REV_0000)” for instance but it doesn’t work.

I searched for commands showing unique device id. I found “ls/dev/video*”, but I don’t know where to use this command (cmd or VS terminal doesn’t work). Or is it just for linux os?

Thanks for help!

Regards

try with VLC or any other camera app. if that doesn’t work either, it’s not an OpenCV issue, it’s an issue with your device and its drivers.

@crackwitz: Thanks for your tip with VLC. Camera doesn’t work on it, so problem seems to be driven by the driver. But I don’t understand. First: I installed TWAIN driver and Second: the camera is known by the os. So, what’s the problem?

Is there anybody who can answer my question relating the camera id? Is it possible to use the openCV function with a specific id?

Thanks!!

I’m not sure if TWAIN is still a thing. in any case, it’s probably a different API from what DirectShow and MSMF expose… you could look into that.

these days, USB cameras support the USB Universal Video Class (UVC).

“known by” the OS only means the OS sees the USB device. it doesn’t mean the thing appears as a video device.

I know what you mean, but the point is: it appears as a video device. And the same “WdfCoInstallerXXX.dll” files can be found in the SDK (I asked the manufactor for that and they send me today). I will try to solve the problem with the SDK, but I still don’t know why it should not work with files (dlls and so on) I got yet.
Unbenannt

if you can’t access the camera using VLC or the Windows Camera app, it’s a problem with the camera NOT using the usual Video APIs.

it may say “Bildverarbeitungsgerät” there but OpenCV isn’t made to talk to flatbed scanners (TWAIN) or USB-attached DSLRs (might also use TWAIN).

ask the manufacturer if they support USB UVC, or at least some way to get a video feed with DirectShow or MS Media Foundation.

Make sure this setting is turned on on you camera privacy & security settings.

I wasn’t able to access over VLC or Python code, but after allowing access it works.