1

For some reason, my script fails to recognize the USB camera connected (MU500), it does, however, recognize and display my other camera which is an analog converted to USB camera. The below script is a portion of the GUI that runs and displays the video capture.

    import cv

    camera = int(self.camera.GetValue())-1
    img_name = self.img_name.GetValue()+'.jpg'
    cap = cv2.VideoCapture(camera)

    while(cap.isOpened()):

        ret, frame = cap.read()
        cv2.imshow('Camera',frame)

        if cv2.waitKey(1) & 0xFF==ord('q'):
            cap.release()
            cv2.destroyAllWindows()
            break
        elif cv2.waitKey(1)== ord('s'):

            cv2.imwrite(filename=img_name, img=frame)
            cap.release()
            print("Image saved!")
            break

The user inputs '1' to access camera 1, or '2' for camera 2 and so on. I have tried having just MU500 connected and both connected. Neither recognize MU500. MU500 uses an AmScope driver and is listed as an imaging device in device manager.

Is there anyone who can help me?

1 Answers1

0

You may try to install:

sudo apt-get install v4l-utils

and use:

v4l2-ctl --list-devices

to list all your devices and their properties.

lenik
  • 21,662
  • 4
  • 29
  • 38
  • @KlausD. you're right. maybe my answer will nudge OP to explore the right approach – lenik Feb 07 '20 at 02:46
  • I'm running on windows, sudo apt only works on Linux based terminals doesn't it? I have tried listing the cameras available using opencv and only the one shows. – James Blyth Feb 07 '20 at 03:20