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

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:

主站蜘蛛池模板: 威信县| 乐亭县| 鄂托克前旗| 九江市| 蕲春县| 康马县| 衡东县| 枣庄市| 会昌县| 登封市| 河北区| 麟游县| 崇义县| 河曲县| 镇康县| 岳西县| 中超| 资源县| 秦皇岛市| 隆昌县| 离岛区| 北宁市| 泰宁县| 乌鲁木齐市| 五寨县| 达拉特旗| 同德县| 汾西县| 镶黄旗| 云南省| 黔东| 阿巴嘎旗| 海兴县| 安远县| 从化市| 榆中县| 万年县| 姜堰市| 淮滨县| 平远县| 东莞市|