I am currently trying to access a Basler camera, that is connected to my computer via Ethernet, from Visual Studio. The camera is not displayed in the device manager, but I can ping it in the command prompt so I guess it is connected. The general idea is to scan a surface and get a live picture.
This is the code snippet:
import cv2
import numpy as np
cap = cv2.VideoCapture('http://172.20.1.40:80/?stream')
But as soon as I execute the program, I get the error that it is unable to open the camera. If i do "cv2.VideoCapture(0) or (1), it also does not work.
Does anyone have an idea what the problem might be?
Many thanks and regards
I presume that you use an industrial series of Basler camera (ace / ace 2 etc.). These models are not IP cameras and do not produce RSTP stream. They rely on GigE Vision protocol.
In order to connect them to your python app:
For full picture of your situation, please paste a model of camera.
Hope it helps.