FilterByIou

Function Usage

Filters objects based on the IOU value.

Prototype

void FilterByIou(std::vector<DetectBox> dets, std::vector<DetectBox>& sortBoxes, float iouThresh, IOUMethod method = UNION);
void FilterByIou(std::vector<ObjectInfo> dets, std::vector<ObjectInfo>& sortBoxes, float iouThresh, IOUMethod method = UNION);

Parameter Description

Parameter

Input/Output

Description

dets

Input

DetectBox (central point)/ObjectInfo (corner point) to be filtered.

sortBoxes

Output

Sorted array.

iouThresh

Input

Filtering threshold.

method

Input

IOU is calculated as follows:

  • MAX: The overlapped area is divided by the larger one of the two areas.
  • MIN: The overlapped area is divided by the smaller one of the two areas.
  • UNION: The overlapped area is divided by the union of the two areas.
  • DIOU: The value equals the value of UNION minus the IoU of the distances.