OpenCV + Python + GigE Vision Camera
Question: I want to ask if someone have idea if it's possible to implement a
VideoCapture using OpenCV+Python and a GigE Vision Camera, I tried with
cv2.VideoCapture(0) but I am always obtaining the video of the integrated
webcam. I was trying new beta of OpenCV and using Windows

    
    
    import numpy as np
    import cv2
    
    capture = cv2.VideoCapture(0)
    
    while (True):
     frame = capture.read()
     cv2.imshow('camera',frame)
     if cv2.waitKey(1) & 0xFF == odd('q'):
      break
    
    capture.release()
    cv2.destroyAllWindows()
    

Thanks in advance.


Answer: Passing another integer value in function cv2.VideoCapture(int) instead of 0
selects another camera that is connected. example cv2.VideoCapture(1)

    
    
    import numpy as np
    import cv2
    
    capture = cv2.VideoCapture(1)
    
    while (True):
     frame = capture.read()
     cv2.imshow('camera',frame)
     if cv2.waitKey(1) & 0xFF == odd('q'):
      break
    
    capture.release()
    cv2.destroyAllWindows()
    

