Added some conditions to check the in proximity range

parent 800c410f
......@@ -74,6 +74,30 @@ def forFrame(frame_number, output_array, outpun_count, returned_frame):
if kettle_box.intersection(person_box) != None:
print("Kettle - Person is in the Kettles Danger Region")
overlap = True
if x1 >= k_x1 & x1 <= k_x2:
print("Kettle - X1 is inside the Persons Danger region!")
overlap = True
if x2 >= k_x1 & x2 <= k_x2:
print("Kettle - X2 is inside the Persons Danger region!")
overlap = True
if y1 >= k_y2 & y1 <= k_y1:
print("Kettle - Y1 is inside the Persons Danger region!")
overlap = True
if y2 >= k_y2 & y2 <= k_y2:
print("Kettle - Y2 is inside the Persons Danger region!")
overlap = True
# If kettle and child bounding bor overlap, Calculate Distance between center point of two boxes
if(overlap == True):
kettle_midpoint = ((k_x1+k_x2)/2, (k_y1+k_y2)/2)
distance = ((((kettle_midpoint[0] - person_midpoint[0])**2) + ((kettle_midpoint[1]
- person_midpoint[1])**2) )**0.5)
else:
print("No Kettles Found")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment