- Mastering OpenCV 4 with Python
- Alberto Fernández Villán
- 198字
- 2021-07-02 12:07:17
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.cgi. If 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:

- Instant Testing with CasperJS
- Mastering RabbitMQ
- Getting Started with ResearchKit
- Scala Design Patterns
- Java面向?qū)ο蟪绦蜷_發(fā)及實戰(zhàn)
- 高級C/C++編譯技術(shù)(典藏版)
- C語言從入門到精通(第4版)
- Java Web基礎(chǔ)與實例教程
- TypeScript實戰(zhàn)指南
- Learning Network Forensics
- Mastering KnockoutJS
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- 精通網(wǎng)絡(luò)視頻核心開發(fā)技術(shù)
- 計算機應(yīng)用基礎(chǔ)實踐教程
- Julia數(shù)據(jù)科學(xué)應(yīng)用