Edge computing processes data on a device or nearby gateway instead of sending every raw input to a remote server or cloud. It complements cloud computing: local processing handles time-sensitive filtering, analytics, inference, and decisions, while selected results can still flow to a digital twin or cloud service. The main gains are lower latency and less data to transmit. section 1.2.2 section 3.4.1
For a video-fed digital twin, choose what crosses the network:
- Continuous streaming sends the whole feed for monitoring or storage, at high bandwidth and storage cost. section 2.3.3
- Change detection sends or stores fragments when a relevant change occurs. section 2.3.3
- Edge processing extracts observations locally and sends only derived data, such as a vehicle-detection event or occupancy count. section 2.3.3
A battery-powered water-meter camera
A camera photographs an analog meter, runs a model on the device to read its digits, and sends the reading over LoRaWAN to a digital twin. Extracting the reading reduces a roughly 100 KB image to 10 bytes—a 10,000-fold transmission reduction. Periodically sending a raw image provides a way to check the local result. Field conditions still matter: shadows, glare, and condensation degraded recognition, requiring calibration images, model retraining, and a physical enclosure. section 3.4.1
Listing 2.3 Using the YOLO model to detect multiple objects in a video stream
import cv2
import numpy as np
from ultralytics import YOLO
def run_webcam_detection():
model = YOLO("yolov8n.pt") #1
cap = cv2.VideoCapture(0) #2
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640) #3
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
while True:
ret, frame = cap.read() #4
results = model(frame) #5
annotated_frame = results[0].plot() #6
cv2.imshow("YOLOv8 Detection", annotated_frame) #7
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
The webcam listing loads a YOLO model, reads video frames, runs local object detection, and displays annotated results. It demonstrates local inference; selective event transmission would need to be added separately. section 2.3.3




