def draw_boxed3d_to_rgb(rgb, boxes3d): projections = box3d_to_rgb_projections(boxes3d) rgb = box3d.draw_rgb_projections(rgb, projections, color=(255, 0, 255), thickness=1) return rgb
def draw_box3d_on_camera(rgb, boxes3d, color=(255, 0, 255), thickness=1, text_lables=[]): projections = box3d.box3d_to_rgb_box(boxes3d) rgb = box3d.draw_rgb_projections(rgb, projections, color=color, thickness=thickness) font = cv2.FONT_HERSHEY_SIMPLEX for i,text in enumerate(text_lables): text_pos = (np.min(projections[i,:, 0]), max(np.min(projections[i,:, 1]), 15) ) cv2.putText(rgb, text, text_pos, font, 0.7, (0, 255, 100), 1, cv2.LINE_AA) return rgb
def draw_box3d_on_camera_obj(rgb, boxes3d, P, R0_rect, Tr_velo_to_cam, color=(255, 0, 255), thickness=1, text_lables=[]): projections = box3d.box3d_to_rgb_box_obj(boxes3d, P, R0_rect, Tr_velo_to_cam) rgb = box3d.draw_rgb_projections(rgb, projections, color=color, thickness=thickness) font = cv2.FONT_HERSHEY_SIMPLEX for i,text in enumerate(text_lables): text_pos = (np.min(projections[i,:, 0]), max(np.min(projections[i,:, 1]), 15) ) cv2.putText(rgb, text, text_pos, font, 0.7, (0, 255, 100), 1, cv2.LINE_AA) return rgb