viep-fault-detection / services /shadow_detection.py
Sanjayraju30's picture
Update services/shadow_detection.py
1953d7e verified
raw
history blame
232 Bytes
import cv2
import numpy as np
def detect_shadow_coverage(image_path):
img = cv2.imread(image_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
shadow_ratio = (gray < 50).sum() / gray.size
return shadow_ratio > 0.3