I have a dataframe exactly looks like this. As you can see, I have performed 10 iteration steps to obtain following result.
In a row, column B describes a specific person, while column D and E determine the location in terms of (x y points) as they standing in frame n.
My question is, how am I going to perform counting in each iteration to determine whether any person is standing around the area of interest overtime? If they are standing in the region of interest, I could increase the counter by 1.
region_x = np.min(monitor_region[:,0])
region_y = np.min(monitor_region[:,1])
region_width = monitor_region.shape[1]
region_height = monitor_region.shape[0]
counter = 0
#Looking for logic here to distinguish specific person based on column B value
if((region_x < person["point_x"] < (region_x + region_width)) and (region_y < person["point_y"] < (region_y + region_height))):
print(counter += 1)
The desired outcome is that, I can use the "if" statement to increase the counter of each individual standing within region of interest.
E.g. Person 1 stands 3 times in region of interest. Person 2 stands 10 times in region of interest.

Aucun commentaire:
Enregistrer un commentaire