File size: 279 Bytes
12a4e72
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import cv2

def detect_people_from_image(image):
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    height, width = gray.shape
    # Dummy logic for simulation
    if cv2.countNonZero(gray) > (height * width * 0.2):
        return 3  # pretend 3 people detected
    return 1