def prep_frame(ftpts, frame, camera, errors, occupants, ped_bboxes, veh_bboxes, classes): pix_real = camera["im-gps"] real_pix = camera["gps-im"] origin = camera["estimated_camera_location"] frame_size = camera["frame_size"] print(frame_size) #frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) if len(ped_bboxes) > 0: frame = utils.draw_bbox(frame, ped_bboxes, classes, show_label=True, redact=True) frame, x = pr.draw_radius(frame, ftpts, real_pix, pix_real, origin) utils.overlay_occupancy(frame, errors, occupants, frame_size) if len(veh_bboxes) > 0: frame = utils.draw_bbox(frame, veh_bboxes, classes, show_label=False, redact=False) #result = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR) return frame
def prep_frame(ftpts, frame, vid, errors, occupants, bboxes): pix_real = vid[2] real_pix = vid[3] origin = vid[4] frame_size = vid[7] frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) if len(bboxes) > 0: frame = utils.draw_bbox(frame, bboxes, show_label=False) frame, x = pr.draw_radius(frame, ftpts, real_pix, pix_real, origin) utils.overlay_occupancy(frame, errors, occupants, frame_size) result = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR) return result