官术网_书友最值得收藏!

Reading from an IP camera

To finish with cv2.VideoCapture, we are going to see how we can read from an IP camera. Reading from an IP camera in OpenCV is very similar to reading from a file. In this sense, only the parameter to the constructor of cv2.VideoCapture should be changed. The good thing about this is that you do not need an IP camera in your local network to try this functionality. There are many public IP cameras you can try to connect. For example, we are going to connect to an IP public camera, which is placed at Club Nàutic Port de la Selva – Costa Brava – Cap de Creus (Girona, Spain). The web page of this port is hosted at https://www.cnps.cat/. You can navigate to the webcam sections (https://www.cnps.cat/webcams/) to find some webcams to connect with.

Therefore, the only thing you have to modify is the parameter that's given to cv2.VideCapture. In this case, it's http://217.126.89.102:8010/axis-cgi/mjpg/video.cgiIf you execute this example (read_ip_camera.py), you should see something similar to the following screenshot, where both the BGR and the grayscale images that were obtained from the IP camera are shown:

主站蜘蛛池模板: 洛隆县| 临夏县| 枣庄市| 临高县| 米脂县| 剑河县| 高唐县| 肇州县| 太谷县| 屏山县| 江源县| 周至县| 栖霞市| 泌阳县| 邵武市| 乌兰浩特市| 泗洪县| 安顺市| 常山县| 灵山县| 金乡县| 岑溪市| 康保县| 荆门市| 灌阳县| 芒康县| 蓬莱市| 利川市| 黎川县| 昆明市| 榆中县| 敦化市| 平南县| 梅州市| 孝昌县| 连平县| 福安市| 东乌珠穆沁旗| 布拖县| 凤山县| 潼南县|