-1

I'm trying for object tracking using webcam using yolov4. I want to know the meaning of this line -> bboxes = utils.format_boxes(bboxes, original_h, original_w). I'm using https://github.com/theAIGuysCode/yolov4-deepsort.git repository for cloning. One can find the above line in object_tracer.py file. - line 151.

# format bounding boxes from normalized ymin, xmin, ymax, xmax ---> xmin, ymin, width, height
        original_h, original_w, _ = frame.shape
        bboxes = utils.format_boxes(bboxes, original_h, original_w)
Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36

1 Answers1

0

The answer is literally in the comment at the first line of the code you pasted.

This method translates bounding boxes in normalized coordinates (xmin, ymin, xmax, y max) to not normalized coordinates (xmin, ymin, width, height).

Coordinates are usually expressed in pixels, which is the not normalized form. Normalized coordinates are ones that are divided by the image dimensions, i.e. numbers between 0 and 1.

The point (xmin, ymin) is the top-left corner of the bounding box and (xmax, ymax) the bottom-right one. (width, height) is simply the dimensio of the bounding box.

Louis Lac
  • 5,298
  • 1
  • 21
  • 36