Log bbox coordinates from object tracker on screen?

Hey does anyone know I’d get the bbox coordinates to show in the bounding box label for the object tracker? I’ve got it logging in to the console.

Hi @Steve_Brodie1,

Please add the following code for draw_bounding_box_on_image function in order to display the coordinates along the class label:

  bbox_str = f"({left:.2f}, {top:.2f}) - ({right:.2f}, {bottom:.2f})"
  display_str_list = list(display_str_list)  # Make a copy of the list if needed
  display_str_list.append(bbox_str)

This code displays the coordinate values relative to the image(absolute pixel values).

If you would like to display normalized coordinated values, please change:

left-->xmin, top-->ymin, right-->xmax, bottom-->ymax

 bbox_str = f"({xmin:.2f}, {ymin:.2f}) - ({xmax:.2f}, {ymax:.2f})"
 display_str_list = list(display_str_list)  # Make a copy of the list if needed
 display_str_list.append(bbox_str)

I have incorporated the above code changes in this object detection tutorial. Please refer to this gist.

Here is the output image(absolute coordinates):


Here is the output image with normalized coordinates:

Thank You