פיתוח בינה מלאוכתית – חיבור מצלמת WIFI פשוטה לרשת

בפרוייקט זה נחבר כ 24 מצלמות וואפי פי ישירות לרשת שלנו של הבינה מלאכותית וניתן לה ללמוד

Tp-link Tapo TC65 Outdoor Security Wi-Fi Camera Purchase

This summer, we decided it was time to look again at putting an external camera on our roof to use on the Virtual Swanage website. After looking at various options, we ordered a tp-link TC65 Outdoor Security Wi-Fi Camera, which cost £45.

The camera specifications are:

The camera does not have the option to upload an image directly to our server but supports the Real Time Streaming Protocol (RTSP), which allows the capture of the video stream by another device on the network.

The camera has connections for power and an RJ45 network connection. We do not want to connect another network device on the roof after the lightning strike a few years ago, which destroyed all of our networked devices and computers.

We mounted the new camera to the bracket which holds our TV antenna, and the power cable is routed into the loft space via one of the window frames. This goes into the supplied PSU adapter to power the camera.

Setting up the Tapo Camera for RTSP streaming

To use the RTSP protocol, you must set a username and password in the camera and find its IP address.

The camera uses the following URL format to access the video stream:

rtsp://username:password@IP-Address/stream1

Your internet router assigns the camera’s IP address; you can find it on your router’s DHCP list or in the Tapo app.

Finding the IP address in the Tapo app

  1. On the app’s home page, select your camera model/name.
  2. Tap the settings icon (cog) at the top-right of the app.
  3. Tap the camera name at the top of the Camera Settings screen.
  4. The network settings will be shown, including the IP address and MAC address of the device.

Setting the username and password

  1. On the app’s home page, select your camera model/name.
  2. Tap the settings icon (cog) at the top-right of the app.
  3. Tap Advanced Settings, then select Device Account
  4. Enter your new username and password and save.

Capturing the Images

OpenCV Logo

We have a small Linux server running 24/7 in our network cupboard, and with help from Chat GPT, we created a Python script to access the video feed via its RTSP URL and OpenCV.

OpenCV is a library of programming functions mainly for real-time computer vision and processing.

The Python script uses a threading timer to capture a new frame every 30 seconds.

The capture function first opens the video stream and captures the current frame. If this succeeds, it crops the image to a 1920 x 1080 size.

There are windows visible in the houses directly in front of the camera, which are blurred using the GaussianBlur function in OpenCV.

The image is then saved to a folder on the server with a timestamp, and a separate script uploads the latest image to the server every 30 seconds.

In the future if our internet provider decides to upgrade us to fibre broadband we will look at setting up a video stream and upgrading to a better quality 4K camera.

 

כתיבת תגובה