Skip to content

Commit

Permalink
Added points for top and bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbitsyfeet committed Nov 21, 2020
1 parent d691592 commit 17078c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/multitracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,13 @@ def export_meta(vid_dir):
# If tracker region is no longer selected, delete moving radius
regions.del_moving_radius(tracker.get_name())

#center dot
#center dot
cv2.circle(frame, (int(center_x),int(center_y)),2,(0,0,255),-1)

top = (int(center_x), int(center_y + height/2))
bottom = (int(center_x), int(center_y - height/2))
cv2.circle(frame, top, 3, (0,255,255),-1)
cv2.circle(frame, bottom, 3, (0,255,255),-1)
in_region = regions.test_radius((center_x, center_y))

if input_dialog.play_state == True:
Expand All @@ -1074,9 +1078,12 @@ def export_meta(vid_dir):
center, _, dim, other_room, total_people, is_chair = tracker.data_dict[frame_number]

if tracker.is_region() is True and tracker.get_name() != "":

point = (int(center[0] - dim[0]), int(center[1] - dim[1]))
dim = (int(dim[0]*2), int(dim[1]*2))
regions.set_moving_radius(tracker.get_name(), point, dim)
top = (int(center[0]) - dim[0], int(center[1], - dim[1]/2))
bottom = (int(center[0]) - dim[0], int(center[1], + dim[1]/2))

if tracker.is_region() is False:
# If tracker region is no longer selected, delete moving radius
Expand All @@ -1087,10 +1094,14 @@ def export_meta(vid_dir):
# print("Green")
#center dot
cv2.circle(frame, (int(center[0]),int(center[1])),2,(0,255,0),-1)
cv2.circle(frame, top, 3, (0,255,0),-1)
cv2.circle(frame, bottom, 3, (0,255,0),-1)

else:
# print("Red Dot")
cv2.circle(frame, (int(center[0]),int(center[1])),2,(0,0,255),-1)
cv2.circle(frame, top, 3, (0,0,255),-1)
cv2.circle(frame, bottom, 3, (0,0,255),-1)

#Exclude if you want regions to not exist
elif not input_dialog.retain_region:
Expand Down

0 comments on commit 17078c1

Please sign in to comment.