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?