viep-fault-detection / services /thermal_service.py
Sanjayraju30's picture
Rename thermal_service.py to services/thermal_service.py
0291f7c verified
raw
history blame
309 Bytes
import numpy as np
import cv2
# Simulate thermal anomaly by analyzing red channel brightness
def detect_thermal_anomalies(image_path):
image = cv2.imread(image_path)
red_channel = image[:, :, 2]
avg_temp = red_channel.mean()
return avg_temp > 180 # Simulate overheat detection (like >75°C)