Cloud Analyzer - OtagoPolytechnic/Cloudy-with-a-Chance-of-LoRa GitHub Wiki

☁️ Cloud Image Recognition Robot

SkyBot Image

πŸ“ Overview

This project aimed to develop a Raspberry Pi-based robot equipped with a webcam that captures images of the sky at regular intervals. These images would be uploaded to a web platform and passed to a cloud-based AI model for weather condition classification.

While the hardware setup and image capture script were implemented, the full integration with the website and cloud AI was left out of scope for this phase due to security and infrastructure concerns. This functionality is intended for implementation by a future group.


🎯 Project Goals

  • βœ… Capture images of the sky using a Pi-connected webcam.
  • ⏳ Upload images to a website and AI cloud model.
  • ⏳ Analyze cloud types and sky conditions using AI.
  • ⏳ Display results on the frontend platform in near real-time.

πŸ—οΈ System Architecture

1. Raspberry Pi Hardware

  • Raspberry Pi (2018 model)
  • USB webcam
  • Internet access via Ethernet or Wi-Fi

2. Cloud AI (Future Work)

  • Information Hosted at: Cloud AI Model
  • Image classification of cloud types and coverage
  • Model outputs stored and fetched via API

3. Web Application

  • Displays current cloud status and conditions
  • Pulls latest image classifications from the database

πŸ” Workflow

  1. The Raspberry Pi captures an image every 10 minutes.
  2. (Future) The image is securely uploaded to the cloud server/API.
  3. (Future) Cloud AI analyzes the image and classifies sky conditions.
  4. (Future) Results are saved and displayed on the website.

🚧 Out-of-Scope / Security Limitations

Due to time constraints and security considerations, the following were not implemented:

  • ❌ Open Ports or Live FTP Access: Exposes the Raspberry Pi to vulnerability.
  • ❌ Unrestricted API Usage: Risk of overuse or abuse without rate limiting/authentication.
  • βœ… SSH Transfers are Preferred: For future implementation, use SSH/SCP to transfer images securely.

We recommend the next group:

  • Use a secure cron job with scp or rsync over SSH for uploads.
  • Rotate SSH keys and credentials periodically.
  • Coordinate with Vaughn to obtain secure Raspberry Pi credentials.

πŸ“Έ Webcam Timelapse Script

Captures an image every 2 minutes and saves to the local filesystem.

import cv2
import time
from datetime import datetime
import os

save_dir = "/home/pi/webcam_images"
os.makedirs(save_dir, exist_ok=True)

camera = cv2.VideoCapture(0)
camera.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)

print("Timelapse script running. Capturing every 2 minutes...")

while True:
    ret, frame = camera.read()
    if ret:
        timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
        filename = os.path.join(save_dir, f"image_{timestamp}.jpg")
        cv2.imwrite(filename, frame)
        print(f"Captured {filename}")
    else:
        print("Failed to capture image.")
    
    time.sleep(120)


πŸš€ Getting Started

  • Run the script on boot using a systemd service or crontab.
  • Use SSH (scp) for secure image transfers to your web server.
  • Credentials for the Raspberry Pi can be retrieved from Vaughn.
  • See Rob for more information and seek OPS team.

πŸ“š Learning Resources

These courses helped us understand Pi setup and SSH management:


πŸ”„ Handover Notes

  • The webcam setup is complete and tested locally.
  • Secure transfer logic and cloud AI integration should be the next group’s primary focus.
  • Document access and authentication flows properly.
  • Always consider rate limiting, authentication tokens, and cloud cost control.

Add your changes and feature understanding here : https://github.com/OtagoPolytechnic/Cloudy-with-a-Chance-of-LoRa/wiki/Cloud-Image-Processing-2025-S2