Spaces:
Runtime error
Runtime error
File size: 289 Bytes
7e7091f |
1 2 3 4 5 6 7 8 9 |
import numpy as np
import cv2
def detect_shadow_coverage(image_path):
image = cv2.imread(image_path)
grayscale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
shadow_ratio = (grayscale < 50).sum() / grayscale.size
return shadow_ratio > 0.3 # Simulated threshold: >30% shadowed
|