-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIOUT.h
38 lines (35 loc) · 1.04 KB
/
IOUT.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <vector>
/******************************************************************************
* STRUCTS
******************************************************************************/
struct BoundingBox
{
// x-component of top left coordinate
float x;
// y-component of top left coordinate
float y;
// width of the box
float w;
// height of the box
float h;
// score of the box;
float score;
};
struct Track
{
std::vector<BoundingBox> boxes;
float max_score;
int start_frame;
int id;
};
// Return the IoU between two boxes
inline float intersectionOverUnion(BoundingBox box1, BoundingBox box2);
// Returns the index of the bounding box with the highest IoU
inline int highestIOU(BoundingBox box, std::vector<BoundingBox> boxes);
// Starts IOUT tracker
std::vector< Track > track_iou(float sigma_l, float sigma_h, float sigma_iou, float t_min,
std::vector< std::vector<BoundingBox> > detections);
// Give an ID to the result tracks from "track_iou"
// Method useful the way IOU is implemented in Python
//void enumerate_tracks();